From ea330fbe491f8b2df520bf8e1d0601f4a06ff69b Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 15 Mar 2014 00:08:26 +0000 Subject: [PATCH] R600: Remove unnecessary attempt to zext a pointer. Private pointers are now always 32-bits. llvm-svn: 203989 --- llvm/lib/Target/R600/AMDGPUISelLowering.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/R600/AMDGPUISelLowering.cpp b/llvm/lib/Target/R600/AMDGPUISelLowering.cpp index 04bab6f9844e..4e4b12eacc9d 100644 --- a/llvm/lib/Target/R600/AMDGPUISelLowering.cpp +++ b/llvm/lib/Target/R600/AMDGPUISelLowering.cpp @@ -769,15 +769,18 @@ SDValue AMDGPUTargetLowering::LowerSTORE(SDValue Op, SelectionDAG &DAG) const { } else if (Store->getMemoryVT() == MVT::i16) { Mask = 0xffff; } - SDValue TruncPtr = DAG.getZExtOrTrunc(Store->getBasePtr(), DL, MVT::i32); - SDValue Ptr = DAG.getNode(ISD::SRL, DL, MVT::i32, TruncPtr, + SDValue BasePtr = Store->getBasePtr(); + SDValue Ptr = DAG.getNode(ISD::SRL, DL, MVT::i32, BasePtr, DAG.getConstant(2, MVT::i32)); SDValue Dst = DAG.getNode(AMDGPUISD::REGISTER_LOAD, DL, MVT::i32, Chain, Ptr, DAG.getTargetConstant(0, MVT::i32)); - SDValue ByteIdx = DAG.getNode(ISD::AND, DL, MVT::i32, TruncPtr, + + SDValue ByteIdx = DAG.getNode(ISD::AND, DL, MVT::i32, BasePtr, DAG.getConstant(0x3, MVT::i32)); + SDValue ShiftAmt = DAG.getNode(ISD::SHL, DL, MVT::i32, ByteIdx, DAG.getConstant(3, MVT::i32)); + SDValue SExtValue = DAG.getNode(ISD::SIGN_EXTEND, DL, MVT::i32, Store->getValue());