[llvm] 5352490 - [NFC][InstCombine] Add test for PR49778

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 4 13:27:00 PDT 2021


Author: Roman Lebedev
Date: 2021-04-04T23:26:41+03:00
New Revision: 5352490ce613f1bdedaf478765b089b1f0a8be0d

URL: https://github.com/llvm/llvm-project/commit/5352490ce613f1bdedaf478765b089b1f0a8be0d
DIFF: https://github.com/llvm/llvm-project/commit/5352490ce613f1bdedaf478765b089b1f0a8be0d.diff

LOG: [NFC][InstCombine] Add test for PR49778

Added: 
    llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-pr49778.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-pr49778.ll b/llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-pr49778.ll
new file mode 100644
index 000000000000..4865afa56a03
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/redundant-left-shift-input-masking-pr49778.ll
@@ -0,0 +1,15 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+; PR49778: this should not be folded to 0.
+define i32 @src(i1 %x2) {
+; CHECK-LABEL: @src(
+; CHECK-NEXT:    ret i32 0
+;
+  %x13 = zext i1 %x2 to i32
+  %_7 = shl i32 4294967295, %x13
+  %mask = xor i32 %_7, 4294967295
+  %_8 = and i32 %mask, %x13
+  %_9 = shl i32 %_8, %x13
+  ret i32 %_9
+}


        


More information about the llvm-commits mailing list