[PATCH] D99205: Add jump-threading optimization for deterministic finite automata

Justin Kreiner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 13:35:32 PDT 2021


jkreiner added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetMachine.cpp:461
+  if (TM->getOptLevel() >= CodeGenOpt::Default)
+    addPass(createDFAJumpThreadingPass(TM));
+
----------------
jkreiner wrote:
> xbolva00 wrote:
> > dnsampaio wrote:
> > > jkreiner wrote:
> > > > efriedma wrote:
> > > > > This is kind of late to be running this pass.  That might be useful in some cases: we might be making the code harder to analyze if there's irreducible control flow.  On the other hand, we're skipping interesting optimizations if the CFG becomes significantly simpler.  My instinct is that the advantages of running earlier outweigh the disadvantages.
> > > > I agree that it may be beneficial to run the pass earlier. I'm not aware yet of which optimizations it could interfere with. Do you have any suggestions of where to run it instead?
> > > I would suggest trying just before llvm's original jump-threading. For the proposed implemented here in D88307, it actually produced code that llvm's original jump-threading would further optimize, where the other way around, the original jump-threading would just not do anything. I'm running over llvm-12, so it may take me some time to test this patch.
> > and part of standard opt 2+ pipeline? why aarch64 specific?
> Thank you for the suggestion, I'll try it out before the original jump-threading then.
> 
> I only had it there since I was testing it on AArch64, but it could be moved to the general opt pipeline.
This seems to be a better location for the pass. I've measured a performance gain 5% greater than before for Coremark by placing it before the original jump-threading.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99205/new/

https://reviews.llvm.org/D99205



More information about the llvm-commits mailing list