Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/Scalar/JumpThreading.cpp
Show First 20 Lines • Show All 413 Lines • ▼ Show 20 Lines | bool JumpThreadingPass::runImpl(Function &F, TargetLibraryInfo *TLI_, | ||||
if (!ThreadAcrossLoopHeaders) | if (!ThreadAcrossLoopHeaders) | ||||
findLoopHeaders(F); | findLoopHeaders(F); | ||||
bool EverChanged = false; | bool EverChanged = false; | ||||
bool Changed; | bool Changed; | ||||
do { | do { | ||||
Changed = false; | Changed = false; | ||||
for (auto &BB : F) { | auto BBList = &(F.getBasicBlockList()); | ||||
auto FuncRevIter = make_range(BBList->rbegin(), BBList->rend()); | |||||
for (auto &BB : FuncRevIter) { | |||||
if (Unreachable.count(&BB)) | if (Unreachable.count(&BB)) | ||||
continue; | continue; | ||||
while (processBlock(&BB)) // Thread all of the branches we can over BB. | while (processBlock(&BB)) // Thread all of the branches we can over BB. | ||||
Changed = true; | Changed = true; | ||||
// Jump threading may have introduced redundant debug values into BB | // Jump threading may have introduced redundant debug values into BB | ||||
// which should be removed. | // which should be removed. | ||||
if (Changed) | if (Changed) | ||||
▲ Show 20 Lines • Show All 2,631 Lines • Show Last 20 Lines |