Skip to content

Commit

Permalink
[RISCV] Add PseudoCCMOVGPRNoX0 to RISCVOptWInstrs.
Browse files Browse the repository at this point in the history
  • Loading branch information
topperc committed Jan 31, 2025
1 parent ec7b137 commit ae7f7c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llvm/lib/Target/RISCV/RISCVOptWInstrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ static bool hasAllNBitUsers(const MachineInstr &OrigMI,
break;

case RISCV::PseudoCCMOVGPR:
case RISCV::PseudoCCMOVGPRNoX0:
// Either operand 4 or operand 5 is returned by this instruction. If
// only the lower word of the result is used, then only the lower word
// of operand 4 and 5 is used.
Expand Down Expand Up @@ -538,6 +539,7 @@ static bool isSignExtendedW(Register SrcReg, const RISCVSubtarget &ST,
case RISCV::MIN:
case RISCV::MINU:
case RISCV::PseudoCCMOVGPR:
case RISCV::PseudoCCMOVGPRNoX0:
case RISCV::PseudoCCAND:
case RISCV::PseudoCCOR:
case RISCV::PseudoCCXOR:
Expand All @@ -546,7 +548,7 @@ static bool isSignExtendedW(Register SrcReg, const RISCVSubtarget &ST,
// MIN, MAX, or PHI is also sign-extended.

// The input registers for PHI are operand 1, 3, ...
// The input registers for PseudoCCMOVGPR are 4 and 5.
// The input registers for PseudoCCMOVGPR(NoX0) are 4 and 5.
// The input registers for PseudoCCAND/OR/XOR are 4, 5, and 6.
// The input registers for others are operand 1 and 2.
unsigned B = 1, E = 3, D = 1;
Expand All @@ -556,6 +558,7 @@ static bool isSignExtendedW(Register SrcReg, const RISCVSubtarget &ST,
D = 2;
break;
case RISCV::PseudoCCMOVGPR:
case RISCV::PseudoCCMOVGPRNoX0:
B = 4;
E = 6;
break;
Expand Down

0 comments on commit ae7f7c4

Please sign in to comment.