This is an archive of the discontinued LLVM Phabricator instance.

Partially revert r210444 due to performance regression
ClosedPublic

Authored by jingyue on Jul 16 2014, 11:52 AM.

Details

Summary

Converting outermost zext(a) to sext(a) causes worse code when the
computation of zext(a) could be reused. For example, after converting

... = array[zext(a)]
... = array[zext(a) + 1]

to

... = array[sext(a)]
... = array[zext(a) + 1],

the program computes sext(a), which is actually unnecessary. I added one
test in split-gep-and-gvn.ll to illustrate this scenario.

Also, with r211281 and r211084, we annotate more "nuw" tags to
computation involving CUDA intrinsics such as threadIdx.x. These
annotations help with splitting GEP a lot, rendering the benefit we get
from this reverted optimization only marginal.

Diff Detail

Event Timeline

jingyue updated this revision to Diff 11519.Jul 16 2014, 11:52 AM
jingyue retitled this revision from to Partially revert r210444 due to performance regression.
jingyue updated this object.
jingyue edited the test plan for this revision. (Show Details)
jingyue added reviewers: meheff, eliben.
jingyue added a subscriber: Unknown Object (MLST).
meheff edited edge metadata.Jul 16 2014, 1:06 PM

LGTM.

test/Transforms/SeparateConstOffsetFromGEP/NVPTX/split-gep-and-gvn.ll
59

spurious newline.

jingyue updated this revision to Diff 11542.Jul 16 2014, 3:48 PM
jingyue edited edge metadata.

Removed a spurious empty line

meheff accepted this revision.Jul 16 2014, 3:49 PM
meheff edited edge metadata.
This revision is now accepted and ready to land.Jul 16 2014, 3:49 PM
jingyue updated this revision to Diff 11545.Jul 16 2014, 4:30 PM
jingyue edited edge metadata.

Rename rl to rd to confirm with r213168

jingyue closed this revision.Jul 16 2014, 4:33 PM