[InstSimplify] Make m_Not work for xor -1, X
Currently m_Not only works the canonical xor X, -1 form that InstCombine produces. InstSimplify can't rely on this canonicalization.
Differential Revision: https://reviews.llvm.org/D33331
llvm-svn: 303379
diff --git a/llvm/test/Transforms/InstSimplify/AndOrXor.ll b/llvm/test/Transforms/InstSimplify/AndOrXor.ll
index 2d7eeae..a027c7e 100644
--- a/llvm/test/Transforms/InstSimplify/AndOrXor.ll
+++ b/llvm/test/Transforms/InstSimplify/AndOrXor.ll
@@ -865,3 +865,11 @@
ret <2 x i8> %mask
}
+define i32 @reversed_not(i32 %a) {
+; CHECK-LABEL: @reversed_not(
+; CHECK-NEXT: ret i32 -1
+;
+ %nega = xor i32 -1, %a
+ %or = or i32 %a, %nega
+ ret i32 %or
+}