[PATCH] D151254: InstSimplify: Require instruction be parented

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 13:42:29 PDT 2023


arsenm created this revision.
arsenm added reviewers: nikic, fhahn, jdoerfert, spatel, craig.topper, lebedev.ri, efriedma.
Herald added subscribers: hoy, StephenFan, wenlei, hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Unlike every other analysis and transform, simplifyInstruction
permitted operating on instructions which are not inserted
into a function. This created an edge case no other code needs
to really worry about, and limited transforms in cases that
can make use of the context function. Only the inliner and a handful
of other utilities were making use of this, so just fix up these
edge cases. Results in some IR ordering differences since
cloned blocks are inserted eagerly now. Plus some additional
simplifications trigger (e.g. some add 0s now folded out that
previously didn't).


https://reviews.llvm.org/D151254

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/lib/Transforms/Scalar/JumpThreading.cpp
  llvm/lib/Transforms/Utils/CloneFunction.cpp
  llvm/lib/Transforms/Utils/LoopRotationUtils.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/CodeExtractor/PartialInlineAndOr.ll
  llvm/test/Transforms/CodeExtractor/PartialInlinePGOMultiRegion.ll
  llvm/test/Transforms/Inline/call-intrinsic-is-constant.ll
  llvm/test/Transforms/Inline/callbr.ll
  llvm/test/Transforms/Inline/deoptimize-intrinsic.ll
  llvm/test/Transforms/Inline/dynamic-alloca-simplified-large.ll
  llvm/test/Transforms/Inline/inline-funclets.ll
  llvm/test/Transforms/Inline/inline-tail.ll
  llvm/test/Transforms/Inline/inline_inv_group.ll
  llvm/test/Transforms/Inline/inline_invoke.ll
  llvm/test/Transforms/Inline/inlined-mustprogress-loop-metadata.ll
  llvm/test/Transforms/Inline/noalias-calls2.ll
  llvm/test/Transforms/Inline/nonnull.ll
  llvm/test/Transforms/Inline/ret_attr_update.ll
  llvm/test/Transforms/Inline/simplify-instruction-computeKnownFPClass-context.ll
  llvm/test/Transforms/LoopRotate/pr56260.ll
  llvm/test/Transforms/PartialInlining/switch_stmt.ll
  llvm/test/Transforms/SampleProfile/profile-context-tracker-debug.ll
  llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll
  llvm/test/Transforms/SimplifyCFG/pr46638.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151254.524867.patch
Type: text/x-patch
Size: 43441 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230523/7ad34b05/attachment-0001.bin>


More information about the llvm-commits mailing list