summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2017-07-28 15:47:25 +0000
committerWei Mi <wmi@google.com>2017-07-28 15:47:25 +0000
commit55c05e14afa4beb2f555c91c85296a18d296168c (patch)
tree7cad256239410590a549172d17c9af87048200a0 /llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
parentb3117410112e6780d38af059c2a7604b70ec8b7a (diff)
downloadbcm5719-llvm-55c05e14afa4beb2f555c91c85296a18d296168c.tar.gz
bcm5719-llvm-55c05e14afa4beb2f555c91c85296a18d296168c.zip
[GVN] Recommit the patch "Add phi-translate support in scalarpre"
Recommit after workaround the bug PR31652. Three bugs fixed in previous recommits: 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. The third one is an out-of-bound array access in a flipped if guard. 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: 309397
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud