[llvm-commits] [llvm] r120574 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

dalej dalej at apple.com
Wed Dec 1 13:09:27 PST 2010


IMO assertions are appropriate for things that can potentially be generated erroneously by the compiler for correct user code, e.g. SSE instructions for floating point operations.  If a user codes an SSE-generating intrinsic and targets an environment that  doesn't have SSE, this is a user error and should be reported as such.  Alas, I don't think we can distinguish user from compiler errors in all cases at the moment.

On Dec 1, 2010, at 12:30 PM, Eric Christopher wrote:
> On Dec 1, 2010, at 12:29 PM, Duncan Sands wrote:
> 
>>>> I don't think it makes any sense to assert that the target supports SSE3 here.
>>>> The user (i.e. whoever generated a call to the intrinsic in the first place) is
>>>> essentially asking for a particular instruction to be placed in the assembler.
>>>> If that instruction won't execute on the target machine, that's their problem
>>>> not ours.  Two buildbots with processors that don't support SSE3 were barfing
>>>> on the apm.ll test in CodeGen/X86 because of this assertion.
>>> 
>>> Or we could just make sure the testcase uses sse3 for codegen?
>> 
>> That was the other possibility, but since I don't see the point in asserting
>> I went for this one instead (nothing else in the code generators blows up if
>> you do this).  Do you think an assertion is better?  Philosophically an
>> assertion is wrong since it should only be used in impossible situations which
>> this is clearly not!
> 
> That's fair, it's a pretty standard assertion in a lot of the expanders though.
> 
> That said, your argument is good too :) Just bringing it up.
> 
> -eric





More information about the llvm-commits mailing list