[LLVMdev] Bad legalization?

Dale Johannesen dalej at apple.com
Tue Sep 16 09:44:35 PDT 2008


It is conceivable that it's sensitive to the name "abs", try changing  
it.

On Sep 15, 2008, at 11:47 PMPDT, Evan Cheng wrote:

>
> On Sep 15, 2008, at 3:05 PM, Villmow, Micah wrote:
>
>> I am getting an assert on a bad legalization.
>> Assertion failed: Result.getValueType() == Op.getValueType() &&  
>> "Bad legalization!", file ..\..\lib\CodeGen\SelectionDAG 
>> \LegalizeDAG.cpp, line 3976
>>
>
> When you run into issues like this, it helps if you provide a bit  
> more information. Please dump out Result, Op, DAG, and / or the DAG  
> before legalization starts.
>
>
>> Can someone explain to me what this means in term of backend code  
>> generation, how it might be occurring, and possible ways to fix  
>> this? I don’t see how the value type of an operation and the result  
>> being the same can cause an issue.
>
> Quite the opposite. It's asserting because the value types of op  
> (before legalization) and Result (after) are different.
>
> Evan
>
>> The IR code in question is as follows:
>>
>> define void @ test_unary_func_absolute_value(i32 %x, i32  
>> addrspace(11)* %result) {
>> entry:
>>         %call = tail call i32 (...)* @abs( i32 %x )             ;  
>> <i32> [#uses=1]
>>         store i32 %call, i32 addrspace(11)* %result
>>         ret void
>> }
>>
>> declare i32 @abs(...)
>>
>> Micah Villmow
>> Systems Engineer
>> Advanced Technology & Performance
>> Advanced Micro Devices Inc.
>> 4555 Great America Pkwy,
>> Santa Clara, CA. 95054
>> P: 408-572-6219
>> F: 408-572-6596
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080916/66b9b13c/attachment.html>


More information about the llvm-dev mailing list