This is an archive of the discontinued LLVM Phabricator instance.

[IPT] Drop cache less eagerly in GVN and LoopSafetyInfo
ClosedPublic

Authored by mkazantsev on Nov 12 2018, 7:50 PM.

Details

Summary

Current strategy of dropping InstructionPrecedenceTracking cache is to
invalidate the entire basic block whenever we change its contents. In fact,
InstructionPrecedenceTracking has 2 internal strictures: OrderedInstructions
that is needed to be invalidated whenever the contents changes, and the map
with first special instructions in block. This second map does not need an
update if we add/remove a non-special instuction because it cannot
affect the contents of this map.

This patch changes API of InstructionPrecedenceTracking so that it now
accounts for reasons under which we invalidate blocks. This should lead
to much less recalculations the map and should save us some compile time
because in practice we don't typically add/remove special instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

mkazantsev created this revision.Nov 12 2018, 7:50 PM
efriedma accepted this revision.Jan 7 2019, 7:48 PM

LGTM

This revision is now accepted and ready to land.Jan 7 2019, 7:48 PM
This revision was automatically updated to reflect the committed changes.