This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Use set for tracked registers
ClosedPublic

Authored by arsenm on Aug 29 2017, 10:36 AM.

Details

Reviewers
rampitec
Summary

The majority of the time spent in the pass checking
for the register reads. Rather than searching all of
the defined registers for uses in each instruction,
use a set of defined registers and check the operands
of the instruction.

This process still is algorithmically not great,
but with the additional trick of skipping the analysis
for addresses with one use, this brings one slow
testcase into a reasonable range.

Diff Detail

Event Timeline

arsenm created this revision.Aug 29 2017, 10:36 AM
rampitec accepted this revision.Aug 29 2017, 12:15 PM

LGTM, just remove blank line 253.

lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
253

Extra blank line.

This revision is now accepted and ready to land.Aug 29 2017, 12:15 PM
javed.absar added inline comments.
lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
148

This doesn't seem necessary.

149

Generally one should have a message string with the assertion so that when it fails, it is clear why it did e.g. assert( Inserted && "No valid defs")

arsenm closed this revision.Aug 30 2017, 6:54 PM
arsenm marked an inline comment as done.

r312206

lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
148

It prevents people from trying to make this a non-SSA pass again. I've replaced that with an isSSA assert at the beginning of the pass