Displaying 3 results from an estimated 3 matches for "0b5e205d".
2012 Apr 17
0
[LLVMdev] InstCombine adds bit masks, confuses self, others
> I am not sure how best to fix this. If possible, InstCombine's canonicalization shouldn't hide arithmetic progressions behind bit masks. At least, it seems these transformations should be disabled unless (X >> C).hasOneUse(). They aren't exactly optimizations.
>
> This:
>
> %div = lshr i32 %a, 2
> store i32 %div, i32* %p, align 4, !tbaa !0
> %add = shl
2012 Apr 17
3
[LLVMdev] InstCombine adds bit masks, confuses self, others
...#39;s see if we have any evidence that reserving this transform for the
DAGCombiner hurts things, how it hurts things, and what we can do about it
first?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120417/0b5e205d/attachment.html>
2012 Apr 16
5
[LLVMdev] InstCombine adds bit masks, confuses self, others
Look at this silly function:
$ cat small.c
unsigned f(unsigned a, unsigned *p) {
unsigned x = a/4;
p[0] = x;
p[1] = x+x;
return p[1] - 2*p[0];
}
GCC turns this into straightforward code and figures out the 0 return value:
shrl $2, %edi
movl %edi, (%rsi)
addl %edi, %edi
movl %edi, 4(%rsi)
movl $0, %eax
ret
LLVM optimizes the code:
$ clang -O -S -o- small.c -emit-llvm
define i32