[PATCH] D152537: [NFC][DebugInfo][RemoveDIs] Prefer insert-with-iterator over instruction pointers when inserting into blocks

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 07:32:04 PDT 2023


jmorse created this revision.
Herald added subscribers: Enna1, ormris, foad, ChuanqiXu, laytonio, kerbowa, asbirlea, rogfer01, zzheng, kbarton, hiraditya, jvesely, nemanjai, arsenm.
Herald added a project: All.
jmorse requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, vkmr.
Herald added a project: LLVM.

Continuing the patches from my proposal for how to get rid of debug intrinsics [0], we would also need to have most instruction insertion routines take an iterator instead of just an instruction pointer -- so that in the future we can communicate more information about debug-info in the iterator class. This patch adds an iterator-taking insertBefore method, and converts a raft of call-sites to using it instead of inserting through instruction-constructors or similar. Again, these are all the call-sites that had to be instrumented to make a stage2clang build identically, plus a couple of other large C++ code bases I have to hand.

I suspect the ultimate outcome of this would be making all the inserter functions take iterators.

Patch is technically NFC and I'm not adding reviewers; this is so that people can take a look at what changes I'm proposing, and have a think about how we can go about testing them.

[0] https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152537

Files:
  llvm/include/llvm/IR/Instruction.h
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/CodeGen/SelectOptimize.cpp
  llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
  llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
  llvm/lib/Transforms/Coroutines/CoroFrame.cpp
  llvm/lib/Transforms/Coroutines/CoroSplit.cpp
  llvm/lib/Transforms/IPO/PartialInlining.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
  llvm/lib/Transforms/Scalar/GVN.cpp
  llvm/lib/Transforms/Scalar/GVNSink.cpp
  llvm/lib/Transforms/Scalar/JumpThreading.cpp
  llvm/lib/Transforms/Scalar/LICM.cpp
  llvm/lib/Transforms/Scalar/LoopFuse.cpp
  llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
  llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
  llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
  llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
  llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
  llvm/lib/Transforms/Utils/CodeExtractor.cpp
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
  llvm/lib/Transforms/Utils/LoopVersioning.cpp
  llvm/lib/Transforms/Utils/MoveAutoInit.cpp
  llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
  llvm/lib/Transforms/Utils/SSAUpdater.cpp
  llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
  llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152537.529956.patch
Type: text/x-patch
Size: 40613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230609/82a44c5b/attachment.bin>


More information about the llvm-commits mailing list