[llvm-bugs] [Bug 37369] New: LoopInvariantCodeMotion do not preserve PostDominatorTree info

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 8 08:19:44 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=37369

            Bug ID: 37369
           Summary: LoopInvariantCodeMotion do not preserve
                    PostDominatorTree info
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: karl-johan.karlsson at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20272
  --> https://bugs.llvm.org/attachment.cgi?id=20272&action=edit
opt -indvars -divergence -licm -adce -S -mtriple=i686-- -o /dev/null foo.ll

The pass LoopInvariantCodeMotion state that it preserve CFG
(PA.preserveSet<CFGAnalyses>() and AU.setPreservesCFG()) which mean that
PostDominatorTree should be preserved. Unfortunately that seems not to be the
case.

The testcase below first build PostDominatorTree information then LICM destroy
the information and when ADCE try to use the information it is no longer there.

$ ./opt -indvars -divergence -licm -adce -S -mtriple=i686-- -o /dev/null foo.ll
Stack dump:
0.      Program arguments: ./opt -indvars -divergence -licm -adce -S
-mtriple=i686-- -o /dev/null foo.ll 
1.      Running pass 'Function Pass Manager' on module 'foo.ll'.
2.      Running pass 'Aggressive Dead Code Elimination' on function '@f1'
#0 0x0000000001b3ee54 PrintStackTraceSignalHandler(void*) (./opt+0x1b3ee54)
#1 0x0000000001b3f556 SignalHandler(int) (./opt+0x1b3f556)
#2 0x00007f225ee20330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x0000000001370830 llvm::IDFCalculator<llvm::Inverse<llvm::BasicBlock*>,
true>::calculate(llvm::SmallVectorImpl<llvm::BasicBlock*>&) (./opt+0x1370830)
#4 0x000000000193e268 (anonymous
namespace)::AggressiveDeadCodeElimination::performDeadCodeElimination()
(./opt+0x193e268)
#5 0x000000000193fa95 (anonymous
namespace)::ADCELegacyPass::runOnFunction(llvm::Function&) (./opt+0x193fa95)
#6 0x00000000016c3eb8 llvm::FPPassManager::runOnFunction(llvm::Function&)
(./opt+0x16c3eb8)
#7 0x00000000016c4098 llvm::FPPassManager::runOnModule(llvm::Module&)
(./opt+0x16c4098)
#8 0x00000000016c449c llvm::legacy::PassManagerImpl::run(llvm::Module&)
(./opt+0x16c449c)
#9 0x0000000000731867 main (./opt+0x731867)
#10 0x00007f225d9faf45 __libc_start_main
/build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:321:0
#11 0x000000000071fc37 _start (./opt+0x71fc37)
Segmentation fault (core dumped)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180508/87bd002b/attachment.html>


More information about the llvm-bugs mailing list