[llvm-bugs] [Bug 37323] New: ADCE crashing when calculating IDF

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 3 01:52:57 PDT 2018


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

            Bug ID: 37323
           Summary: ADCE crashing when calculating IDF
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mikael.holmen at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20258
  --> https://bugs.llvm.org/attachment.cgi?id=20258&action=edit
reproducer

Running

 opt -loop-simplify -postdomtree -licm -adce -S -o - tr15955.ll

crashes when running ADCE

Program received signal SIGSEGV, Segmentation fault.
llvm::DomTreeNodeBase<llvm::BasicBlock>::getIDom (this=0x0) at
../include/llvm/Support/GenericDomTree.h:82
82        DomTreeNodeBase *getIDom() const { return IDom; }
(gdb) where
#0  llvm::DomTreeNodeBase<llvm::BasicBlock>::getIDom (this=0x0) at
../include/llvm/Support/GenericDomTree.h:82
#1  0x00000000025d8847 in llvm::IDFCalculator<llvm::Inverse<llvm::BasicBlock*>,
true>::calculate (this=0x7fffffffbfa0, PHIBlocks=llvm::SmallVector of length 2,
capacity 32 = {...}) at ../lib/Analysis/IteratedDominanceFrontier.cpp:64
#2  0x0000000003195083 in (anonymous
namespace)::AggressiveDeadCodeElimination::markLiveBranchesFromControlDependences
(this=0x7fffffffc258) at ../lib/Transforms/Scalar/ADCE.cpp:485
#3  0x0000000003191ea4 in (anonymous
namespace)::AggressiveDeadCodeElimination::markLiveInstructions
(this=0x7fffffffc258) at ../lib/Transforms/Scalar/ADCE.cpp:371
#4  0x0000000003190902 in (anonymous
namespace)::AggressiveDeadCodeElimination::performDeadCodeElimination
(this=0x7fffffffc258) at ../lib/Transforms/Scalar/ADCE.cpp:204
#5  0x0000000003190ddd in (anonymous namespace)::ADCELegacyPass::runOnFunction
(this=0x66ad460, F=...) at ../lib/Transforms/Scalar/ADCE.cpp:701
#6  0x0000000002cb0d5d in llvm::FPPassManager::runOnFunction (this=0x66ac2f0,
F=...) at ../lib/IR/LegacyPassManager.cpp:1520
#7  0x0000000002cb1095 in llvm::FPPassManager::runOnModule (this=0x66ac2f0,
M=...) at ../lib/IR/LegacyPassManager.cpp:1541
#8  0x0000000002cb187e in (anonymous namespace)::MPPassManager::runOnModule
(this=0x667e0a0, M=...) at ../lib/IR/LegacyPassManager.cpp:1597
#9  0x0000000002cb137b in llvm::legacy::PassManagerImpl::run (this=0x667fee0,
M=...) at ../lib/IR/LegacyPassManager.cpp:1700
#10 0x0000000002cb1dc1 in llvm::legacy::PassManager::run (this=0x7fffffffd460,
M=...) at ../lib/IR/LegacyPassManager.cpp:1731
#11 0x0000000000c115f5 in main (argc=10, argv=0x7fffffffda98) at
../tools/opt/opt.cpp:761

Is perhaps DT not up to date?


This starts happening with r317335:

    [LICM] sink through non-trivially replicable PHI

    Summary:
    The current LICM allows sinking an instruction only when it is exposed to
exit
    blocks through a trivially replacable PHI of which all incoming values are
the
    same instruction. This change enhance LICM to sink a sinkable instruction
    through non-trivially replacable PHIs by spliting predecessors of loop
    exits.


Does LICM invalidate DT? Currently it does

  void getAnalysisUsage(AnalysisUsage &AU) const override {
    AU.setPreservesCFG();
    AU.addRequired<TargetLibraryInfoWrapperPass>();
    if (EnableMSSALoopDependency)
      AU.addRequired<MemorySSAWrapperPass>();
    AU.addRequired<TargetTransformInfoWrapperPass>();
    getLoopAnalysisUsage(AU);
  }

is this correct?

-- 
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/20180503/635f686c/attachment.html>


More information about the llvm-bugs mailing list