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

Diogo N. Sampaio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 01:41:42 PDT 2021


dnsampaio added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetMachine.cpp:461
+  if (TM->getOptLevel() >= CodeGenOpt::Default)
+    addPass(createDFAJumpThreadingPass(TM));
+
----------------
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.


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

https://reviews.llvm.org/D99205



More information about the llvm-commits mailing list