[llvm] r331614 - [ARM] Select result 1 from ConvertBooleanCarryToCarryFlag's result automatically. NFC
Amaury Sechet via llvm-commits
llvm-commits at lists.llvm.org
Sun May 6 18:43:42 PDT 2018
Author: deadalnix
Date: Sun May 6 18:43:42 2018
New Revision: 331614
URL: http://llvm.org/viewvc/llvm-project?rev=331614&view=rev
Log:
[ARM] Select result 1 from ConvertBooleanCarryToCarryFlag's result automatically. NFC
The old behavior return the value 0, which is error prone.
Modified:
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=331614&r1=331613&r2=331614&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Sun May 6 18:43:42 2018
@@ -4063,8 +4063,10 @@ static SDValue ConvertBooleanCarryToCarr
// This converts the boolean value carry into the carry flag by doing
// ARMISD::SUBC Carry, 1
- return DAG.getNode(ARMISD::SUBC, DL, DAG.getVTList(CarryVT, MVT::i32),
- BoolCarry, DAG.getConstant(1, DL, CarryVT));
+ SDValue Carry = DAG.getNode(ARMISD::SUBC, DL,
+ DAG.getVTList(CarryVT, MVT::i32),
+ BoolCarry, DAG.getConstant(1, DL, CarryVT));
+ return Carry.getValue(1);
}
static SDValue ConvertCarryFlagToBooleanCarry(SDValue Flags, EVT VT,
@@ -7762,7 +7764,7 @@ static SDValue LowerADDSUBCARRY(SDValue
// Do the addition proper using the carry flag we wanted.
Result = DAG.getNode(ARMISD::ADDE, DL, VTs, Op.getOperand(0),
- Op.getOperand(1), Carry.getValue(1));
+ Op.getOperand(1), Carry);
// Now convert the carry flag into a boolean value.
Carry = ConvertCarryFlagToBooleanCarry(Result.getValue(1), VT, DAG);
@@ -7776,7 +7778,7 @@ static SDValue LowerADDSUBCARRY(SDValue
// Do the subtraction proper using the carry flag we wanted.
Result = DAG.getNode(ARMISD::SUBE, DL, VTs, Op.getOperand(0),
- Op.getOperand(1), Carry.getValue(1));
+ Op.getOperand(1), Carry);
// Now convert the carry flag into a boolean value.
Carry = ConvertCarryFlagToBooleanCarry(Result.getValue(1), VT, DAG);
More information about the llvm-commits
mailing list