[llvm-commits] [llvm] r61092 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp test/CodeGen/PowerPC/2008-10-17-AsmMatchingOperands.ll

Chris Lattner clattner at apple.com
Tue Dec 16 20:16:18 PST 2008

On Dec 16, 2008, at 6:15 PM, Evan Cheng wrote:

> On Dec 16, 2008, at 1:29 PM, Chris Lattner wrote:
>> On Dec 16, 2008, at 1:22 PM, Dan Gohman wrote:
>>> Hi Evan,
>>> I'm seeing this error trigger when building libgomp on x86_64-linux-
>>> gnu.
>>> I've attached a reduced LLVM IR testcase.
>>> Here is the relevant C code, from libgomp/config/linux/x86/futex.h:
>>> static inline void
>>> futex_wake (int *addr, int count)
>>> {
>>> long res;
>>> __asm volatile ("syscall"
>>>                : "=a" (res)
>>>                : "0"(SYS_futex), "D" (addr), "S"(FUTEX_WAKE),
>>> "d"(count)
>>>                : "r11", "rcx", "memory");
>>> }
>>> SYS_futex here is a constant. Would it be possible to support this
>>> specific case?
>> It would be best for llvm-gcc to widen the tied input/output to the
>> larger of the two integer types.
> We have decided not to support this type of inline asm because it's
> not clear what's the right thing to do. Should we widen to cast down?
> I guess it's clear in certain cases (e.g ptr type). I'll take a look.

I guess there are three cases:

1. The input and output are different but same-sized types (e.g. two  
different pointers, intptr + pointer, etc)
2. The input is smaller than the output
3. The output is smaller than the input.

#1 should already work today.
#2 should be reasonably easy: llvm-gcc just widens the input (and on  
big endian, shifts the input) to an integer of the right size.
#3 is a bit trickier because the output needs to be an lvalue.


More information about the llvm-commits mailing list