[PATCH] D30333: Split SimplifyCFG to run obscuring switch transforms only during last phase
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 9 22:17:56 PST 2017
mehdi_amini added inline comments.
================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:622
addExtensionsToPM(EP_Peephole, MPM);
- MPM.add(createCFGSimplificationPass());
+ MPM.add(createLateCFGSimplificationPass()); // Switches to lookup tables
addInstructionCombiningPass(MPM);
----------------
The comment is misleading, it seems that the only reason we run the pass here is for this purpose.
================
Comment at: lib/Transforms/Scalar/SimplifyCFGPass.cpp:256
+ }
+};
}
----------------
Why two passes instead of a parameter?
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:173
SmallPtrSetImpl<BasicBlock *> *LoopHeaders;
+ bool LateSimplifyCFG;
Value *isValueEqualityComparison(TerminatorInst *TI);
----------------
Document.
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:5568
- if (SwitchToLookupTable(SI, Builder, DL, TTI))
+ if (LateSimplifyCFG && SwitchToLookupTable(SI, Builder, DL, TTI))
return SimplifyCFG(BB, TTI, BonusInstThreshold, AC) | true;
----------------
Comment.
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:6024
/// of the CFG. It returns true if a modification was made.
///
bool llvm::SimplifyCFG(BasicBlock *BB, const TargetTransformInfo &TTI,
----------------
Document the parameter in the doxygen.
https://reviews.llvm.org/D30333
More information about the llvm-commits
mailing list