[PATCH] D119418: [ArgPromotion] Protect harder against recursive promotion (PR42028)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 10 01:47:03 PST 2022


nikic created this revision.
nikic added a reviewer: jdoerfert.
Herald added subscribers: ormris, hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In addition to the self-recursion check, also check whether there is more than one node in the SCC, which implies that there is a larger cycle. I believe checking SCC structure (rather than something like `norecurse`) is the right thing to do here, because this is specifically about preventing infinite loops over the SCC.

Fixes https://github.com/llvm/llvm-project/issues/42028.


https://reviews.llvm.org/D119418

Files:
  llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
  llvm/test/Transforms/ArgumentPromotion/pr42028-recursion.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119418.407422.patch
Type: text/x-patch
Size: 6431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220210/02dfa09a/attachment-0001.bin>


More information about the llvm-commits mailing list