[llvm] r183343 - R600: Add a pass that merge Vector Register

David Blaikie dblaikie at gmail.com
Thu Jun 6 09:37:26 PDT 2013


On Wed, Jun 5, 2013 at 11:02 PM, Vincent Lejeune <vljn at ovi.com> wrote:
> Thank for the fix.
>
> I think it is false alarm, because RemapChan should always contains a value equals to Swizzle.
> However I realize now that this loop is rather awkward there and should be encapsulated in a function,
> and add an llvm_unreachable if the loop is never exited.

Yes, either that or drop the condition on the for loop & move it to an
assert at the start of the loop. (though factoring things out into
small functions is nice to have anyway). Please comment on this thread
with the revision number when you've done this so it's clear the issue
has been addressed.

> Btw was this compiled with clang 3.3 or 3.4 svn ? I didn't get the warning when building with clang 3.3rc

This warning was added in 3.3, so I'd be surprised if you don't see it there.

> Vincent
>
>
>
> ----- Mail original -----
>> De : NAKAMURA Takumi <geek4civic at gmail.com>
>> À : Sean Silva <silvas at purdue.edu>
>> Cc : Vincent Lejeune <vljn at ovi.com>; "llvm-commits at cs.uiuc.edu" <llvm-commits at cs.uiuc.edu>
>> Envoyé le : Jeudi 6 juin 2013 4h18
>> Objet : Re: [llvm] r183343 - R600: Add a pass that merge Vector Register
>>
>> Suppressed in r183371 with arbitrary value.
>>
>> Vincent, do you think it would be false alarm?
>>
>> 2013/6/6 Sean Silva <silvas at purdue.edu>:
>>>  I'm getting the following warning:
>>>
>>>
>> /Users/sean/pg/llvm/llvm/lib/Target/R600/R600OptimizeVectorRegisters.cpp:183:49:
>>>  warning: variable 'Chan' is used uninitialized whenever
>> 'for' loop exits
>>>  because its condition is false [-Wsometimes-uninitialized]
>>>      for (unsigned j = 0, je = RemapChan.size(); j < je; j++) {
>>>                                                  ^~~~~~
>>>
>> /Users/sean/pg/llvm/llvm/lib/Target/R600/R600OptimizeVectorRegisters.cpp:193:17:
>>>  note: uninitialized use occurs here
>>>          .addImm(Chan);
>>>                  ^~~~
>>>
>> /Users/sean/pg/llvm/llvm/lib/Target/R600/R600OptimizeVectorRegisters.cpp:183:49:
>>>  note: remove the condition if it is always true
>>>      for (unsigned j = 0, je = RemapChan.size(); j < je; j++) {
>>>                                                  ^~~~~~
>>>
>> /Users/sean/pg/llvm/llvm/lib/Target/R600/R600OptimizeVectorRegisters.cpp:182:18:
>>>  note: initialize the variable 'Chan' to silence this warning
>>>      unsigned Chan;
>>>                   ^
>>>                    = 0
>>>  1 warning generated.
>>>
>>>  -- Sean Silva
>>>
>>>  _______________________________________________
>>>  llvm-commits mailing list
>>>  llvm-commits at cs.uiuc.edu
>>>  http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>
>>
>
> _______________________________________________
> 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