-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Verifier doesn't catch invalid invoke use #1414
Comments
assigned to @lattner |
evan, can you investigate? |
This test is huge and bugpoint is having all kinds of trouble with it. Anton, do It looks like a phi node updating problem though. |
This is bad LLVM code: cond_true.i: ; preds = %meshBB1602 invcont7.i: ; preds = %meshBB1569 %meshBB1569 is just a bunch of phi node but it does not reference nor define %tmp8.i live variable analysis chokes in invcont7.i because %tmp8.i is used but it is Chris believes this is a verifier bug. |
the verifier should reject this: int %foo() { L: ; preds = %0, %0 %A does not dominate L. |
Here's another case the verifier should reject that crashes livevar: int %foo() { L2: |
I've fixed the verifier bug, but the new check exposes bugs in other passes, it will take a while to track -Chris |
This is actually a verifier bug not rejecting broken code. Fixed with this patch: Testcases here: test/Regression/Verifier/invoke-[12].ll Note that the broken LLVM code was made by some transformation that is buggy. That means that if Thanks, -Chris |
invoke-1.ll is not rejected by verifier. Everything is ok for invoke-2.ll |
Fixed with this patch: |
Extended Description
Running ./llc test.bc results to (bytecode passes verifier):
llc: /home/asl/proj/llvm/src/lib/CodeGen/LiveVariables.cpp:157: void
llvm::LiveVariables::HandleVirtRegUse(llvm::LiveVariables::VarInfo&,
llvm::MachineBasicBlock*, llvm::MachineInstr*): Assertion `VRInfo.DefInst &&
"Register use before def!"' failed.
./llc((anonymous namespace)::PrintStackTrace()+0x1f)[0x859b96f]
/lib/libc.so.6(abort+0xeb)[0xb7d83133]
/lib/libc.so.6(__assert_fail+0xeb)[0xb7d7b4f3]
./llc(llvm::LiveVariables::HandleVirtRegUse(llvm::LiveVariables::VarInfo&,
llvm::MachineBasicBlock*, llvm::MachineInstr*)+0x13c)[0x842bbec]
The text was updated successfully, but these errors were encountered: