[llvm-commits] [llvm] r168181 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineCompares.cpp test/Transforms/InstCombine/icmp.ll

Duncan Sands baldrick at free.fr
Fri Nov 16 13:05:47 PST 2012


Hi Chandler,

> Maybe a comment about why this set of tests is the correct way to
> determine Y and Z?
>
>> +      Value *Y, *Z;
>> +      if (A == C) {
>> +        Y = B;
>> +        Z = D;
>> +      } else if (A == D) {
>> +        Y = B;
>> +        Z = C;
>> +      } else if (B == C) {
>> +        Y = A;
>> +        Z = D;
>> +      } else if (B == D) {
>> +        Y = A;
>> +        Z = C;
>> +      }
>
> Maybe add an:
>
> } else {
>    llvm_unreachable(...);
> }
>
> so that we catch a bug of this form with something cheaper than Valgrind.

thanks for the suggestion.  I've added some comments in commit 168196 which
hopefully make it clear.

Ciao, Duncan.



More information about the llvm-commits mailing list