; This test is for Integer BitWidth <= 64 && BitWidth % 2 != 0.
;
-; RUN: opt < %s -instcombine -S | not grep or
+; RUN: opt < %s -instcombine -S | not grep " or "
define i7 @test0(i7 %X) {
%R = or i39 %B, %D
ret i39 %R
}
+
+define i43 @demorgan(i43 %A, i43 %B) {
+ ;; (~A | ~B) == (~(A & B)) - De Morgan's Law
+ %NotA = xor i43 %A, -1
+ %NotB = xor i43 %B, -1
+ %C1 = or i43 %NotA, %NotB
+ ret i43 %C1
+}
+
; This test makes sure that or instructions are properly eliminated.
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
;
-; RUN: opt < %s -instcombine -S | not grep or
+; RUN: opt < %s -instcombine -S | not grep " or "
define i777 @test0(i777 %X) {
%R = or i399 %B, %D
ret i399 %R
}
+
+define i129 @demorgan(i129 %A, i129 %B) {
+ ;; (~A | ~B) == (~(A & B)) - De Morgan's Law
+ %NotA = xor i129 %A, -1
+ %NotB = xor i129 %B, -1
+ %C1 = or i129 %NotA, %NotB
+ ret i129 %C1
+}
+