[llvm-bugs] [Bug 48661] New: [MergeICmps] triggers assert when creating memcpy

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 4 20:07:27 PST 2021


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

            Bug ID: 48661
           Summary: [MergeICmps] triggers assert when creating memcpy
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: v.churavy at gmail.com
                CC: llvm-bugs at lists.llvm.org

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

Looks superficially similar to https://reviews.llvm.org/D92375, but still
occurs tip-of-trunk.

opt: /home/vchuravy/src/llvm-project/llvm/lib/IR/Instructions.cpp:444: void
llvm::CallInst::init(llvm::FunctionType*, llvm::Value*,
llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, const llvm::Twine&):
Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) ==
Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace.
Stack dump:
0.      Program arguments: bin/opt -mergeicmps -S mod.ll
1.      Running pass 'Function Pass Manager' on module 'mod.ll'.
2.      Running pass 'Merge contiguous icmps into a memcmp' on function
'@"julia_==_864"'
 #0 0x000055cbc989ed94 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/home/vchuravy/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:563:22
 #1 0x000055cbc989ee4b PrintStackTraceSignalHandler(void*)
/home/vchuravy/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:630:1
 #2 0x000055cbc989cb5b llvm::sys::RunSignalHandlers()
/home/vchuravy/src/llvm-project/llvm/lib/Support/Signals.cpp:71:20
 #3 0x000055cbc989e724 SignalHandler(int)
/home/vchuravy/src/llvm-project/llvm/lib/Support/Unix/Signals.inc:405:1
 #4 0x00007fe2e2dbb0f0 __restore_rt (/usr/lib/libpthread.so.0+0x140f0)
 #5 0x00007fe2e2840615 raise (/usr/lib/libc.so.6+0x3d615)
 #6 0x00007fe2e2829862 abort (/usr/lib/libc.so.6+0x26862)
 #7 0x00007fe2e2829747 _nl_load_domain.cold (/usr/lib/libc.so.6+0x26747)
 #8 0x00007fe2e2838bf6 (/usr/lib/libc.so.6+0x35bf6)
 #9 0x000055cbc8d1c7da llvm::CallInst::init(llvm::FunctionType*, llvm::Value*,
llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&)
/home/vchuravy/src/llvm-project/llvm/lib/IR/Instructions.cpp:444:5
#10 0x000055cbc6a33996 llvm::CallInst::CallInst(llvm::FunctionType*,
llvm::Value*, llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&,
llvm::Instruction*)
/home/vchuravy/src/llvm-project/llvm/include/llvm/IR/Instructions.h:1716:7
#11 0x000055cbc6b61c21 llvm::CallInst::Create(llvm::FunctionType*,
llvm::Value*, llvm::ArrayRef<llvm::Value*>,
llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&,
llvm::Instruction*)
/home/vchuravy/src/llvm-project/llvm/include/llvm/IR/Instructions.h:1514:64
#12 0x000055cbc6b6500b llvm::IRBuilderBase::CreateCall(llvm::FunctionType*,
llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::MDNode*)
/home/vchuravy/src/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2430:36
#13 0x000055cbc6b6510a llvm::IRBuilderBase::CreateCall(llvm::FunctionCallee,
llvm::ArrayRef<llvm::Value*>, llvm::Twine const&, llvm::MDNode*)
/home/vchuravy/src/llvm-project/llvm/include/llvm/IR/IRBuilder.h:2451:22
#14 0x000055cbc98dd5b1 emitLibCall(llvm::LibFunc, llvm::Type*,
llvm::ArrayRef<llvm::Type*>, llvm::ArrayRef<llvm::Value*>,
llvm::IRBuilderBase&, llvm::TargetLibraryInfo const*, bool)
/home/vchuravy/src/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1025:30
#15 0x000055cbc98de8e0 llvm::emitMemCmp(llvm::Value*, llvm::Value*,
llvm::Value*, llvm::IRBuilderBase&, llvm::DataLayout const&,
llvm::TargetLibraryInfo const*)
/home/vchuravy/src/llvm-project/llvm/lib/Transforms/Utils/BuildLibCalls.cpp:1135:21
#16 0x000055cbc962c7a5 (anonymous
namespace)::mergeComparisons(llvm::ArrayRef<(anonymous
namespace)::BCECmpBlock>, llvm::BasicBlock*, llvm::BasicBlock*, llvm::PHINode&,
llvm::TargetLibraryInfo const&, llvm::AAResults&, llvm::DomTreeUpdater&)
/home/vchuravy/src/llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp:654:41
#17 0x000055cbc962cb64 (anonymous
namespace)::BCECmpChain::simplify(llvm::TargetLibraryInfo const&,
llvm::AAResults&, llvm::DomTreeUpdater&)::'lambda0'(int, int,
llvm::BasicBlock*, llvm::BasicBlock*)::operator()(int, int, llvm::BasicBlock*,
llvm::BasicBlock*) const
/home/vchuravy/src/llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp:702:28
#18 0x000055cbc962cef2 (anonymous
namespace)::BCECmpChain::simplify(llvm::TargetLibraryInfo const&,
llvm::AAResults&, llvm::DomTreeUpdater&)
/home/vchuravy/src/llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp:721:28
#19 0x000055cbc962db42 (anonymous namespace)::processPhi(llvm::PHINode&,
llvm::TargetLibraryInfo const&, llvm::AAResults&, llvm::DomTreeUpdater&)
/home/vchuravy/src/llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp:861:27
#20 0x000055cbc962ddad (anonymous namespace)::runImpl(llvm::Function&,
llvm::TargetLibraryInfo const&, llvm::TargetTransformInfo const&,
llvm::AAResults&, llvm::DominatorTree*)
/home/vchuravy/src/llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp:886:18
#21 0x000055cbc962df21 (anonymous
namespace)::MergeICmpsLegacyPass::runOnFunction(llvm::Function&)
/home/vchuravy/src/llvm-project/llvm/lib/Transforms/Scalar/MergeICmps.cpp:908:73
#22 0x000055cbc8d619be llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/vchuravy/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1440:20
#23 0x000055cbc8d61c81 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/vchuravy/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1486:13
#24 0x000055cbc8d620e7 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/vchuravy/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1555:20
#25 0x000055cbc8d5d20c llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/vchuravy/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:542:13
#26 0x000055cbc8d62995 llvm::legacy::PassManager::run(llvm::Module&)
/home/vchuravy/src/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1683:1
#27 0x000055cbc67a24e5 main
/home/vchuravy/src/llvm-project/llvm/tools/opt/opt.cpp:1001:15
#28 0x00007fe2e282b152 __libc_start_main (/usr/lib/libc.so.6+0x28152)
#29 0x000055cbc676746e _start (bin/opt+0xcec46e)
fish: “bin/opt -mergeicmps -S mod.ll” terminated by signal SIGABRT (Abort)

-- 
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/20210105/32976594/attachment-0001.html>


More information about the llvm-bugs mailing list