]> granicus.if.org Git - llvm/commit
[IPT] Drop cache less eagerly in GVN and LoopSafetyInfo
authorMax Kazantsev <max.kazantsev@azul.com>
Wed, 9 Jan 2019 07:28:13 +0000 (07:28 +0000)
committerMax Kazantsev <max.kazantsev@azul.com>
Wed, 9 Jan 2019 07:28:13 +0000 (07:28 +0000)
commitc80a38c134a8bdda5857b743a3096847e1b58d84
treec539156dbb0ac17f1f407bd4f0c057d4e43d05e0
parentbccca22e8c31be988c4875eeeabfe77b5fca5802
[IPT] Drop cache less eagerly in GVN and LoopSafetyInfo

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 of the map and should save us some compile time
because in practice we don't typically add/remove special instructions.

Differential Revision: https://reviews.llvm.org/D54462
Reviewed By: efriedma

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350694 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/InstructionPrecedenceTracking.h
include/llvm/Analysis/MustExecute.h
lib/Analysis/InstructionPrecedenceTracking.cpp
lib/Analysis/MustExecute.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/LICM.cpp