[llvm-commits] [llvm] r173325 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp

reed kotler rkotler at mips.com
Thu Jan 24 17:25:21 PST 2013


I looked at this in more detail and the two unreachable statements you 
added are correct as far as I know.

For O32 abi, which is what this if for, struct returns are always 
handled by inserting an invisible first parameter which contains the 
address of the struct. So in those case RetTy is always void.

So the only way to get a Struct as a return type from this RetTy is if a 
single or double complex is being returned. I knew that when I was first 
writing the code but did not put in the assertions as to it being 
impossible to get another result.

Thanks for catching this!

So any other kind of RetTy->isStruct() is impossible as far as I know.

I've run test-suite against this code for several days now with no 
issues and rewrote this code several times to make it more readable and 
efficient but did not read it one more time carefully at the end.

On 01/23/2013 10:45 PM, NAKAMURA Takumi wrote:
> David, yeah, it makes sense.
>
> I really wanted to fill the paths, then. :)
>
> ...Takumi
>
> 2013/1/24 David Blaikie <dblaikie at gmail.com>:
>> I believe the correct (stylistically) change here is to change the 'if' to
>> 'assert', rather than adding else-unreachable
>>
>> On Jan 23, 2013 10:11 PM, "NAKAMURA Takumi" <geek4civic at gmail.com> wrote:
>>> Author: chapuni
>>> Date: Thu Jan 24 00:08:06 2013
>>> New Revision: 173325
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=173325&view=rev
>>> Log:
>>> MipsISelLowering.cpp: Fill unreachable paths to fix warnings.
>>> [-Wsometimes-uninitialized]
>>>
>>> FIXME: Could they, unreachable(s), be removed?
>>> FIXME: I could prefer the coding standards...
>>>
>>> Modified:
>>>      llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
>>>
>>> Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=173325&r1=173324&r2=173325&view=diff
>>>
>>> ==============================================================================
>>> --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
>>> +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Thu Jan 24 00:08:06
>>> 2013
>>> @@ -2917,6 +2917,12 @@
>>>                  (RetTy->getContainedType(1)->isDoubleTy())) {
>>>           result = dcMips16Helper[stubNum];
>>>         }
>>> +      else {
>>> +        llvm_unreachable("Uncovered condition");
>>> +      }
>>> +    }
>>> +    else {
>>> +      llvm_unreachable("Uncovered condition");
>>>       }
>>>     }
>>>     else {
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list