This is an archive of the discontinued LLVM Phabricator instance.

[LoopBoundSplit] Ignore phi node which is not scevable
ClosedPublic

Authored by jaykang10 on Jun 8 2021, 10:44 AM.

Details

Summary

There was a bug in LoopBoundSplit pass. The pass should ignore phi node which is not scevable.

It fixes compiler crashes from 471.omnetpp with -O3 -flto on X86 when running the pass just before the vectorizer as below.

diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index b07f966e3b7e..a3e3ed093ecb 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1195,6 +1195,7 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
 /// TODO: Should LTO cause any differences to this set of passes?
 void PassBuilder::addVectorPasses(OptimizationLevel Level,
                                   FunctionPassManager &FPM, bool IsLTO) {
+  FPM.addPass(createFunctionToLoopPassAdaptor(LoopBoundSplitPass()));
   FPM.addPass(LoopVectorizePass(
       LoopVectorizeOptions(!PTO.LoopInterleaving, !PTO.LoopVectorization)));

Diff Detail

Event Timeline

jaykang10 created this revision.Jun 8 2021, 10:44 AM
jaykang10 requested review of this revision.Jun 8 2021, 10:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 8 2021, 10:44 AM
mkazantsev accepted this revision.Jun 8 2021, 9:50 PM
This revision is now accepted and ready to land.Jun 8 2021, 9:50 PM
This revision was automatically updated to reflect the committed changes.