mirror of
https://github.com/RPCS3/llvm.git
synced 2026-08-26 18:26:51 -04:00
3757f28f1d
Recommitting r329283, third time lucky... If the SRL node is only used by an AND, we may be able to set the ExtVT to the width of the mask, making the AND redundant. To support this, another check has been added in isLegalNarrowLoad which queries whether the load is valid. Differential Revision: https://reviews.llvm.org/D41350 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329551 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
595 B
LLVM
19 lines
595 B
LLVM
; RUN: llc -mtriple=powerpc64-unknown-unknown %s -o - | FileCheck %s
|
|
|
|
; CHECK-LABEL: trunc_srl_load
|
|
; CHECK-NOT: lhz 4, 4(0)
|
|
; CHECK: lhz 4, 2(0)
|
|
define dso_local fastcc void @trunc_srl_load(i32 zeroext %AttrArgNo) {
|
|
entry:
|
|
%bf.load.i = load i64, i64* null, align 8
|
|
%bf.lshr.i = lshr i64 %bf.load.i, 32
|
|
%0 = trunc i64 %bf.lshr.i to i32
|
|
%bf.cast.i = and i32 %0, 65535
|
|
%cmp.i = icmp ugt i32 %bf.cast.i, %AttrArgNo
|
|
br i1 %cmp.i, label %exit, label %cond.false
|
|
exit: ; preds = %entry
|
|
unreachable
|
|
cond.false: ; preds = %entry
|
|
unreachable
|
|
}
|