[llvm-branch-commits] [llvm] 907a751 - [NFC][InstCombine] Add test for PR49778

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 3 16:42:42 PDT 2021


Author: Roman Lebedev
Date: 2021-05-03T16:41:30-07:00
New Revision: 907a751a38fff8d05b288ab52b19ba4e2cc1fc38

URL: https://github.com/llvm/llvm-project/commit/907a751a38fff8d05b288ab52b19ba4e2cc1fc38
DIFF: https://github.com/llvm/llvm-project/commit/907a751a38fff8d05b288ab52b19ba4e2cc1fc38.diff

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

(cherry picked from commit 5352490ce613f1bdedaf478765b089b1f0a8be0d)

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 0000000000000..4865afa56a037
--- /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-branch-commits mailing list