diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-04-11 16:50:32 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-04-11 16:50:32 +0000 |
commit | 5740d620f3adea0a18963d24d35b349eaa1de5d8 (patch) | |
tree | 2051ed264c0c89b1352fe96b81b0787d86e989cf /test/Transforms/InstCombine/shift-shift.ll | |
parent | 94eb1d993e92a2abf67010242ccbb3bbf1dfbf9b (diff) |
[InstCombine] don't try to shift an illegal amount (PR26760)
This is the straightforward fix for PR26760:
https://llvm.org/bugs/show_bug.cgi?id=26760
But we still need to make some changes to generalize this helper function
and then send the lshr case into here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265960 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/shift-shift.ll')
-rw-r--r-- | test/Transforms/InstCombine/shift-shift.ll | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/shift-shift.ll b/test/Transforms/InstCombine/shift-shift.ll index 23a45e0967f..2968a9bf3c6 100644 --- a/test/Transforms/InstCombine/shift-shift.ll +++ b/test/Transforms/InstCombine/shift-shift.ll @@ -1,7 +1,9 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -instcombine -S | FileCheck %s -; This would crash if we didn't check for a negative shift. +; These would crash if we didn't check for a negative shift. + +; https://llvm.org/bugs/show_bug.cgi?id=12967 define void @pr12967() { ; CHECK-LABEL: @pr12967( @@ -20,3 +22,22 @@ loop: br label %loop } +; https://llvm.org/bugs/show_bug.cgi?id=26760 + +define void @pr26760() { +; CHECK-LABEL: @pr26760( +; CHECK-NEXT: entry: +; CHECK-NEXT: br label %loop +; CHECK: loop: +; CHECK-NEXT: br label %loop +; +entry: + br label %loop + +loop: + %c = phi i32 [ %shl, %loop ], [ undef, %entry ] + %shr = lshr i32 %c, 7 + %shl = shl i32 %shr, -2 + br label %loop +} + |