Skip to content

Commit fc13353

Browse files
committed
Revert "[RISCV] Separate doLocalPostpass into new pass and move to post vector regalloc (#88295)"
Seems to cause an address sanitizer failure on one of the buildbots related to live intervals.
1 parent fb302b1 commit fc13353

36 files changed

+1356
-1280
lines changed

llvm/lib/Target/RISCV/RISCV.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ void initializeRISCVExpandAtomicPseudoPass(PassRegistry &);
6161
FunctionPass *createRISCVInsertVSETVLIPass();
6262
void initializeRISCVInsertVSETVLIPass(PassRegistry &);
6363

64-
FunctionPass *createRISCVCoalesceVSETVLIPass();
65-
void initializeRISCVCoalesceVSETVLIPass(PassRegistry &);
66-
6764
FunctionPass *createRISCVPostRAExpandPseudoPass();
6865
void initializeRISCVPostRAExpandPseudoPass(PassRegistry &);
6966
FunctionPass *createRISCVInsertReadWriteCSRPass();

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 17 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,16 @@
2727
#include "RISCV.h"
2828
#include "RISCVSubtarget.h"
2929
#include "llvm/ADT/Statistic.h"
30-
#include "llvm/CodeGen/LiveDebugVariables.h"
3130
#include "llvm/CodeGen/LiveIntervals.h"
32-
#include "llvm/CodeGen/LiveStacks.h"
3331
#include "llvm/CodeGen/MachineFunctionPass.h"
3432
#include <queue>
3533
using namespace llvm;
3634

3735
#define DEBUG_TYPE "riscv-insert-vsetvli"
3836
#define RISCV_INSERT_VSETVLI_NAME "RISC-V Insert VSETVLI pass"
39-
#define RISCV_COALESCE_VSETVLI_NAME "RISC-V Coalesce VSETVLI pass"
4037

4138
STATISTIC(NumInsertedVSETVL, "Number of VSETVL inst inserted");
42-
STATISTIC(NumCoalescedVSETVL, "Number of VSETVL inst coalesced");
39+
STATISTIC(NumRemovedVSETVL, "Number of VSETVL inst removed");
4340

4441
static cl::opt<bool> DisableInsertVSETVLPHIOpt(
4542
"riscv-disable-insert-vsetvl-phi-opt", cl::init(false), cl::Hidden,
@@ -193,11 +190,6 @@ static bool hasUndefinedMergeOp(const MachineInstr &MI,
193190
if (UseMO.getReg() == RISCV::NoRegister)
194191
return true;
195192

196-
if (UseMO.isUndef())
197-
return true;
198-
if (UseMO.getReg().isPhysical())
199-
return false;
200-
201193
if (MachineInstr *UseMI = MRI.getVRegDef(UseMO.getReg())) {
202194
if (UseMI->isImplicitDef())
203195
return true;
@@ -788,52 +780,18 @@ class RISCVInsertVSETVLI : public MachineFunctionPass {
788780
VSETVLIInfo &Info) const;
789781
void computeIncomingVLVTYPE(const MachineBasicBlock &MBB);
790782
void emitVSETVLIs(MachineBasicBlock &MBB);
783+
void doLocalPostpass(MachineBasicBlock &MBB);
791784
void doPRE(MachineBasicBlock &MBB);
792785
void insertReadVL(MachineBasicBlock &MBB);
793786
};
794787

795-
class RISCVCoalesceVSETVLI : public MachineFunctionPass {
796-
public:
797-
static char ID;
798-
const RISCVSubtarget *ST;
799-
const TargetInstrInfo *TII;
800-
MachineRegisterInfo *MRI;
801-
LiveIntervals *LIS;
802-
803-
RISCVCoalesceVSETVLI() : MachineFunctionPass(ID) {}
804-
bool runOnMachineFunction(MachineFunction &MF) override;
805-
806-
void getAnalysisUsage(AnalysisUsage &AU) const override {
807-
AU.setPreservesCFG();
808-
809-
AU.addRequired<LiveIntervals>();
810-
AU.addPreserved<LiveIntervals>();
811-
AU.addRequired<SlotIndexes>();
812-
AU.addPreserved<SlotIndexes>();
813-
AU.addPreserved<LiveDebugVariables>();
814-
AU.addPreserved<LiveStacks>();
815-
816-
MachineFunctionPass::getAnalysisUsage(AU);
817-
}
818-
819-
StringRef getPassName() const override { return RISCV_COALESCE_VSETVLI_NAME; }
820-
821-
private:
822-
bool coalesceVSETVLIs(MachineBasicBlock &MBB);
823-
};
824-
825788
} // end anonymous namespace
826789

827790
char RISCVInsertVSETVLI::ID = 0;
828791

829792
INITIALIZE_PASS(RISCVInsertVSETVLI, DEBUG_TYPE, RISCV_INSERT_VSETVLI_NAME,
830793
false, false)
831794

832-
char RISCVCoalesceVSETVLI::ID = 0;
833-
834-
INITIALIZE_PASS(RISCVCoalesceVSETVLI, "riscv-coalesce-vsetvli",
835-
RISCV_COALESCE_VSETVLI_NAME, false, false)
836-
837795
// Return a VSETVLIInfo representing the changes made by this VSETVLI or
838796
// VSETIVLI instruction.
839797
static VSETVLIInfo getInfoForVSETVLI(const MachineInstr &MI) {
@@ -1557,12 +1515,12 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
15571515

15581516
auto &AVL = MI.getOperand(1);
15591517
auto &PrevAVL = PrevMI.getOperand(1);
1518+
assert(MRI.isSSA());
15601519

15611520
// If the AVL is a register, we need to make sure MI's AVL dominates PrevMI.
15621521
// For now just check that PrevMI uses the same virtual register.
15631522
if (AVL.isReg() && AVL.getReg() != RISCV::X0 &&
1564-
(!MRI.hasOneDef(AVL.getReg()) || !PrevAVL.isReg() ||
1565-
PrevAVL.getReg() != AVL.getReg()))
1523+
(!PrevAVL.isReg() || PrevAVL.getReg() != AVL.getReg()))
15661524
return false;
15671525
}
15681526

