Skip to content

Commit 7faf343

Browse files
authored
[RISCV] Remove -riscv-insert-vsetvl-strict-asserts flag (#90171)
This flag has been enabled by default for almost two years now since 1f06398, and at this stage we probably shouldn't be falling back to the fixups. This removes the flag so we always perform the assertion, as well as making sure that CurInfo is always valid on exit: We shouldn't leave emitVSETVLIs with an uninitialized VSETVLIInfo.
1 parent 66e1d2c commit 7faf343

File tree

1 file changed

+7
-29
lines changed

1 file changed

+7
-29
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ static cl::opt<bool> DisableInsertVSETVLPHIOpt(
4545
"riscv-disable-insert-vsetvl-phi-opt", cl::init(false), cl::Hidden,
4646
cl::desc("Disable looking through phis when inserting vsetvlis."));
4747

48-
static cl::opt<bool> UseStrictAsserts(
49-
"riscv-insert-vsetvl-strict-asserts", cl::init(true), cl::Hidden,
50-
cl::desc("Enable strict assertion checking for the dataflow algorithm"));
51-
5248
namespace {
5349

5450
static unsigned getVLOpNum(const MachineInstr &MI) {
@@ -1432,32 +1428,14 @@ void RISCVInsertVSETVLI::emitVSETVLIs(MachineBasicBlock &MBB) {
14321428
transferAfter(CurInfo, MI);
14331429
}
14341430

1435-
// If we reach the end of the block and our current info doesn't match the
1436-
// expected info, insert a vsetvli to correct.
1437-
if (!UseStrictAsserts) {
1438-
const VSETVLIInfo &ExitInfo = BlockInfo[MBB.getNumber()].Exit;
1439-
if (CurInfo.isValid() && ExitInfo.isValid() && !ExitInfo.isUnknown() &&
1440-
CurInfo != ExitInfo) {
1441-
// Note there's an implicit assumption here that terminators never use
1442-
// or modify VL or VTYPE. Also, fallthrough will return end().
1443-
auto InsertPt = MBB.getFirstInstrTerminator();
1444-
insertVSETVLI(MBB, InsertPt, MBB.findDebugLoc(InsertPt), ExitInfo,
1445-
CurInfo);
1446-
CurInfo = ExitInfo;
1447-
}
1448-
}
1449-
1450-
if (UseStrictAsserts && CurInfo.isValid()) {
1451-
const auto &Info = BlockInfo[MBB.getNumber()];
1452-
if (CurInfo != Info.Exit) {
1453-
LLVM_DEBUG(dbgs() << "in block " << printMBBReference(MBB) << "\n");
1454-
LLVM_DEBUG(dbgs() << " begin state: " << Info.Pred << "\n");
1455-
LLVM_DEBUG(dbgs() << " expected end state: " << Info.Exit << "\n");
1456-
LLVM_DEBUG(dbgs() << " actual end state: " << CurInfo << "\n");
1457-
}
1458-
assert(CurInfo == Info.Exit &&
1459-
"InsertVSETVLI dataflow invariant violated");
1431+
const auto &Info = BlockInfo[MBB.getNumber()];
1432+
if (CurInfo != Info.Exit) {
1433+
LLVM_DEBUG(dbgs() << "in block " << printMBBReference(MBB) << "\n");
1434+
LLVM_DEBUG(dbgs() << " begin state: " << Info.Pred << "\n");
1435+
LLVM_DEBUG(dbgs() << " expected end state: " << Info.Exit << "\n");
1436+
LLVM_DEBUG(dbgs() << " actual end state: " << CurInfo << "\n");
14601437
}
1438+
assert(CurInfo == Info.Exit && "InsertVSETVLI dataflow invariant violated");
14611439
}
14621440

14631441
/// Perform simple partial redundancy elimination of the VSETVLI instructions

0 commit comments

Comments
 (0)