diff options
author | Wei Mi <wmi@google.com> | 2017-05-27 00:54:19 +0000 |
---|---|---|
committer | Wei Mi <wmi@google.com> | 2017-05-27 00:54:19 +0000 |
commit | 5bbb5aafc10c3a164e966afcd30f5eace4ee033a (patch) | |
tree | acd45658454b060a256470e105586a883a339854 /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | 24dc63a9b9a581a31dfa8912dbcc18735c75bba1 (diff) | |
download | bcm5719-llvm-5bbb5aafc10c3a164e966afcd30f5eace4ee033a.tar.gz bcm5719-llvm-5bbb5aafc10c3a164e966afcd30f5eace4ee033a.zip |
[GVN] Recommit the patch "Add phi-translate support in scalarpre".
The recommit is to fix a bug about ExtractValue and InsertValue ops. For those
ops, some varargs inside GVN::Expression are not value numbers but raw index
numbers. It is wrong to do phi-translate for raw index numbers, and the fix is
to stop doing that.
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: 304050
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
0 files changed, 0 insertions, 0 deletions