Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 2345166

Browse files
committed
R600: Remove unnecessary attempt to zext a pointer.
Private pointers are now always 32-bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203989 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 2cf43de commit 2345166

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Target/R600/AMDGPUISelLowering.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,15 +769,18 @@ SDValue AMDGPUTargetLowering::LowerSTORE(SDValue Op, SelectionDAG &DAG) const {
769769
} else if (Store->getMemoryVT() == MVT::i16) {
770770
Mask = 0xffff;
771771
}
772-
SDValue TruncPtr = DAG.getZExtOrTrunc(Store->getBasePtr(), DL, MVT::i32);
773-
SDValue Ptr = DAG.getNode(ISD::SRL, DL, MVT::i32, TruncPtr,
772+
SDValue BasePtr = Store->getBasePtr();
773+
SDValue Ptr = DAG.getNode(ISD::SRL, DL, MVT::i32, BasePtr,
774774
DAG.getConstant(2, MVT::i32));
775775
SDValue Dst = DAG.getNode(AMDGPUISD::REGISTER_LOAD, DL, MVT::i32,
776776
Chain, Ptr, DAG.getTargetConstant(0, MVT::i32));
777-
SDValue ByteIdx = DAG.getNode(ISD::AND, DL, MVT::i32, TruncPtr,
777+
778+
SDValue ByteIdx = DAG.getNode(ISD::AND, DL, MVT::i32, BasePtr,
778779
DAG.getConstant(0x3, MVT::i32));
780+
779781
SDValue ShiftAmt = DAG.getNode(ISD::SHL, DL, MVT::i32, ByteIdx,
780782
DAG.getConstant(3, MVT::i32));
783+
781784
SDValue SExtValue = DAG.getNode(ISD::SIGN_EXTEND, DL, MVT::i32,
782785
Store->getValue());
783786

0 commit comments

Comments
 (0)