Skip to content

Commit

Permalink
optionally don't extract phi notes (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
regehr authored May 31, 2024
1 parent a55864f commit ae49378
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Extractor/Candidates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ static llvm::cl::opt<bool> PrintDemandedBitsAtReturn(
"print-demanded-bits-from-harvester",
llvm::cl::desc("Print demanded bits (default=false)"),
llvm::cl::init(false));
static llvm::cl::opt<bool> ExtractPhi(
"extract-phi",
llvm::cl::desc("Follow PHI nodes when extracting from LLVM (default=true)"),
llvm::cl::init(true));

extern bool UseAlive;

Expand Down Expand Up @@ -514,6 +518,9 @@ Inst *ExprBuilder::buildHelper(Value *V) {
if (UseAlive) { // FIXME: Remove this after alive supports phi
return makeArrayRead(V);
}
if (!ExtractPhi) {
return makeArrayRead(V);
}
if (!isLoopEntryPoint(Phi)) {
BasicBlock *BB = Phi->getParent();
BlockInfo &BI = EBC.BlockMap[BB];
Expand Down

0 comments on commit ae49378

Please sign in to comment.