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

LSR can produce invalid SSA when value reuse occurs #1867

Closed
llvmbot opened this issue Jun 4, 2007 · 4 comments
Closed

LSR can produce invalid SSA when value reuse occurs #1867

llvmbot opened this issue Jun 4, 2007 · 4 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 4, 2007

Bugzilla Link 1495
Resolution FIXED
Resolved on Feb 22, 2010 12:41
Version 1.9
OS Linux
Attachments bugpoint-reduced-simplified.bc
Reporter LLVM Bugzilla Contributor

Extended Description

laurov@laurov-desktop:~/ffmpeg/libavcodec$ llc bugpoint-reduced-simplified.bc
llc: /home/laurov/llvm/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:732:
llvm::SDOperand llvm::SelectionDAGLowering::getValue(const llvm::Value*):
Assertion `InReg && "Value not in map!"' failed.
llc((anonymous namespace)::PrintStackTrace()+0x1a)[0x8951f92]
llc((anonymous namespace)::SignalHandler(int)+0x112)[0x8952258]
[0xffffe420]
/lib/tls/i686/cmov/libc.so.6(abort+0x101)[0xb7ca6641]
/lib/tls/i686/cmov/libc.so.6(__assert_fail+0xfb)[0xb7c9e43b]
llc(llvm::SelectionDAGLowering::getValue(llvm::Value const*)+0xb8d)[0x86cd9d3]
llc(llvm::SelectionDAGLowering::visitScalarBinary(llvm::User&, unsigned
int)+0x31)[0x86d8cff]
llc(llvm::SelectionDAGLowering::visitAdd(llvm::User&)+0x8c)[0x86f7912]
llc(llvm::SelectionDAGLowering::visit(unsigned int, llvm::User&)+0xda)[0x86f7bde]
llc(llvm::SelectionDAGLowering::visit(llvm::Instruction&)+0x28)[0x86f7fd4]
llc(llvm::SelectionDAGISel::BuildSelectionDAG(llvm::SelectionDAG&,
llvm::BasicBlock*, std::vector<std::pair<llvm::MachineInstr*, unsigned int>,
std::allocator<std::pair<llvm::MachineInstr*, unsigned int> > >&,
llvm::FunctionLoweringInfo&)+0x14a)[0x86dd654]
llc(llvm::SelectionDAGISel::SelectBasicBlock(llvm::BasicBlock*,
llvm::MachineFunction&, llvm::FunctionLoweringInfo&)+0xa0)[0x86de0f4]
llc(llvm::SelectionDAGISel::runOnFunction(llvm::Function&)+0x11f)[0x86dfd2f]
llc[0x859eba3]
llc(llvm::FPPassManager::runOnFunction(llvm::Function&)+0x13a)[0x88ecae8]
llc(llvm::FunctionPassManagerImpl::run(llvm::Function&)+0x6e)[0x88ecd6c]
llc(llvm::FunctionPassManager::run(llvm::Function&)+0x88)[0x88eceba]
llc(main+0x97d)[0x842831d]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc)[0xb7c90ebc]
llc[0x8426a71]
Aborted (core dumped)

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jun 4, 2007

assigned to @lattner

@lattner
Copy link
Collaborator

lattner commented Jun 5, 2007

This looks like a bug in lsr or something: it is producing:

%tmp.11 = add i32 %tmp.9, 8		; <i32> [#uses=1]
%tmp.9 = mul i32 %iv.5, 8		; <i32> [#uses=2]

which isn't valid (use before def)

@lattner
Copy link
Collaborator

lattner commented Jun 5, 2007

This is due to LSR.cpp:562 inserting a mul which is reused, then LSR.cpp:565 inserting an add into the
wrong place.

@lattner
Copy link
Collaborator

lattner commented Jun 6, 2007

Fixed. Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070604/050261.html

Testcase here: CodeGen/X86/2007-06-05-LSR-Dominator.ll

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
troelsbjerre pushed a commit to troelsbjerre/llvm-project that referenced this issue Jan 10, 2024
…008fa13cbe273500b020c4fad1252

[dwarfdump] Warn for tags with DW_CHILDREN_yes but no children.
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 compile-fail Use [accepts-invalid] and [rejects-valid] instead
Projects
None yet
Development

No branches or pull requests

2 participants