[PATCH] D43565: [SimplifyCFG] Expanding scope for hoisting common instructions after branch
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 12:06:21 PST 2018
efriedma added a comment.
LLVM has a GVNHoist pass, which is both more efficient and more effective than anything we can do in SimplifyCFG. (It's currently off by default, but it could probably be turned on with a bit more testing/bugfixing.) I would rather focus on getting that turned on, instead of doing something like this.
================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:1275
+ for (unsigned Count1 = 0;
+ TmpItr1 != BB1->end() && Count1 < SCAN_LIMIT; Count1++) {
+ Instruction *TmpI1 = &*TmpItr1++;
----------------
The way you're counting instructions here is wrong: you have to skip debug info.
It looks like this can only hoist one instruction each time HoistThenElseCodeToIf is called?
https://reviews.llvm.org/D43565
More information about the llvm-commits
mailing list