[llvm-commits] InstCombining, small bug alloca + bitcast

Stepan Dyatkovskiy stpworld at narod.ru
Mon Apr 30 10:52:00 PDT 2012


Hello all.
If alloca size is calculated within the "add nsw" instruction, it will 
NOT fused to any another alloca.

The test "Transorms/InstCombine/2011-06-13-nsw-alloca.ll" contains mistake.
in "fu1" we want to ensure that alloca + bitcast may be fused to new 
alloca if allocated size was calculated with "nsw" instructions. And we 
insert "CHECK: alloca double*" here. But this test will always passed 
since there is one more alloca double* in the beginning of fu1. And by 
the way we should check "alloca double" (without asterisk).
This test is fixed by adding CHECK-NEXT:
CHECK: alloca double
CHECK-NEXT: store double*
I also added some usefull checks to test and fixed InstCombineCasts.cpp.

Please find the patch for review.

-Stepan.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: bitcast-alloca.patch
Type: text/x-patch
Size: 2027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120430/4be2e33e/attachment.bin>


More information about the llvm-commits mailing list