-
Fix iterating over instructions following a store · 3ab17bd7Nicolas Capens authored
Optimizer::eliminateLoadsFollowingSingleStore() was only looking at a single instruction following the store. Subzero derives Ice::Inst from llvm::ilist_node<Inst>, making it a node in a circular linked list. However, we can't iterate until the end because by default ilist_node<> does not provide sentinel node tracking. If the llvm::ilist_node<Inst, llvm::ilist_sentinel_tracking<true>> class is used instead, we can use isSentinel(), but this comes at the cost of each node itself having to indicate whether it's the sentinel, and keeping that up to date. This change instead obtains the basic block's instruction list from the store instruction, to get the iterator of the end node. Bug: b/179668593 Change-Id: I994a7b37d8872380d2668c098d85000120d3e47a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52753 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by:
Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com>
3ab17bd7
×