1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/test/Transforms/InstCombine/align-attr.ll
Hal Finkel 66f66627ed Teach computeKnownBits to look through returned-argument functions
If a function is known to return one of its arguments, we can use that in order
to compute known bits of the return value.

Differential Revision: http://reviews.llvm.org/D9397

llvm-svn: 275036
2016-07-11 02:25:14 +00:00

29 lines
618 B
LLVM

; RUN: opt < %s -instcombine -S | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nounwind uwtable
define i32 @foo1(i32* align 32 %a) #0 {
entry:
%0 = load i32, i32* %a, align 4
ret i32 %0
; CHECK-LABEL: @foo1
; CHECK-DAG: load i32, i32* %a, align 32
; CHECK: ret i32
}
define i32 @foo2(i32* align 32 %a) #0 {
entry:
%v = call i32* @func1(i32* %a)
%0 = load i32, i32* %v, align 4
ret i32 %0
; CHECK-LABEL: @foo2
; CHECK-DAG: load i32, i32* %v, align 32
; CHECK: ret i32
}
declare i32* @func1(i32* returned) nounwind