Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InstCombine] assert "Value::replaceAllUsesWith(<null>) is invalid!" #18974

Closed
llvmbot opened this issue Jan 24, 2014 · 2 comments
Closed

[InstCombine] assert "Value::replaceAllUsesWith(<null>) is invalid!" #18974

llvmbot opened this issue Jan 24, 2014 · 2 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 24, 2014

Bugzilla Link 18600
Resolution FIXED
Resolved on Jan 25, 2014 09:31
Version 3.3
OS Linux
Attachments bugpoint-reduced-simplified.ll
Reporter LLVM Bugzilla Contributor
CC @d0k,@hfinkel

Extended Description

$ gdb --args ~/work/vmware/llvm/llvm/build/linux-x86_64/Debug+Asserts/bin/opt bugpoint-reduced-simplified.ll -instcombine -disable-output
(gdb) r
Starting program: /home/jfonseca/work/vmware/llvm/llvm/build/linux-x86_64/Debug+Asserts/bin/opt bugpoint-reduced-simplified.ll -instcombine -disable-output
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
opt: /home/jfonseca/work/vmware/llvm/llvm/lib/IR/Value.cpp:304: void llvm::Value::replaceAllUsesWith(llvm::Value*): Assertion `New && "Value::replaceAllUsesWith() is invalid!"' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6e09f77 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#​0 0x00007ffff6e09f77 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#​1 0x00007ffff6e0d5e8 in __GI_abort () at abort.c:90
#​2 0x00007ffff6e02d43 in __assert_fail_base (fmt=0x7ffff6f59f58 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x1388e80 "New && "Value::replaceAllUsesWith() is invalid!"",
file=file@entry=0x13886c0 "/home/jfonseca/work/vmware/llvm/llvm/lib/IR/Value.cpp", line=line@entry=304,
function=function@entry=0x138ae00 llvm::Value::replaceAllUsesWith(llvm::Value*)::__PRETTY_FUNCTION__ "void llvm::Value::replaceAllUsesWith(llvm::Value*)") at assert.c:92
#​3 0x00007ffff6e02df2 in __GI___assert_fail (assertion=0x1388e80 "New && "Value::replaceAllUsesWith() is invalid!"",
file=0x13886c0 "/home/jfonseca/work/vmware/llvm/llvm/lib/IR/Value.cpp", line=304,
function=0x138ae00 llvm::Value::replaceAllUsesWith(llvm::Value*)::__PRETTY_FUNCTION__ "void llvm::Value::replaceAllUsesWith(llvm::Value*)")
at assert.c:101
#​4 0x0000000000ed99ab in llvm::Value::replaceAllUsesWith (this=this@entry=0x1772590, New=New@entry=0x0)
at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/Value.cpp:304
#​5 0x0000000000aef2dc in llvm::InstCombiner::ReplaceInstUsesWith (this=, I=..., V=0x0)
at /home/jfonseca/work/vmware/llvm/llvm/lib/Transforms/InstCombine/InstCombine.h:278
#​6 0x0000000000b4ddf0 in llvm::InstCombiner::visitExtractElementInst (this=0x1782370, EI=...)
at /home/jfonseca/work/vmware/llvm/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:180
#​7 0x0000000000aecd64 in llvm::InstCombiner::DoOneIteration (this=this@entry=0x1782370, F=..., Iteration=Iteration@entry=0)
at /home/jfonseca/work/vmware/llvm/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2427
#​8 0x0000000000aed958 in llvm::InstCombiner::runOnFunction (this=0x1782370, F=...)
at /home/jfonseca/work/vmware/llvm/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2525
#​9 0x0000000000ebdf0c in llvm::FPPassManager::runOnFunction (this=this@entry=0x1789090, F=...)
at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1538
#​10 0x0000000000ebe35b in llvm::FPPassManager::runOnModule (this=0x1789090, M=...) at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1558
#​11 0x0000000000ebe6a3 in runOnModule (M=..., this=) at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1616
#​12 llvm::legacy::PassManagerImpl::run (this=0x176c400, M=...) at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1711
#​13 0x0000000000ebe8ce in llvm::legacy::PassManager::run (this=this@entry=0x7fffffffd950, M=...)
at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1746
#​14 0x000000000052bb63 in main (argc=, argv=0x7fffffffdbc8) at /home/jfonseca/work/vmware/llvm/llvm/tools/opt/opt.cpp:853
(gdb)

This happens with all versions between LLVM 3.1 and LLVM 3.4

More the the actual crash, what I find surprising is that the complex constants expression is not being folded automatically as it its being built. This IR was generated by the C bindings, inside llvmpipe Mesa driver.

@d0k
Copy link
Member

d0k commented Jan 24, 2014

Fixed in r200028.

The expressions don't get folded while building because casting a <16 x i8> to <4 x i8> requires a DataLayout. That's not available to the IRBuilder.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 25, 2014

Fixed in r200028.

Thanks for the quick turnaround.

The expressions don't get folded while building because casting a <16 x i8> to <4 x i8> requires a DataLayout. That's not available to the IRBuilder.

Oh, of course: it depends on big/little endianess.

So exactly which of the LLVM optimization passes is the main responsible for folding these?

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants