diff options
author | Justin Bogner <mail@justinbogner.com> | 2016-05-05 01:43:49 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2016-05-05 01:43:49 +0000 |
commit | 8752be775c938cf528dd3471d69f6e36e8f6c100 (patch) | |
tree | 719d09aebb20ff02d8d7c455611992a729a77965 | |
parent | e42181315c06c37254844b3e0cfcef7b54808ce5 (diff) | |
download | bcm5719-llvm-8752be775c938cf528dd3471d69f6e36e8f6c100.tar.gz bcm5719-llvm-8752be775c938cf528dd3471d69f6e36e8f6c100.zip |
ARM: Use a Handle to track SDNodes in case they're CSE'd. NFC
The code here is recursively Select-ing a new Node to avoid issues
where N is CSE'd during replaceDAGValue and stops being valid. We can
accomplish the same goal in a more principled way by using a
HandleSDNode.
This is essentially a less dodgy fix for PR25733 than the original
attempt back in r255120.
llvm-svn: 268590
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp index ac1b7d474cb..41cd6eaf74c 100644 --- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -551,11 +551,9 @@ bool ARMDAGToDAGISel::SelectImmShifterOperand(SDValue N, unsigned PowerOfTwo = 0; SDValue NewMulConst; if (canExtractShiftFromMul(N, 31, PowerOfTwo, NewMulConst)) { - BaseReg = SDValue(Select(CurDAG->getNode(ISD::MUL, SDLoc(N), MVT::i32, - N.getOperand(0), NewMulConst) - .getNode()), - 0); + HandleSDNode Handle(N); replaceDAGValue(N.getOperand(1), NewMulConst); + BaseReg = Handle.getValue(); Opc = CurDAG->getTargetConstant(ARM_AM::getSORegOpc(ARM_AM::lsl, PowerOfTwo), SDLoc(N), MVT::i32); |