@@ -1572,7 +1530,7 @@ static bool canMutatePriorConfig(const MachineInstr &PrevMI,
15721530
return areCompatibleVTYPEs(PriorVType, VType, Used);
15731531
}
15741532

1575-
bool RISCVCoalesceVSETVLI::coalesceVSETVLIs(MachineBasicBlock &MBB) {
1533+
void RISCVInsertVSETVLI::doLocalPostpass(MachineBasicBlock &MBB) {
15761534
MachineInstr *NextMI = nullptr;
15771535
// We can have arbitrary code in successors, so VL and VTYPE
15781536
// must be considered demanded.
@@ -1605,49 +1563,20 @@ bool RISCVCoalesceVSETVLI::coalesceVSETVLIs(MachineBasicBlock &MBB) {
16051563

16061564
if (canMutatePriorConfig(MI, *NextMI, Used, *MRI)) {
16071565
if (!isVLPreservingConfig(*NextMI)) {
1608-
Register DefReg = NextMI->getOperand(0).getReg();
1609-
1610-
MI.getOperand(0).setReg(DefReg);
1566+
MI.getOperand(0).setReg(NextMI->getOperand(0).getReg());
16111567
MI.getOperand(0).setIsDead(false);
1612-
1613-
// The def of DefReg moved to MI, so extend the LiveInterval up to
1614-
// it.
1615-
if (DefReg.isVirtual()) {
1616-
LiveInterval &DefLI = LIS->getInterval(DefReg);
1617-
SlotIndex MISlot = LIS->getInstructionIndex(MI).getRegSlot();
1618-
VNInfo *DefVNI = DefLI.getVNInfoAt(DefLI.beginIndex());
1619-
LiveInterval::Segment S(MISlot, DefLI.beginIndex(), DefVNI);
1620-
DefLI.addSegment(S);
1621-
DefVNI->def = MISlot;
1622-
// Mark DefLI as spillable if it was previously unspillable
1623-
DefLI.setWeight(0);
1624-
1625-
// DefReg may have had no uses, in which case we need to shrink
1626-
// the LiveInterval up to MI.
1627-
LIS->shrinkToUses(&DefLI);
1628-
}
1629-
16301568
Register OldVLReg;
16311569
if (MI.getOperand(1).isReg())
16321570
OldVLReg = MI.getOperand(1).getReg();
16331571
if (NextMI->getOperand(1).isImm())
16341572
MI.getOperand(1).ChangeToImmediate(NextMI->getOperand(1).getImm());
16351573
else
16361574
MI.getOperand(1).ChangeToRegister(NextMI->getOperand(1).getReg(), false);
1637-
1638-
// Clear NextMI's AVL early so we're not counting it as a use.
1639-
if (NextMI->getOperand(1).isReg())
1640-
NextMI->getOperand(1).setReg(RISCV::NoRegister);
1641-
16421575
if (OldVLReg) {
16431576
MachineInstr *VLOpDef = MRI->getUniqueVRegDef(OldVLReg);
16441577
if (VLOpDef && TII->isAddImmediate(*VLOpDef, OldVLReg) &&
16451578
MRI->use_nodbg_empty(OldVLReg))
16461579
VLOpDef->eraseFromParent();
1647-
1648-
// NextMI no longer uses OldVLReg so shrink its LiveInterval.
1649-
if (OldVLReg.isVirtual())
1650-
LIS->shrinkToUses(&LIS->getInterval(OldVLReg));
16511580
}
16521581
MI.setDesc(NextMI->getDesc());
16531582
}
@@ -1660,13 +1589,9 @@ bool RISCVCoalesceVSETVLI::coalesceVSETVLIs(MachineBasicBlock &MBB) {
16601589
Used = getDemanded(MI, MRI, ST);
16611590
}
16621591

1663-
NumCoalescedVSETVL += ToDelete.size();
1664-
for (auto *MI : ToDelete) {
1665-
LIS->RemoveMachineInstrFromMaps(*MI);
1592+
NumRemovedVSETVL += ToDelete.size();
1593+
for (auto *MI : ToDelete)
16661594
MI->eraseFromParent();
1667-
}
1668-
1669-
return !ToDelete.empty();
16701595
}
16711596

16721597
void RISCVInsertVSETVLI::insertReadVL(MachineBasicBlock &MBB) {
@@ -1741,6 +1666,15 @@ bool RISCVInsertVSETVLI::runOnMachineFunction(MachineFunction &MF) {
17411666
for (MachineBasicBlock &MBB : MF)
17421667
emitVSETVLIs(MBB);
17431668

1669+
// Now that all vsetvlis are explicit, go through and do block local
1670+
// DSE and peephole based demanded fields based transforms. Note that
1671+
// this *must* be done outside the main dataflow so long as we allow
1672+
// any cross block analysis within the dataflow. We can't have both
1673+
// demanded fields based mutation and non-local analysis in the
1674+
// dataflow at the same time without introducing inconsistencies.
1675+
for (MachineBasicBlock &MBB : MF)
1676+
doLocalPostpass(MBB);
1677+
17441678
// Insert PseudoReadVL after VLEFF/VLSEGFF and replace it with the vl output
17451679
// of VLEFF/VLSEGFF.
17461680
for (MachineBasicBlock &MBB : MF)
@@ -1754,29 +1688,3 @@ bool RISCVInsertVSETVLI::runOnMachineFunction(MachineFunction &MF) {
17541688
FunctionPass *llvm::createRISCVInsertVSETVLIPass() {
17551689
return new RISCVInsertVSETVLI();
17561690
}
1757-
1758-
// Now that all vsetvlis are explicit, go through and do block local
1759-
// DSE and peephole based demanded fields based transforms. Note that
1760-
// this *must* be done outside the main dataflow so long as we allow
1761-
// any cross block analysis within the dataflow. We can't have both
1762-
// demanded fields based mutation and non-local analysis in the
1763-
// dataflow at the same time without introducing inconsistencies.
1764-
bool RISCVCoalesceVSETVLI::runOnMachineFunction(MachineFunction &MF) {
1765-
// Skip if the vector extension is not enabled.
1766-
ST = &MF.getSubtarget<RISCVSubtarget>();
1767-
if (!ST->hasVInstructions())
1768-
return false;
1769-
TII = ST->getInstrInfo();
1770-
MRI = &MF.getRegInfo();
1771-
LIS = &getAnalysis<LiveIntervals>();
1772-
1773-
bool Changed = false;
1774-
for (MachineBasicBlock &MBB : MF)
1775-
Changed |= coalesceVSETVLIs(MBB);
1776-
1777-
return Changed;
1778-
}
1779-
1780-
FunctionPass *llvm::createRISCVCoalesceVSETVLIPass() {
1781-
return new RISCVCoalesceVSETVLI();
1782-
}

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeRISCVTarget() {
116116
initializeRISCVExpandPseudoPass(*PR);
117117
initializeRISCVFoldMasksPass(*PR);
118118
initializeRISCVInsertVSETVLIPass(*PR);
119-
initializeRISCVCoalesceVSETVLIPass(*PR);
120119
initializeRISCVInsertReadWriteCSRPass(*PR);
121120
initializeRISCVInsertWriteVXRMPass(*PR);
122121
initializeRISCVDAGToDAGISelPass(*PR);
@@ -389,14 +388,12 @@ FunctionPass *RISCVPassConfig::createRVVRegAllocPass(bool Optimized) {
389388

390389
bool RISCVPassConfig::addRegAssignAndRewriteFast() {
391390
addPass(createRVVRegAllocPass(false));
392-
addPass(createRISCVCoalesceVSETVLIPass());
393391
return TargetPassConfig::addRegAssignAndRewriteFast();
394392
}
395393

396394
bool RISCVPassConfig::addRegAssignAndRewriteOptimized() {
397395
addPass(createRVVRegAllocPass(true));
398396
addPass(createVirtRegRewriter(false));
399-
addPass(createRISCVCoalesceVSETVLIPass());
400397
return TargetPassConfig::addRegAssignAndRewriteOptimized();
401398
}
402399

llvm/test/CodeGen/RISCV/O0-pipeline.ll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@
4747
; CHECK-NEXT: Eliminate PHI nodes for register allocation
4848
; CHECK-NEXT: Two-Address instruction pass
4949
; CHECK-NEXT: Fast Register Allocator
50-
; CHECK-NEXT: MachineDominator Tree Construction
51-
; CHECK-NEXT: Slot index numbering
52-
; CHECK-NEXT: Live Interval Analysis
53-
; CHECK-NEXT: RISC-V Coalesce VSETVLI pass
5450
; CHECK-NEXT: Fast Register Allocator
5551
; CHECK-NEXT: Remove Redundant DEBUG_VALUE analysis
5652
; CHECK-NEXT: Fixup Statepoint Caller Saved

llvm/test/CodeGen/RISCV/O3-pipeline.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@
143143
; CHECK-NEXT: Machine Optimization Remark Emitter
144144
; CHECK-NEXT: Greedy Register Allocator
145145
; CHECK-NEXT: Virtual Register Rewriter
146-
; CHECK-NEXT: RISC-V Coalesce VSETVLI pass
147146
; CHECK-NEXT: Virtual Register Map
148147
; CHECK-NEXT: Live Register Matrix
149148
; CHECK-NEXT: Greedy Register Allocator

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-buildvec.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,8 +1407,8 @@ define <8 x float> @buildvec_v8f32_zvl256(float %e0, float %e1, float %e2, float
14071407
; CHECK-NEXT: vfmv.v.f v8, fa4
14081408
; CHECK-NEXT: vfslide1down.vf v8, v8, fa5
14091409
; CHECK-NEXT: vfslide1down.vf v8, v8, fa6
1410-
; CHECK-NEXT: vfslide1down.vf v8, v8, fa7
14111410
; CHECK-NEXT: vmv.v.i v0, 15
1411+
; CHECK-NEXT: vfslide1down.vf v8, v8, fa7
14121412
; CHECK-NEXT: vslidedown.vi v8, v9, 4, v0.t
14131413
; CHECK-NEXT: ret
14141414
%v0 = insertelement <8 x float> poison, float %e0, i64 0
@@ -1458,8 +1458,8 @@ define <8 x double> @buildvec_v8f64_zvl512(double %e0, double %e1, double %e2, d
14581458
; CHECK-NEXT: vfmv.v.f v8, fa4
14591459
; CHECK-NEXT: vfslide1down.vf v8, v8, fa5
14601460
; CHECK-NEXT: vfslide1down.vf v8, v8, fa6
1461-
; CHECK-NEXT: vfslide1down.vf v8, v8, fa7
14621461
; CHECK-NEXT: vmv.v.i v0, 15
1462+
; CHECK-NEXT: vfslide1down.vf v8, v8, fa7
14631463
; CHECK-NEXT: vslidedown.vi v8, v9, 4, v0.t
14641464
; CHECK-NEXT: ret
14651465
%v0 = insertelement <8 x double> poison, double %e0, i64 0

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-interleave.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ define <4 x double> @interleave_v2f64(<2 x double> %x, <2 x double> %y) {
5757
; RV32-V512-NEXT: vid.v v10
5858
; RV32-V512-NEXT: vsrl.vi v11, v10, 1
5959
; RV32-V512-NEXT: vsetvli zero, zero, e64, m1, ta, mu
60-
; RV32-V512-NEXT: vrgatherei16.vv v10, v8, v11
6160
; RV32-V512-NEXT: vmv.v.i v0, 10
61+
; RV32-V512-NEXT: vrgatherei16.vv v10, v8, v11
6262
; RV32-V512-NEXT: vrgatherei16.vv v10, v9, v11, v0.t
6363
; RV32-V512-NEXT: vmv.v.v v8, v10
6464
; RV32-V512-NEXT: ret
@@ -68,8 +68,8 @@ define <4 x double> @interleave_v2f64(<2 x double> %x, <2 x double> %y) {
6868
; RV64-V512-NEXT: vsetivli zero, 4, e64, m1, ta, mu
6969
; RV64-V512-NEXT: vid.v v10
7070
; RV64-V512-NEXT: vsrl.vi v11, v10, 1
71-
; RV64-V512-NEXT: vrgather.vv v10, v8, v11
7271
; RV64-V512-NEXT: vmv.v.i v0, 10
72+
; RV64-V512-NEXT: vrgather.vv v10, v8, v11
7373
; RV64-V512-NEXT: vrgather.vv v10, v9, v11, v0.t
7474
; RV64-V512-NEXT: vmv.v.v v8, v10
7575
; RV64-V512-NEXT: ret

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp2i-sat.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ define void @fp2si_v8f64_v8i8(ptr %x, ptr %y) {
395395
; RV32-NEXT: fmin.d fa5, fa5, fa4
396396
; RV32-NEXT: fcvt.w.d a2, fa5, rtz
397397
; RV32-NEXT: and a0, a0, a2
398-
; RV32-NEXT: vslide1down.vx v9, v9, a0
399398
; RV32-NEXT: vmv.v.i v0, 15
399+
; RV32-NEXT: vslide1down.vx v9, v9, a0
400400
; RV32-NEXT: vslidedown.vi v9, v8, 4, v0.t
401401
; RV32-NEXT: vse8.v v9, (a1)
402402
; RV32-NEXT: addi sp, s0, -128
@@ -496,8 +496,8 @@ define void @fp2si_v8f64_v8i8(ptr %x, ptr %y) {
496496
; RV64-NEXT: fmin.d fa5, fa5, fa4
497497
; RV64-NEXT: fcvt.l.d a2, fa5, rtz
498498
; RV64-NEXT: and a0, a0, a2
499-
; RV64-NEXT: vslide1down.vx v9, v9, a0
500499
; RV64-NEXT: vmv.v.i v0, 15
500+
; RV64-NEXT: vslide1down.vx v9, v9, a0
501501
; RV64-NEXT: vslidedown.vi v9, v8, 4, v0.t
502502
; RV64-NEXT: vse8.v v9, (a1)
503503
; RV64-NEXT: addi sp, s0, -128
@@ -580,8 +580,8 @@ define void @fp2ui_v8f64_v8i8(ptr %x, ptr %y) {
580580
; RV32-NEXT: fmax.d fa4, fa4, fa3
581581
; RV32-NEXT: fmin.d fa5, fa4, fa5
582582
; RV32-NEXT: fcvt.wu.d a0, fa5, rtz
583-
; RV32-NEXT: vslide1down.vx v9, v9, a0
584583
; RV32-NEXT: vmv.v.i v0, 15
584+
; RV32-NEXT: vslide1down.vx v9, v9, a0
585585
; RV32-NEXT: vslidedown.vi v9, v8, 4, v0.t
586586
; RV32-NEXT: vse8.v v9, (a1)
587587
; RV32-NEXT: addi sp, s0, -128
@@ -656,8 +656,8 @@ define void @fp2ui_v8f64_v8i8(ptr %x, ptr %y) {
656656
; RV64-NEXT: fmax.d fa4, fa4, fa3
657657
; RV64-NEXT: fmin.d fa5, fa4, fa5
658658
; RV64-NEXT: fcvt.lu.d a0, fa5, rtz
659-
; RV64-NEXT: vslide1down.vx v9, v9, a0
660659
; RV64-NEXT: vmv.v.i v0, 15
660+
; RV64-NEXT: vslide1down.vx v9, v9, a0
661661
; RV64-NEXT: vslidedown.vi v9, v8, 4, v0.t
662662
; RV64-NEXT: vse8.v v9, (a1)
663663
; RV64-NEXT: addi sp, s0, -128

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-interleave.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ define <4 x i64> @interleave_v2i64(<2 x i64> %x, <2 x i64> %y) {
7070
; RV32-V512-NEXT: vid.v v10
7171
; RV32-V512-NEXT: vsrl.vi v11, v10, 1
7272
; RV32-V512-NEXT: vsetvli zero, zero, e64, m1, ta, mu
73-
; RV32-V512-NEXT: vrgatherei16.vv v10, v8, v11
7473
; RV32-V512-NEXT: vmv.v.i v0, 10
74+
; RV32-V512-NEXT: vrgatherei16.vv v10, v8, v11
7575
; RV32-V512-NEXT: vrgatherei16.vv v10, v9, v11, v0.t
7676
; RV32-V512-NEXT: vmv.v.v v8, v10
7777
; RV32-V512-NEXT: ret
@@ -81,8 +81,8 @@ define <4 x i64> @interleave_v2i64(<2 x i64> %x, <2 x i64> %y) {
8181
; RV64-V512-NEXT: vsetivli zero, 4, e64, m1, ta, mu
8282
; RV64-V512-NEXT: vid.v v10
8383
; RV64-V512-NEXT: vsrl.vi v11, v10, 1
84-
; RV64-V512-NEXT: vrgather.vv v10, v8, v11
8584
; RV64-V512-NEXT: vmv.v.i v0, 10
85+
; RV64-V512-NEXT: vrgather.vv v10, v8, v11
8686
; RV64-V512-NEXT: vrgather.vv v10, v9, v11, v0.t
8787
; RV64-V512-NEXT: vmv.v.v v8, v10
8888
; RV64-V512-NEXT: ret
@@ -195,8 +195,8 @@ define <4 x i32> @interleave_v4i32_offset_1(<4 x i32> %x, <4 x i32> %y) {
195195
; V128-NEXT: vsetivli zero, 4, e32, m1, ta, mu
196196
; V128-NEXT: vid.v v8
197197
; V128-NEXT: vsrl.vi v8, v8, 1
198-
; V128-NEXT: vadd.vi v8, v8, 1
199198
; V128-NEXT: vmv.v.i v0, 10
199+
; V128-NEXT: vadd.vi v8, v8, 1
200200
; V128-NEXT: vrgather.vv v10, v9, v8, v0.t
201201
; V128-NEXT: vmv.v.v v8, v10
202202
; V128-NEXT: ret
@@ -210,8 +210,8 @@ define <4 x i32> @interleave_v4i32_offset_1(<4 x i32> %x, <4 x i32> %y) {
210210
; V512-NEXT: vsetivli zero, 4, e32, mf2, ta, mu
211211
; V512-NEXT: vid.v v8
212212
; V512-NEXT: vsrl.vi v8, v8, 1
213-
; V512-NEXT: vadd.vi v8, v8, 1
214213
; V512-NEXT: vmv.v.i v0, 10
214+
; V512-NEXT: vadd.vi v8, v8, 1
215215
; V512-NEXT: vrgather.vv v10, v9, v8, v0.t
216216
; V512-NEXT: vmv1r.v v8, v10
217217
; V512-NEXT: ret

0 commit comments

Comments
 (0)