Skip to content

Commit

Permalink
[RISCV][GISel] Don't check for FP uses of of IMPLICIT_DEF if the type…
Browse files Browse the repository at this point in the history
… is vector. NFC

If the type is vector, we can immediately know to use vector mapping.
Previously we searched for FP uses, but then replaced it if the type
was vector.
  • Loading branch information
topperc committed Apr 4, 2024
1 parent 1f01c58 commit a853d79
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,17 @@ RISCVRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
case TargetOpcode::G_IMPLICIT_DEF: {
Register Dst = MI.getOperand(0).getReg();
LLT DstTy = MRI.getType(Dst);
uint64_t DstMinSize = DstTy.getSizeInBits().getKnownMinValue();
unsigned DstMinSize = DstTy.getSizeInBits().getKnownMinValue();
auto Mapping = GPRValueMapping;
// FIXME: May need to do a better job determining when to use FPRB.
// For example, the look through COPY case:
// %0:_(s32) = G_IMPLICIT_DEF
// %1:_(s32) = COPY %0
// $f10_d = COPY %1(s32)
if (anyUseOnlyUseFP(Dst, MRI, TRI))
Mapping = getFPValueMapping(DstMinSize);

if (DstTy.isVector())
Mapping = getVRBValueMapping(DstMinSize);
else if (anyUseOnlyUseFP(Dst, MRI, TRI))
Mapping = getFPValueMapping(DstMinSize);

return getInstructionMapping(DefaultMappingID, /*Cost=*/1, Mapping,
NumOperands);
Expand Down

0 comments on commit a853d79

Please sign in to comment.