[PATCH] D125485: [ArgPromotion] Unify byval promotion with non-byval

Pavel Samolysov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 01:52:15 PDT 2022


psamolysov updated this revision to Diff 430601.
psamolysov added a comment.

Create a DominatorTree for a new function

New function requires its own dominator tree for the call to the
`PromoteMem2Reg` function. The dominator tree calculated for an old
function is not actual after the argument promotion and using the
tree may lead to UB inside the `PromoteMem2Reg`.

I'm in doubt what to do for the Assumption Cache (`AC`). Currently I use
the AC pre-built for the old function. Our pass does nothing to deal with
the `@llvm.assume` intrinsics, so I believe the cache should be actual and
for the new function too. Do you agree?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125485/new/

https://reviews.llvm.org/D125485

Files:
  llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
  llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
  llvm/test/Transforms/ArgumentPromotion/align.ll
  llvm/test/Transforms/ArgumentPromotion/attrs.ll
  llvm/test/Transforms/ArgumentPromotion/byval-2.ll
  llvm/test/Transforms/ArgumentPromotion/byval-through-pointer-promotion.ll
  llvm/test/Transforms/ArgumentPromotion/byval-with-padding.ll
  llvm/test/Transforms/ArgumentPromotion/byval.ll
  llvm/test/Transforms/ArgumentPromotion/dbg.ll
  llvm/test/Transforms/ArgumentPromotion/fp80.ll
  llvm/test/Transforms/ArgumentPromotion/store-after-load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125485.430601.patch
Type: text/x-patch
Size: 48528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220519/af0eaed5/attachment.bin>


More information about the llvm-commits mailing list