Skip to content

Commit

Permalink
[饾榾饾椊饾椏] initial version
Browse files Browse the repository at this point in the history
Created using spr 1.3.4
  • Loading branch information
fhahn committed Nov 16, 2023
1 parent 10c0166 commit e8304de
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4367,8 +4367,7 @@ static bool combineInstructionsOverFunction(
Function &F, InstructionWorklist &Worklist, AliasAnalysis *AA,
AssumptionCache &AC, TargetLibraryInfo &TLI, TargetTransformInfo &TTI,
DominatorTree &DT, OptimizationRemarkEmitter &ORE, BlockFrequencyInfo *BFI,
ProfileSummaryInfo *PSI, unsigned MaxIterations, bool VerifyFixpoint,
LoopInfo *LI) {
ProfileSummaryInfo *PSI, LoopInfo *LI, const InstCombineOptions &Opts) {
auto &DL = F.getParent()->getDataLayout();

/// Builder - This is an IRBuilder that automatically inserts new
Expand All @@ -4394,8 +4393,8 @@ static bool combineInstructionsOverFunction(
while (true) {
++Iteration;

if (Iteration > MaxIterations && !VerifyFixpoint) {
LLVM_DEBUG(dbgs() << "\n\n[IC] Iteration limit #" << MaxIterations
if (Iteration > Opts.MaxIterations && !Opts.VerifyFixpoint) {
LLVM_DEBUG(dbgs() << "\n\n[IC] Iteration limit #" << Opts.MaxIterations
<< " on " << F.getName()
<< " reached; stopping without verifying fixpoint\n");
break;
Expand All @@ -4414,10 +4413,10 @@ static bool combineInstructionsOverFunction(
break;

MadeIRChange = true;
if (Iteration > MaxIterations) {
if (Iteration > Opts.MaxIterations) {
report_fatal_error(
"Instruction Combining did not reach a fixpoint after " +
Twine(MaxIterations) + " iterations");
Twine(Opts.MaxIterations) + " iterations");
}
}

Expand Down Expand Up @@ -4468,8 +4467,7 @@ PreservedAnalyses InstCombinePass::run(Function &F,
&AM.getResult<BlockFrequencyAnalysis>(F) : nullptr;

if (!combineInstructionsOverFunction(F, Worklist, AA, AC, TLI, TTI, DT, ORE,
BFI, PSI, Options.MaxIterations,
Options.VerifyFixpoint, LI))
BFI, PSI, LI, Options))
// No changes, all analyses are preserved.
return PreservedAnalyses::all();

Expand Down Expand Up @@ -4518,9 +4516,7 @@ bool InstructionCombiningPass::runOnFunction(Function &F) {
nullptr;

return combineInstructionsOverFunction(F, Worklist, AA, AC, TLI, TTI, DT, ORE,
BFI, PSI,
InstCombineDefaultMaxIterations,
/*VerifyFixpoint */ false, LI);
BFI, PSI, LI, InstCombineOptions());
}

char InstructionCombiningPass::ID = 0;
Expand Down

0 comments on commit e8304de

Please sign in to comment.