Skip to content

Commit

Permalink
[LLVM][XTHeadVector] add option riscv-enable-vsetvli-elim
Browse files Browse the repository at this point in the history
  • Loading branch information
imkiva committed Apr 15, 2024
1 parent 4a52c3a commit e2c070b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ static cl::opt<bool> EnableRedundantCopyElimination(
cl::desc("Enable the redundant copy elimination pass"), cl::init(true),
cl::Hidden);

static cl::opt<bool> EnableRedundantVSEVLIElimination(
"riscv-enable-vsetvli-elim",
cl::desc("Enable the redundant VSETVLI elimination pass"), cl::init(true),
cl::Hidden);

// FIXME: Unify control over GlobalMerge.
static cl::opt<cl::boolOrDefault>
EnableGlobalMerge("riscv-enable-global-merge", cl::Hidden,
Expand Down Expand Up @@ -401,6 +406,9 @@ void RISCVPassConfig::addOptimizedRegAlloc() {
void RISCVPassConfig::addPostRegAlloc() {
if (TM->getOptLevel() != CodeGenOpt::None && EnableRedundantCopyElimination) {
addPass(createRISCVRedundantCopyEliminationPass());
}
if (TM->getOptLevel() != CodeGenOpt::None &&
EnableRedundantVSEVLIElimination) {
addPass(createRISCVRedundantVSETVLIEliminationPass());
}
}
Expand Down

0 comments on commit e2c070b

Please sign in to comment.