Open GoogleCodeExporter opened 9 years ago
+1 for using TBAA. I can handle it later, once the rest of the code is in.
Original comment by kcc@chromium.org
on 19 Nov 2012 at 12:48
Humm... what if you just explicitly move the load below the branch? It looks
like the way to go. Then the compiler does not need to figure out anything.
Original comment by dvyu...@google.com
on 19 Nov 2012 at 12:56
tbaa is the general mechanism, if we can reply on it and save a bit of code in
our phase -- we should
Original comment by konstant...@gmail.com
on 19 Nov 2012 at 1:04
Yes, there must be a lot of other optimization possibilities suppressed by this
issue. Asan may benefit from tbaa, too.
Original comment by euge...@google.com
on 19 Nov 2012 at 1:14
It seems like llvm (and gcc, too) simply does not do this optimization.
See an example:
int f(bool z, long long* y, long long* y1, int* p, int* p1) {
long long x = *y;
*p1 = 0;
if (__builtin_expect(z, 0)) {
*y1 = x;
}
return 2;
}
I could not make any of the compilers move the load of (*y) under if().
Original comment by euge...@google.com
on 22 Nov 2012 at 11:12
Original issue reported on code.google.com by
euge...@google.com
on 19 Nov 2012 at 12:43