diff options
author | Tim Northover <tnorthover@apple.com> | 2015-12-09 15:54:50 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2015-12-09 15:54:50 +0000 |
commit | d91d635b36e88ace41794a14df48b3a3267fa5ff (patch) | |
tree | b421f06455ba6b79d96cbaaa684e91ca7df3b2de /llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | |
parent | 88f8014e8ebbb8b43f669e6573db27c5ff432137 (diff) | |
download | bcm5719-llvm-d91d635b36e88ace41794a14df48b3a3267fa5ff.tar.gz bcm5719-llvm-d91d635b36e88ace41794a14df48b3a3267fa5ff.zip |
ARM: don't use a deleted node as the BaseReg in complex pattern.
We mutated the DAG, which invalidated the node we were trying to use
as a base register. Sometimes we got away with it, but other times the
node really did get deleted before it was finished with.
Should fix PR25733
llvm-svn: 255120
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp index cd73021dfc6..024244092a3 100644 --- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -548,8 +548,11 @@ 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); replaceDAGValue(N.getOperand(1), NewMulConst); - BaseReg = N; Opc = CurDAG->getTargetConstant(ARM_AM::getSORegOpc(ARM_AM::lsl, PowerOfTwo), SDLoc(N), MVT::i32); |