forked from OSchip/llvm-project
[InstCombine] add tests to show potentially bogus application of DeMorgan (NFC)
llvm-svn: 301714
This commit is contained in:
parent
513dc805eb
commit
c8ab6bb27d
|
|
@ -53,3 +53,25 @@ define i32 @func4(i32 %a, i32 %b) {
|
|||
ret i32 %tmp3
|
||||
}
|
||||
|
||||
define i32 @demorganize_constant1(i32 %a) {
|
||||
; CHECK-LABEL: @demorganize_constant1(
|
||||
; CHECK-NEXT: [[A_NOT:%.*]] = or i32 %a, -16
|
||||
; CHECK-NEXT: [[AND1:%.*]] = xor i32 [[A_NOT]], 15
|
||||
; CHECK-NEXT: ret i32 [[AND1]]
|
||||
;
|
||||
%and = and i32 %a, 15
|
||||
%and1 = xor i32 %and, -1
|
||||
ret i32 %and1
|
||||
}
|
||||
|
||||
define i32 @demorganize_constant2(i32 %a) {
|
||||
; CHECK-LABEL: @demorganize_constant2(
|
||||
; CHECK-NEXT: [[A_NOT:%.*]] = and i32 %a, -16
|
||||
; CHECK-NEXT: [[AND1:%.*]] = xor i32 [[A_NOT]], -16
|
||||
; CHECK-NEXT: ret i32 [[AND1]]
|
||||
;
|
||||
%and = or i32 %a, 15
|
||||
%and1 = xor i32 %and, -1
|
||||
ret i32 %and1
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue