[PATCH] D111276: [ArgumentPromotion] Support opaque pointers

Josh Stone via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 20 09:32:33 PDT 2021


cuviper added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:729-731
+  // If we're in a recursive function, and the argument is a recursive type
+  // where we do load the same type, we could end up infinitely peeling the
+  // function argument. (This might be too pessimistic for opaque pointers.)
----------------
aeubanks wrote:
> we're slightly powering down this transform under opaque pointers right? since previously we'd treat different pointer types as different and not bail out in the recursive check as often.
> it'd be nice to have a test for this change
I think it goes both ways -- yes, opaque pointers will look equal and be deemed recursive in cases that weren't before. On the other hand, the former code considered it recursive if the type had a self pointer at all, even if that's not used in the promotion. I'll see if I can craft test examples for both.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111276



More information about the llvm-commits mailing list