[llvm-bugs] [Bug 52426] New: LoopVersioning asserts when a runtime check is not necessary

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 5 14:17:40 PDT 2021


            Bug ID: 52426
           Summary: LoopVersioning asserts when a runtime check is not
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: chang-sun.lin.jr at intel.com
                CC: llvm-bugs at lists.llvm.org

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

In the attached testcase, LoopLoadElim unconditionally asks LoopVersioning to
add a runtime check, assuming that the check is optional. Unfortunately,
LoopVersioning will assert if the check is not needed. Should the assert just
be changed to return silently?

opt -loop-load-elim fail.ll

opt: llvm/llvm/lib/Transforms/Utils/LoopVersioning.cpp:88: void
llvm::SmallVectorImpl<llvm::Instruction*>&): Assertion `RuntimeCheck && "called
even though we don't need " "any runtime checks"' failed.
10 0x00007f989b41a607 llvm::LoopVersioning::versionLoop()
#11 0x00007f989b416441 (anonymous
#12 0x00007f989b416899 eliminateLoadsAcrossLoops(llvm::Function&,
llvm::LoopInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo*,
llvm::ProfileSummaryInfo*, llvm::ScalarEvolution*, llvm::AssumptionCache*,
llvm::function_ref<llvm::LoopAccessInfo const& (llvm::Loop&)>)

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/20211105/9fbc7133/attachment.html>

More information about the llvm-bugs mailing list