aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WindowsResource.cpp
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2017-06-16 20:21:01 +0000
committerWei Mi <wmi@google.com>2017-06-16 20:21:01 +0000
commita2493b6ad91967b822f3234f132105314128596c (patch)
tree34c8486aba4c635d1b700c7f22072c341a0aa7df /llvm/lib/Object/WindowsResource.cpp
parente145bc22fd63f3d76560e7cc0d7697c9c3483695 (diff)
downloadllvm-a2493b6ad91967b822f3234f132105314128596c.zip
llvm-a2493b6ad91967b822f3234f132105314128596c.tar.gz
llvm-a2493b6ad91967b822f3234f132105314128596c.tar.bz2
[GVN] Recommit the patch "Add phi-translate support in scalarpre".
The recommit fixes two bugs: The first one is to use CurrentBlock instead of PREInstr's Parent as param of performScalarPREInsertion because the Parent of a clone instruction may be uninitialized. The second one is stop PRE when CurrentBlock to its predecessor is a backedge and an operand of CurInst is defined inside of CurrentBlock. The same value defined inside of loop in last iteration can not be regarded as available. 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: 305578
Diffstat (limited to 'llvm/lib/Object/WindowsResource.cpp')
0 files changed, 0 insertions, 0 deletions