Skip to content

Commit a0599c3

Browse files
committed
fixup! handle computeNumSignBits and allWUsers.
1 parent 55e9517 commit a0599c3

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3995,6 +3995,7 @@ bool RISCVDAGToDAGISel::hasAllNBitUsers(SDNode *Node, unsigned Bits,
39953995
case RISCV::CTZW:
39963996
case RISCV::CPOPW:
39973997
case RISCV::SLLI_UW:
3998+
case RISCV::ABSW:
39983999
case RISCV::FMV_W_X:
39994000
case RISCV::FCVT_H_W:
40004001
case RISCV::FCVT_H_W_INX:

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14819,8 +14819,8 @@ void RISCVTargetLowering::ReplaceNodeResults(SDNode *N,
1481914819
"Unexpected custom legalisation");
1482014820

1482114821
if (Subtarget.hasStdExtP()) {
14822-
SDValue Src = DAG.getNode(ISD::ANY_EXTEND, DL, MVT::i64,
14823-
N->getOperand(0));
14822+
SDValue Src =
14823+
DAG.getNode(ISD::ANY_EXTEND, DL, MVT::i64, N->getOperand(0));
1482414824
SDValue Abs = DAG.getNode(RISCVISD::ABSW, DL, MVT::i64, Src);
1482514825
Results.push_back(DAG.getNode(ISD::TRUNCATE, DL, MVT::i32, Abs));
1482614826
return;
@@ -20300,6 +20300,7 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,
2030020300

2030120301
break;
2030220302
}
20303+
case RISCVISD::ABSW:
2030320304
case RISCVISD::CLZW:
2030420305
case RISCVISD::CTZW: {
2030520306
// Only the lower 32 bits of the first operand are read
@@ -21872,6 +21873,7 @@ unsigned RISCVTargetLowering::ComputeNumSignBitsForTargetNode(
2187221873
case RISCVISD::REMUW:
2187321874
case RISCVISD::ROLW:
2187421875
case RISCVISD::RORW:
21876+
case RISCVISD::ABSW:
2187521877
case RISCVISD::FCVT_W_RV64:
2187621878
case RISCVISD::FCVT_WU_RV64:
2187721879
case RISCVISD::STRICT_FCVT_W_RV64:

llvm/lib/Target/RISCV/RISCVOptWInstrs.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ static bool hasAllNBitUsers(const MachineInstr &OrigMI,
172172
case RISCV::CTZW:
173173
case RISCV::CPOPW:
174174
case RISCV::SLLI_UW:
175+
case RISCV::ABSW:
175176
case RISCV::FMV_W_X:
176177
case RISCV::FCVT_H_W:
177178
case RISCV::FCVT_H_W_INX:

0 commit comments

Comments
 (0)