This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Optimzed old value for dpp if unused
AbandonedPublic

Authored by rampitec on May 7 2018, 6:00 PM.

Details

Diff Detail

Event Timeline

rampitec created this revision.May 7 2018, 6:00 PM
arsenm added inline comments.May 8 2018, 12:21 AM
lib/Target/AMDGPU/SIISelLowering.cpp
7402–7418

Can this be done earlier before selection?

rampitec added inline comments.May 8 2018, 9:55 AM
lib/Target/AMDGPU/SIISelLowering.cpp
7402–7418

Theoretically this can be done as early as in the AMDGPULibCalls. Unused old value can be replaced with undef.

Why do you think it is better? I do not see any optimization which may be done based on that. At the same time before the selection we have to work with an intrinsic and after we are working with the instruction itself. Given that we may have several intrinsics leading here in the future that maybe less code potentially.

rampitec added inline comments.May 8 2018, 12:16 PM
lib/Target/AMDGPU/SIISelLowering.cpp
7402–7418

Please check D46596, it is InstCombine based implementation.
It can be used separately or in conjunction with this one in case instruction [will] came from not from that intrinsic.

arsenm added inline comments.May 18 2018, 1:08 AM
lib/Target/AMDGPU/SIISelLowering.cpp
7402–7418

I really dislike doing anything in the awkward machine-selected DAG, and it's usually a last resort if nothing else works. Doing in the DAG or on the final machine instruction would be better if you think a later pass besides instcombine is helpful. Plus more code in the DAG is more code that needs to be rewritten on machine instructions in the future

rampitec abandoned this revision.May 23 2018, 11:09 AM

D46596 was committed instead.