Skip to content

Commit 5d77932

Browse files
fixup! only do this when we start with G_SPLAT_VECTOR
1 parent 6a91a29 commit 5d77932

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,9 @@ bool RISCVInstructionSelector::select(MachineInstr &MI) {
530530
MachineFunction &MF = *MBB.getParent();
531531
MachineIRBuilder MIB(MI);
532532

533-
preISelLower(MI, MIB);
534533
const unsigned Opc = MI.getOpcode();
534+
bool OpcWasGSplatVector = Opc == TargetOpcode::G_SPLAT_VECTOR;
535+
preISelLower(MI, MIB);
535536

536537
if (!MI.isPreISelOpcode() || Opc == TargetOpcode::G_PHI) {
537538
if (Opc == TargetOpcode::PHI || Opc == TargetOpcode::G_PHI) {
@@ -573,7 +574,7 @@ bool RISCVInstructionSelector::select(MachineInstr &MI) {
573574
// the MI is lowered, since renderVLOp needs to see the G_CONSTANT. It would
574575
// be nice if the InstructionSelector selected these instructions without
575576
// needing to call select on them explicitly.
576-
if (Opc == RISCV::G_VMV_V_X_VL || Opc == RISCV::G_VFMV_V_F_VL) {
577+
if (OpcWasGSplatVector) {
577578
MachineInstr *Passthru = MRI->getVRegDef(MI.getOperand(1).getReg());
578579
MachineInstr *VL = MRI->getVRegDef(MI.getOperand(3).getReg());
579580
if (selectImpl(MI, *CoverageInfo))

0 commit comments

Comments
 (0)