diff options
| author | Paul Redmond <paul.redmond@intel.com> | 2013-02-12 15:21:21 +0000 |
|---|---|---|
| committer | Paul Redmond <paul.redmond@intel.com> | 2013-02-12 15:21:21 +0000 |
| commit | 288604ed0c2dd9a66093c525c7525bb2e7ed91fc (patch) | |
| tree | 00a8d2f029740f3cecb7876bd11b5af5bcc52700 /llvm/test/CodeGen | |
| parent | 71a4ab7141d7b201f0039f6d1f1ce7b8dd3b0430 (diff) | |
| download | bcm5719-llvm-288604ed0c2dd9a66093c525c7525bb2e7ed91fc.tar.gz bcm5719-llvm-288604ed0c2dd9a66093c525c7525bb2e7ed91fc.zip | |
PR14562 - Truncation of left shift became undef
DAGCombiner::ReduceLoadWidth was converting (trunc i32 (shl i64 v, 32))
into (shl i32 v, 32) into undef. To prevent this, check the shift count
against the final result size.
Patch by: Kevin Schoedel
Reviewed by: Nadav Rotem
llvm-svn: 174972
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/pr14562.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/pr14562.ll b/llvm/test/CodeGen/X86/pr14562.ll new file mode 100644 index 00000000000..2df64b301da --- /dev/null +++ b/llvm/test/CodeGen/X86/pr14562.ll @@ -0,0 +1,15 @@ +; RUN: llc < %s -march=x86 | FileCheck %s + +@temp1 = global i64 -77129852189294865, align 8 + +define void @foo() nounwind { + %x = load i64* @temp1, align 8 + %s = shl i64 %x, 32 + %t = trunc i64 %s to i32 + %z = zext i32 %t to i64 + store i64 %z, i64* @temp1, align 8 +; CHECK: movl $0, temp1+4 +; CHECK: movl $0, temp1 + ret void +} + |

