diff options
author | Wei Mi <wmi@google.com> | 2017-05-25 21:49:02 +0000 |
---|---|---|
committer | Wei Mi <wmi@google.com> | 2017-05-25 21:49:02 +0000 |
commit | fd257fa7bff1dd413f8853f966bdc3e23ab339bc (patch) | |
tree | 384c07d569fbf8dc628ea815e38ed62e8c61d6d9 /llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp | |
parent | f466001eefc9de4c704f03f0748220df6a26a6a7 (diff) | |
download | bcm5719-llvm-fd257fa7bff1dd413f8853f966bdc3e23ab339bc.tar.gz bcm5719-llvm-fd257fa7bff1dd413f8853f966bdc3e23ab339bc.zip |
[GVN] Add phi-translate support in scalarpre.
Right now scalarpre doesn't have phi-translate support, so it will miss some
simple pre opportunities. Like the following testcase, current scalarpre cannot
recognize the last "a * b" is fully redundent because a and b used by the last
"a * b" expr are both defined by phis.
long a[100], b[100], g1, g2, g3;
__attribute__((pure)) long goo();
void foo(long a, long b, long c, long d) {
g1 = a * b;
if (__builtin_expect(g2 > 3, 0)) {
a = c;
b = d;
g2 = a * b;
}
g3 = a * b; // fully redundant.
}
The patch adds phi-translate support in scalarpre. This is only a temporary
solution before the newpre based on newgvn is available.
Differential Revision: https://reviews.llvm.org/D32252
llvm-svn: 303923
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp')
0 files changed, 0 insertions, 0 deletions