File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -157,3 +157,26 @@ define <2 x i8> @xor_add_splat_undef(<2 x i8> %x) {
157
157
%add = add <2 x i8 > %xor , <i8 42 , i8 42 >
158
158
ret <2 x i8 > %add
159
159
}
160
+
161
+ define i32 @xor_dominating_cond (i32 %x ) {
162
+ ; CHECK-LABEL: @xor_dominating_cond(
163
+ ; CHECK-NEXT: entry:
164
+ ; CHECK-NEXT: [[COND:%.*]] = icmp ult i32 [[X:%.*]], 256
165
+ ; CHECK-NEXT: br i1 [[COND]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
166
+ ; CHECK: if.then:
167
+ ; CHECK-NEXT: [[A:%.*]] = xor i32 [[X]], 255
168
+ ; CHECK-NEXT: ret i32 [[A]]
169
+ ; CHECK: if.end:
170
+ ; CHECK-NEXT: ret i32 [[X]]
171
+ ;
172
+ entry:
173
+ %cond = icmp ult i32 %x , 256
174
+ br i1 %cond , label %if.then , label %if.end
175
+
176
+ if.then:
177
+ %a = sub i32 255 , %x
178
+ ret i32 %a
179
+
180
+ if.end:
181
+ ret i32 %x
182
+ }
You can’t perform that action at this time.
0 commit comments