File tree 1 file changed +20
-0
lines changed
llvm/test/Transforms/InstCombine
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2008,5 +2008,25 @@ if.else:
2008
2008
ret i8 %other
2009
2009
}
2010
2010
2011
+ define i8 @simplifydemanded_context (i8 %x , i8 %y ) {
2012
+ ; CHECK-LABEL: @simplifydemanded_context(
2013
+ ; CHECK-NEXT: [[AND1:%.*]] = and i8 [[X:%.*]], 1
2014
+ ; CHECK-NEXT: call void @dummy()
2015
+ ; CHECK-NEXT: [[X_LOBITS:%.*]] = and i8 [[X]], 3
2016
+ ; CHECK-NEXT: [[PRECOND:%.*]] = icmp eq i8 [[X_LOBITS]], 0
2017
+ ; CHECK-NEXT: call void @llvm.assume(i1 [[PRECOND]])
2018
+ ; CHECK-NEXT: [[AND2:%.*]] = and i8 [[AND1]], [[Y:%.*]]
2019
+ ; CHECK-NEXT: ret i8 [[AND2]]
2020
+ ;
2021
+ %and1 = and i8 %x , 1
2022
+ call void @dummy () ; may unwind
2023
+ %x.lobits = and i8 %x , 3
2024
+ %precond = icmp eq i8 %x.lobits , 0
2025
+ call void @llvm.assume (i1 %precond )
2026
+ %and2 = and i8 %and1 , %y
2027
+ ret i8 %and2
2028
+ }
2029
+
2030
+ declare void @dummy ()
2011
2031
declare void @use (i1 )
2012
2032
declare void @sink (i8 )
You can’t perform that action at this time.
0 commit comments