[GVN] Refactor findDominatingLoad function
authorSergey Kachkov <sergey.kachkov@syntacore.com>
Fri, 13 Jan 2023 13:02:21 +0000 (16:02 +0300)
committerSergey Kachkov <sergey.kachkov@syntacore.com>
Fri, 20 Jan 2023 08:54:11 +0000 (11:54 +0300)
commite1a702db2fcd1dfbfe175efe334135d184234970
tree618e36854452b8c44e7f893ac5cd435698b9264d
parente74f9e7885078e7c847b2672a70b6743731aa53a
[GVN] Refactor findDominatingLoad function

Improve findDominatingLoad implementation:
1. Result is saved into gvn::AvailableValue struct
2. Search is done in extended BB (while there is a single predecessor or
   limit is reached)

Differential Revision: https://reviews.llvm.org/D141680
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Transforms/GVN/PRE/pre-load-through-select.ll