[PATCH] D156397: [FunctionAttrs] Unconditionally perform argument attribute inference in the first function-attrs pass

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 00:13:33 PDT 2023


cfang created this revision.
cfang added reviewers: nikic, aeubanks, arsenm, bcahoon.
Herald added subscribers: ormris, StephenFan, hiraditya.
Herald added a project: All.
cfang requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Argument attributes like NoAlias and ReadOnly could affect memoryssa and thus earlyCSE in the function simplification pipeline.
https://reviews.llvm.org/D145210 adjusted PostOrderFunctionAttrs placement and caused the argument attributes not referred for the use
in the pipeline. This work (initiated by @nikic) unconditionally performs argument attribute inference in the first function-attrs pass.

Based on @nikic's experiment, the compile-time impact is pretty low: http://llvm-compile-time-tracker.com/compare.php?from=74258f4189e2b6bacabd40ee6f588fd9d1b37741&to=7f7484aee497cdae817b4aa24aed8046f430a816&stat=instructions%3Au


https://reviews.llvm.org/D156397

Files:
  llvm/lib/Transforms/IPO/FunctionAttrs.cpp
  llvm/test/Transforms/InstCombine/unused-nonnull.ll
  llvm/test/Transforms/PhaseOrdering/arg-attrs-affect-earlycse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156397.544623.patch
Type: text/x-patch
Size: 14439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230727/cef75e14/attachment.bin>


More information about the llvm-commits mailing list