Skip to content

Commit af7f854

Browse files
committed
Add a flag to disable verification
1 parent fb2b9d6 commit af7f854

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

llvm/lib/Target/RISCV/RISCVLiveVariables.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ static cl::opt<unsigned> MaxVRegs("riscv-liveness-max-vregs",
5252
cl::desc("Maximum VRegs to track"),
5353
cl::init(1024), cl::Hidden);
5454

55+
static cl::opt<unsigned> VerifyLiveness("riscv-liveness-verify",
56+
cl::desc("Verify liveness information"),
57+
cl::init(true), cl::Hidden);
58+
5559
namespace {
5660

5761
/// LivenessInfo - Stores liveness information for a basic block
@@ -109,9 +113,12 @@ class RISCVLiveVariables : public MachineFunctionPass {
109113
/// Print liveness information for debugging
110114
void print(raw_ostream &OS, const Module *M = nullptr) const override;
111115

116+
/// Verify the computed liveness information against MBB live-ins.
117+
/// TODO: Extend verification to live-outs and instruction-level liveness.
112118
void verifyLiveness(MachineFunction &MF) const;
113119

114120
/// Mark operands that kill a register
121+
/// TODO: Add and remove kill flags as necessary.
115122
bool markKills(MachineFunction &MF);
116123

117124
private:
@@ -486,8 +493,9 @@ bool RISCVLiveVariables::runOnMachineFunction(MachineFunction &MF) {
486493
print(dbgs());
487494
});
488495

489-
verifyLiveness(MF);
490-
// This is an analysis pass, it doesn't modify the function
496+
if (VerifyLiveness)
497+
verifyLiveness(MF);
498+
491499
return Changed;
492500
}
493501

0 commit comments

Comments
 (0)