[LLVMdev] instruction selector failure

Chris Lattner sabre at nondot.org
Wed May 16 12:10:48 PDT 2007

On Wed, 16 May 2007, Florian Brandner wrote:
> i found a problem in LLVM regarding the matching of 'Constant' nodes in
> the instruction selector. the testcase is for x86, but similar testcases
> for the other architectures (e.g. ppc) should be easy to create.
> i'm using the llvm-gcc 2.0 prerelease binary package.
> here is the testcase:
> int foo(int bar) {
>  asm("movl %1, %0" : "=r"(bar) : "i"(5));
>  return 11;
> }
> the problem here is, that the constant node '11' is shared by a
> CopyToReg node (for the return) and the INLINEASM node. the INLINEASM
> node uses the constant as a flag indicating that an immediate operand (5
> in this case) follows.

Yes.  this is fixed in mainline, with this series of patches:


Given the invasiveness of these patches, and the lack of significant 
testing since the have gone into mainline, I'd recommend against merging 
them into 2.0.

If this blocks a significant piece of software from building with LLVM 2.0 
though, we may reconsider.  What does it break?



More information about the llvm-dev mailing list