A shift of a power of two is a power of two or zero.
For completeness - not spotted in the wild.
llvm-svn: 143211
diff --git a/llvm/test/Transforms/InstSimplify/AndOrXor.ll b/llvm/test/Transforms/InstSimplify/AndOrXor.ll
index 3d04d58..33a4d6b 100644
--- a/llvm/test/Transforms/InstSimplify/AndOrXor.ll
+++ b/llvm/test/Transforms/InstSimplify/AndOrXor.ll
@@ -10,3 +10,13 @@
ret i64 %e2
; CHECK: ret i64 %e
}
+
+define i64 @pow2b(i32 %x) {
+; CHECK: @pow2b
+ %sh = shl i32 2, %x
+ %e = zext i32 %sh to i64
+ %nege = sub i64 0, %e
+ %e2 = and i64 %e, %nege
+ ret i64 %e2
+; CHECK: ret i64 %e
+}