[PATCH] D91786: [GVN] Strengthen the updating of dominated users

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 05:14:07 PST 2020


jonpa created this revision.
jonpa added reviewers: lebedev.ri, joerg, uweigand.
Herald added subscribers: dexonsmith, hiraditya.
Herald added a project: LLVM.
jonpa requested review of this revision.

This is a first effort to replace https://reviews.llvm.org/D90231, which aimed to exclude @llvm.is.constant() from value replacements. Instead, this patch takes the approach of improving GVN so that the failed test case compiles.

propagateEquality() calls replaceDominatedUsesWith() at the point where one Value can replace another one as long as it is dominated from a certain point. This patch makes sure that also the cases where a user that is not dominated by any such call can still be updated if all of its (parents) predecessors are dominated by such an equivalence. In other words, if there are multiple calls to replaceDominatedUsesWith() at different points with the same equivalency, they may together dominate a user.

This is needed to be able to compile Linux Kernel code with multiple __builtin_constant_p calls.


https://reviews.llvm.org/D91786

Files:
  llvm/include/llvm/IR/Dominators.h
  llvm/include/llvm/Transforms/Scalar/GVN.h
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/Transforms/Scalar/GVN.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/test/Transforms/builtin_constant.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91786.306374.patch
Type: text/x-patch
Size: 11023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201119/f8795105/attachment.bin>


More information about the llvm-commits mailing list