1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/CodeGen/X86/pr14562.ll
Paul Redmond add1aa5259 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
2013-02-12 15:21:21 +00:00

16 lines
331 B
LLVM

; 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
}