[PATCH] D144199: [InstCombine] create and use a pass options container

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 09:03:11 PST 2023


spatel created this revision.
spatel added reviewers: nikic, craig.topper, david-arm, Peakulorain.
Herald added subscribers: StephenFan, hiraditya, mcrosier.
Herald added a project: All.
spatel requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is a cleanup/modernization patch requested in D144045 <https://reviews.llvm.org/D144045> to make loop analysis a proper optional parameter to the pass rather than a semi-arbitrary value inherited via the pass pipeline.

It's a bit more complicated than the recent patch I started copying from (D143980 <https://reviews.llvm.org/D143980>) because InstCombine already has an option for MaxIterations (added with D71145 <https://reviews.llvm.org/D71145>).

I debated just deleting that option, but it was used by a pair of existing tests, so I put it into a struct (code largely copied from SimplifyCFG's implementation) to make the code more flexible for future options enhancements.

I didn't alter the pass manager invocations of InstCombine in this patch because the patch was already getting big, but that could be a small follow-up.


https://reviews.llvm.org/D144199

Files:
  llvm/include/llvm/Transforms/InstCombine/InstCombine.h
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Other/new-pm-print-pipeline.ll
  llvm/test/Transforms/InstCombine/gep-combine-loop-invariant.ll
  llvm/test/Transforms/InstCombine/statepoint-cleanup.ll
  llvm/test/Transforms/InstCombine/statepoint-iter.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144199.498043.patch
Type: text/x-patch
Size: 9635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230216/82cdee7d/attachment.bin>


More information about the llvm-commits mailing list