From 5c97450df748819381daa4c4d400c39b0d7378ae Mon Sep 17 00:00:00 2001 From: Paul Redmond Date: Tue, 12 Feb 2013 15:21:21 +0000 Subject: 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174972 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/pr14562.ll | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/CodeGen/X86/pr14562.ll (limited to 'test') diff --git a/test/CodeGen/X86/pr14562.ll b/test/CodeGen/X86/pr14562.ll new file mode 100644 index 0000000..2df64b3 --- /dev/null +++ b/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 +} + -- cgit v1.1