[llvm-commits] [llvm] r160512 - /llvm/trunk/lib/Support/ConstantRange.cpp

Nuno Lopes nunoplopes at sapo.pt
Mon Jul 23 11:46:05 PDT 2012


Quoting Rafael EspĂ­ndola <rafael.espindola at gmail.com>:

>> reimplement truncate() to make it optimal.
>> It is optimal at least up to 7 bits (I've tested all such cases)
>> This change to truncate() allows a little simplification to the  
>> multiplication code,
>> and it also makes multiplication optimal :)
>
> testcase?

Well, it's complicated.  It's impossible to write a test case to  
ensure that it is optimal. We could write, say, all cases for 3 bits,  
but even so, it's a lot of work.
I've been testing ConstantRange with an automatic tester, which I plan  
to release as soon as I realize where to drop it :)  Daniel also has a  
tester (somewhere in LLVM's bugzilla) to test ConstantRange for  
correctness using KLEE.

Nuno




More information about the llvm-commits mailing list