[llvm-bugs] [Bug 52024] New: Instruction does not dominate all uses! Crash with -O2 in llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10474: bool llvm::LoopVectorizePass::processLoop(llvm::Loop*): Assertion `!verifyFunction(*L->getHeader()->getParent(), &dbgs())' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 30 10:39:43 PDT 2021


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

            Bug ID: 52024
           Summary: Instruction does not dominate all uses! Crash with -O2
                    in
                    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10474:
                    bool
                    llvm::LoopVectorizePass::processLoop(llvm::Loop*):
                    Assertion
                    `!verifyFunction(*L->getHeader()->getParent(),
                    &dbgs())' failed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: haoxintu at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hi all.

It appears to be a recent regression issue as well.

$cat small.c
#include <stdint.h>
int a, d, f, g, i, j;
int16_t b;
uint64_t c;
uint16_t e;
l() {
  uint32_t *k = j = 6;
  for (; j;) {
    b *= a;
    if (*k /= 4)
      for (;;)
        ;
  }
  for (; e;) {
    c %= b;
    for (f = 8; f <= 33; f++)
      a = (g && (d = 0)) * (e -= c) | (i |= e);
  }
}


$clang -w -O2 small.c
Instruction does not dominate all uses!
  %conv1212243 = phi i16 [ undef, %middle.block ], [ %conv1212244, %for.body6 ]
  %conv1212244 = phi i16 [ %conv12122.lcssa42, %for.body6.lr.ph ], [
%conv1212243, %for.cond4.loopexit ]
clang-14:
/home/haoxin/haoxin-data/compilers/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:10474:
bool llvm::LoopVectorizePass::processLoop(llvm::Loop*): Assertion
`!verifyFunction(*L->getHeader()->getParent(), &dbgs())' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments:
/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free
-main-file-name small.c -mrelocation-model static -mframe-pointer=none
-fmath-errno -fno-rounding-math -mconstructor-aliases -funwind-tables=2
-target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb
-fcoverage-compilation-dir=/home/haoxin/haoxin-data/dut-research/covsmith-test/20210819/33
-resource-dir
/home/haoxin/haoxin-data/compilers/llvm-project/build/lib/clang/14.0.0
-internal-isystem
/home/haoxin/haoxin-data/compilers/llvm-project/build/lib/clang/14.0.0/include
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-w
-fdebug-compilation-dir=/home/haoxin/haoxin-data/dut-research/covsmith-test/20210819/33
-ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -vectorize-loops
-vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/small-054df0.o
-x c small.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x000055f330b03b84 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000055f330b0129e SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f2a9157e3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #3 0x00007f2a9101d18b raise
/build/glibc-eX1tMB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #4 0x00007f2a90ffc859 abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:81:7
 #5 0x00007f2a90ffc729 get_sysdep_segment_value
/build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:509:8
 #6 0x00007f2a90ffc729 _nl_load_domain
/build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:970:34
 #7 0x00007f2a9100df36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
 #8 0x000055f330d463e3 llvm::LoopVectorizePass::processLoop(llvm::Loop*)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x3df23e3)
 #9 0x000055f330d47650 llvm::LoopVectorizePass::runImpl(llvm::Function&,
llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&,
llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*,
llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&,
std::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&,
llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x3df3650)
#10 0x000055f330d47e29 llvm::LoopVectorizePass::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x3df3e29)
#11 0x000055f331d63976 llvm::detail::PassModel<llvm::Function,
llvm::LoopVectorizePass, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x4e0f976)
#12 0x000055f3301de226 llvm::PassManager<llvm::Function,
llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x328a226)
#13 0x000055f32e5aae06 llvm::detail::PassModel<llvm::Function,
llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >,
llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>
>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x1656e06)
#14 0x000055f3301dcd49 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x3288d49)
#15 0x000055f32e5ab726 llvm::detail::PassModel<llvm::Module,
llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x1657726)
#16 0x000055f3301da75f llvm::PassManager<llvm::Module,
llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&,
llvm::AnalysisManager<llvm::Module>&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x328675f)
#17 0x000055f330e50a6e (anonymous
namespace)::EmitAssemblyHelper::EmitAssemblyWithNewPassManager(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) BackendUtil.cpp:0:0
#18 0x000055f330e55cb5 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef,
llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x3f01cb5)
#19 0x000055f331cfe67f
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x4daa67f)
#20 0x000055f332a45b39 clang::ParseAST(clang::Sema&, bool, bool)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x5af1b39)
#21 0x000055f331cfd1b8 clang::CodeGenAction::ExecuteAction()
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x4da91b8)
#22 0x000055f33157a7a9 clang::FrontendAction::Execute()
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x46267a9)
#23 0x000055f33150b63e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x45b763e)
#24 0x000055f33165a2c0
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x47062c0)
#25 0x000055f32e2c248d cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x136e48d)
#26 0x000055f32e2be6e8 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#27 0x000055f32e1f2c29 main
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x129ec29)
#28 0x00007f2a90ffe0b3 __libc_start_main
/build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#29 0x000055f32e2be25e _start
(/home/haoxin/haoxin-data/compilers/llvm-project/build/bin/clang-14+0x136a25e)
clang-14: error: unable to execute command: Aborted (core dumped)
clang-14: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 14.0.0 (https://github.com/llvm/llvm-project
68e56bd320d70470c39ec921bd23dae6836770d7)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/haoxin/haoxin-data/compilers/llvm-project/build/bin
clang-14: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-14: note: diagnostic msg: /tmp/small-f541c8.c
clang-14: note: diagnostic msg: /tmp/small-f541c8.sh
clang-14: note: diagnostic msg: 

********************

Thanks,
Haoxin

-- 
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/20210930/1a885b5a/attachment.html>


More information about the llvm-bugs mailing list