mirror-llvm-project/llvm/lib/CodeGen
Demetrius Kanios 1d4e04f7a7
[WebAssembly] Call EH personality function instead of Unwind_CallPersonality (#209282)
On Wasm, it's not currently possibly to change which `personality` is
attached to a given IR function. This is primarily because no matter
what `personality` is attached, codegen creates a call to a
`Unwind_CallPersonality` wrapper hard-coded to call c++abi's
personality.

In order to allow alternative personalities without introducing bloat at
each personality call site, this PR adjusts the ABI of the personality
on Wasm. `Unwind_CallPersonality` is moved to `libcxxabi` under the name
`__gxx_wasm_personality_v0`, with the "real" personality code renamed
`__gxx_personality_imp` and called by `__gxx_wasm_personality_v0` (after
resetting the landing pad context).

The signature of EH personalities on Wasm is now `int personality(void*
exception_object)` (where the int return is `_Unwind_Reason_Code` and
the `void*` is `_Unwind_Exception*`), and personalities are expected to
`__wasm_lpad_context.selector = 0;`.

Based on #175202
2026-07-28 20:05:45 -07:00
..
AsmPrinter [LoopInfo] Build dominator tree only for irreducible CFG (#212098) 2026-07-27 09:56:51 -07:00
GlobalISel AMDGPU/GlobalISel: Lower bf16 G_FPTRUNC from f32 and f64 (#212302) 2026-07-28 15:25:53 -07:00
LiveDebugValues Revert "[LLVM][NFC] Remove some global constructors" (#208494) 2026-07-09 16:48:15 +00:00
MIRParser [MC][AArch64] Add .cfi_set_ra_state for PAuth_LR (#209949) 2026-07-21 14:22:36 -07:00
SelectionDAG [DAGCombiner] Fold insert_vector_elt into a shared BUILD_VECTOR (#210905) 2026-07-28 14:37:54 +08:00
AggressiveAntiDepBreaker.cpp [CodeGen] De-type getMinimalPhysRegClass and related APIs (#197495) 2026-06-02 06:49:26 +01:00
AggressiveAntiDepBreaker.h [CodeGen] Merge TargetRegClass into MCRegClass (#207168) 2026-07-03 07:52:57 +02:00
AllocationOrder.cpp
AllocationOrder.h
Analysis.cpp [SEH] Ensure unreachable blocks are placed in EHScopeMembership (#175550) 2026-01-13 09:09:53 +00:00
AssignmentTrackingAnalysis.cpp [CodeGen][Transforms] Remove unused DenseMapInfo::getEmptyKey (#201994) 2026-06-06 13:45:36 -07:00
AtomicExpandPass.cpp [IR] Allow vector atomicrmw xchg (#208510) 2026-07-22 12:57:34 -07:00
BasicBlockMatchingAndInference.cpp [NFC][CodeGen] Use DenseMap instead of unordered_map in BasicBlockMatchingAndInference (#192824) 2026-04-19 06:20:54 +00:00
BasicBlockPathCloning.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
BasicBlockSections.cpp [Codegen, X86] Add prefetch insertion based on Propeller profile (#166324) 2026-04-10 15:58:16 -07:00
BasicBlockSectionsProfileReader.cpp [Codegen, X86] Add prefetch insertion based on Propeller profile (#166324) 2026-04-10 15:58:16 -07:00
BasicTargetTransformInfo.cpp
BranchFolding.cpp [BranchFolding] Refactor AreConditionalsEqual to Helper (#211270) 2026-07-22 13:23:07 -07:00
BranchFolding.h [CodeGen][BranchFolding] Add options to control common hoisting and block reordering (#205704) 2026-07-09 19:51:57 -07:00
BranchRelaxation.cpp [AArch64][CodeGen] Fix trampoline basic block offset (#202716) 2026-07-21 19:18:58 +02:00
BreakFalseDeps.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
CalcSpillWeights.cpp [RegAlloc] Remove redundant parameters for weightCalcHelper (NFC). (#170151) 2026-01-30 17:25:47 +00:00
CallingConvLower.cpp
CFGuardLongjmp.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
CFIFixup.cpp [CodeGen][NewPM] Port cfi-fixup to new pass manager (#203692) 2026-06-15 13:58:21 +08:00
CFIInstrInserter.cpp [MC][AArch64] Add .cfi_set_ra_state for PAuth_LR (#209949) 2026-07-21 14:22:36 -07:00
CMakeLists.txt [MachineSSAUpdater][AMDGPU] Add faster version of MachineSSAUpdater class. (#145722) 2026-04-24 13:25:51 +02:00
CodeGen.cpp [NewPM] Port StaticDataAnnotator 2026-07-06 02:42:44 +00:00
CodeGenCommonISel.cpp
CodeGenPrepare.cpp [LoopInfo] Take no dominator tree in verify(). NFC (#212414) 2026-07-28 07:08:11 +00:00
CodeGenTargetMachineImpl.cpp MCContext/TargetMachine: Take MCRegisterInfo and MCSubtargetInfo by reference. NFC (#195032) 2026-05-03 20:37:28 -07:00
CommandFlags.cpp opt: Use Triple overloads of TargetRegistry lookup (#205889) 2026-06-25 22:03:51 +00:00
ComplexDeinterleavingPass.cpp [ComplexDeinterleaving] Preserve duplicate reassoc addends in identifyReassocNodes (#205578) 2026-06-25 16:31:45 +01:00
CriticalAntiDepBreaker.cpp
CriticalAntiDepBreaker.h [CodeGen] Merge TargetRegClass into MCRegClass (#207168) 2026-07-03 07:52:57 +02:00
DeadMachineInstructionElim.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
DetectDeadLanes.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
DFAPacketizer.cpp
DroppedVariableStatsMIR.cpp
DwarfEHPrepare.cpp CodeGen: Rename LibcallLoweringModuleAnalysisResult to ModuleLibcallLoweringInfo (#210176) 2026-07-17 08:22:00 +02:00
EarlyIfConversion.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
EdgeBundles.cpp
EHContGuardTargets.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
ExecutionDomainFix.cpp
ExpandIRInsts.cpp CodeGen: Rename LibcallLoweringModuleAnalysisResult to ModuleLibcallLoweringInfo (#210176) 2026-07-17 08:22:00 +02:00
ExpandPostRAPseudos.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
ExpandReductions.cpp [ExpandReductions] Expand fmaximum/fminimum reductions (#195169) 2026-07-13 15:15:57 +00:00
ExpandVectorPredication.cpp [IR] Introduce Instruction::getFastMathFlagsOrNone (NFC) (#200457) 2026-05-29 14:58:25 -04:00
FaultMaps.cpp
FEntryInserter.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
FinalizeISel.cpp
FixupStatepointCallerSaved.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
FuncletLayout.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
GCEmptyBasicBlocks.cpp [LLVM] Remove pass initialization from pass constructor (#178729) 2026-01-29 13:38:17 -08:00
GCMetadata.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
GCMetadataPrinter.cpp
GCRootLowering.cpp [CodeGen][GC] Initialize roots with Constant::getNullValue() instead of ConstantPointerNull::get() (#199367) 2026-05-25 02:16:17 +02:00
GlobalMerge.cpp Reland "Compute GUIDs once and store in metadata" (#184065) (#201849) 2026-07-07 16:04:23 -07:00
GlobalMergeFunctions.cpp [CGData][GMF] Preserve Profile Data (#180126) 2026-02-06 10:03:39 -08:00
HardwareLoops.cpp [CodeGen] Drop uses of BranchInst (#186391) 2026-03-13 21:51:38 +00:00
IfConversion.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
ImplicitNullChecks.cpp [ImplicitNullChecks] Preserve debug location on FAULTING_OP (#205560) 2026-07-10 12:22:46 +05:30
IndirectBrExpandPass.cpp [IR] BlockAddress doesn't use BasicBlock (#200772) 2026-06-01 15:44:56 +02:00
InitUndef.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
InlineAsmPrepare.cpp [IRBuilder] Refactor for intrinsics const-folding (NFC) (#202738) 2026-06-17 11:16:14 +00:00
InlineSpiller.cpp [InlineSpiller] Avoid spill hoisting interference (#211809) 2026-07-27 14:24:51 +02:00
InsertCodePrefetch.cpp [InsertCodePrefetch,X86] Prevent duplicate prefetch fallback symbols (#195348) 2026-05-07 11:37:54 -07:00
InterferenceCache.cpp Revert "[LLVM][NFC] Remove some global constructors" (#208494) 2026-07-09 16:48:15 +00:00
InterferenceCache.h
InterleavedAccessPass.cpp [IA][RISCV] Support gap mask for loads that are de-interleaved through intrinsics (#197062) 2026-05-15 08:37:03 -07:00
InterleavedLoadCombinePass.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
IntrinsicLowering.cpp
JMCInstrumenter.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
KCFI.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
LatencyPriorityQueue.cpp
LazyMachineBlockFrequencyInfo.cpp [LoopInfo] Build dominator tree only for irreducible CFG (#212098) 2026-07-27 09:56:51 -07:00
LexicalScopes.cpp
LibcallLoweringInfo.cpp CodeGen: Rename LibcallLoweringModuleAnalysisResult to ModuleLibcallLoweringInfo (#210176) 2026-07-17 08:22:00 +02:00
LiveDebugVariables.cpp [CodeGen] Stop requiring analyses that no pass reads (#212430) 2026-07-28 18:04:48 +00:00
LiveInterval.cpp [CodeGen] Join live range segments after dead def move (#204648) 2026-06-22 10:52:01 -04:00
LiveIntervalCalc.cpp Revert "[LLVM][NFC] Remove some global constructors" (#208494) 2026-07-09 16:48:15 +00:00
LiveIntervals.cpp [CodeGen] Join live range segments after dead def move (#204648) 2026-06-22 10:52:01 -04:00
LiveIntervalUnion.cpp [regalloc][LiveRegMatrix][AMDGPU] Fix LiveInterval dangling pointers in LiveRegMatrix. (#168556) 2026-01-27 16:08:58 +01:00
LivePhysRegs.cpp
LiveRangeCalc.cpp Revert "[LLVM][NFC] Remove some global constructors" (#208494) 2026-07-09 16:48:15 +00:00
LiveRangeEdit.cpp [2/3][RegAlloc][LiveRegMatrix] Fix inconsistency when fold creates a CopyMI (#197776) 2026-05-28 13:57:02 -07:00
LiveRangeShrink.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
LiveRangeUtils.h
LiveRegMatrix.cpp [regalloc][LiveRegMatrix][AMDGPU] Fix LiveInterval dangling pointers in LiveRegMatrix. (#168556) 2026-01-27 16:08:58 +01:00
LiveRegUnits.cpp [CodeGen] Debug insns must not affect liveness analysis (#193104) 2026-05-14 09:04:59 -05:00
LiveStacks.cpp Revert "[NFC][LiveStacks] Use vectors instead of map and unordred_map" (#180421) 2026-02-08 16:54:51 +00:00
LiveVariables.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
LocalStackSlotAllocation.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
LoopTraversal.cpp
LowerEmuTLS.cpp Fix emulated TLS alignment for large variables (#171037) 2026-03-31 09:37:06 -07:00
LowLevelTypeUtils.cpp [GlobalISel] Support the byte type in the IRTranslator (#196125) 2026-06-05 06:06:03 -04:00
MachineBasicBlock.cpp Revert "[LLVM][NFC] Remove some global constructors" (#208494) 2026-07-09 16:48:15 +00:00
MachineBlockFrequencyInfo.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
MachineBlockHashInfo.cpp [CodeGen] Always print 64 bit hash value in MachineBlockHashInfoPrinterPass (#198598) 2026-05-20 13:53:25 +02:00
MachineBlockPlacement.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
MachineBranchProbabilityInfo.cpp [Analysis][NFC] Remove BPI::getEdgeProbability(iterator) (#191286) 2026-04-09 20:45:54 +00:00
MachineCFGPrinter.cpp [CodeGen] Port dot-machine-cfg to new pass manager (#195901) 2026-05-06 10:30:05 -07:00
MachineCheckDebugify.cpp [CodeGen] Port mir-check-debugify to new pass manager (#199280) 2026-06-28 11:53:19 -07:00
MachineCombiner.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
MachineConvergenceVerifier.cpp
MachineCopyPropagation.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
MachineCSE.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
MachineCycleAnalysis.cpp [CycleInfo] Represent cycles by an opaque handle. NFC (#210117) 2026-07-17 00:34:28 -07:00
MachineDebugify.cpp [CodeGen] Port mir-debugify to new pass manager (#193201) 2026-05-04 17:17:20 +01:00
MachineDominanceFrontier.cpp [DominanceFrontier] Support post-dominators on graphs with single root (#179336) 2026-02-11 20:49:41 +00:00
MachineDominators.cpp [AArch64] Use GISel for optnone functions (#174746) 2026-01-29 16:30:22 +00:00
MachineDomTreeUpdater.cpp
MachineFrameInfo.cpp [AMDGPU] Set SGPR spill stack IDs when creating spill slots (#197628) 2026-06-09 17:42:03 +02:00
MachineFunction.cpp [clang] Emit call graph type metadata for internal linkage symbols (#210194) 2026-07-18 08:59:20 -07:00
MachineFunctionAnalysis.cpp
MachineFunctionPass.cpp [Analysis] Use CycleInfo for BranchProbabilityInfo (#210301) 2026-07-21 18:05:57 +00:00
MachineFunctionPrinterPass.cpp
MachineFunctionSplitter.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
MachineIDFSSAUpdater.cpp [MachineSSAUpdater][AMDGPU] Add faster version of MachineSSAUpdater class. (#145722) 2026-04-24 13:25:51 +02:00
MachineInstr.cpp [CodeGen] Mark LIFETIME_START and LIFETIME_END as not safe to move (#211179) 2026-07-23 02:21:42 +00:00
MachineInstrBundle.cpp [CodGen] Port UnpackMachineBundles to new pass manager (#184918) 2026-03-17 09:01:37 -07:00
MachineLateInstrsCleanup.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
MachineLICM.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
MachineLoopInfo.cpp [LoopInfo] Build dominator tree only for irreducible CFG (#212098) 2026-07-27 09:56:51 -07:00
MachineLoopUtils.cpp [MachinePipeliner] Fix crash during prolog peeling (#182189) 2026-02-24 12:34:22 -08:00
MachineModuleInfo.cpp [MC] Remove MCTargetOptions parameter from MCContext constructor (#191596) 2026-04-11 04:50:05 +00:00
MachineModuleInfoImpls.cpp
MachineModuleSlotTracker.cpp [CodeGen][NPM] Avoid MachineModuleInfo in MachineModuleSlotTracker (#171257) 2025-12-19 18:49:42 +01:00
MachineOperand.cpp [MC][AArch64] Add .cfi_set_ra_state for PAuth_LR (#209949) 2026-07-21 14:22:36 -07:00
MachineOptimizationRemarkEmitter.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
MachineOutliner.cpp [CodeGen][Transforms] Remove unused DenseMapInfo::getEmptyKey (#201994) 2026-06-06 13:45:36 -07:00
MachinePassManager.cpp
MachinePipeliner.cpp [CodeGen] Stop requiring analyses that no pass reads (#212430) 2026-07-28 18:04:48 +00:00
MachinePostDominators.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
MachineRegionInfo.cpp [CodeGen][NewPM] Port machine-region-info to new pass manager (#203848) 2026-06-17 18:48:51 +08:00
MachineRegisterInfo.cpp [MachineCopyPropagation] Fix debug info referring to subregisters. (#207861) 2026-07-08 12:23:39 -07:00
MachineScheduler.cpp [CodeGen] Stop requiring analyses that no pass reads (#212430) 2026-07-28 18:04:48 +00:00
MachineSink.cpp [MachineSink] Use RegisterClassInfo::getRegPressureSetLimit (#211746) 2026-07-24 08:50:51 +00:00
MachineSizeOpts.cpp
MachineSSAContext.cpp [UniformityAnalysis] Replace DivergentValues with UniformValues for conservative divergence queries (#180509) 2026-03-27 12:57:17 +05:30
MachineSSAUpdater.cpp
MachineStableHash.cpp [CodeGen] Add MO_LaneMask type and a new COPY_LANEMASK instruction (#151944) 2025-12-03 13:56:15 +05:30
MachineStripDebug.cpp [CodeGen] Port mir-strip-debug to new pass manager (#190738) 2026-04-20 20:56:01 +00:00
MachineTraceMetrics.cpp [ADT] Refactor post order traversal (#191047) 2026-04-09 20:31:15 +00:00
MachineUniformityAnalysis.cpp [CycleInfo] Represent cycles by an opaque handle. NFC (#210117) 2026-07-17 00:34:28 -07:00
MachineVerifier.cpp [MachineVerifier] do not use !NoPHI to check if a MF has phi nodes (#211941) 2026-07-27 18:41:31 +00:00
MacroFusion.cpp [MacroFusion] Restrict pairs to have SDep::Data dependency only (#203793) 2026-06-16 11:02:36 +03:00
MBFIWrapper.cpp
MIR2Vec.cpp [MIR2Vec] Handle machine functions with no basic blocks (#212294) 2026-07-28 20:32:23 +02:00
MIRCanonicalizerPass.cpp [NFCI][LLVM] Remove raw_string_ostream::flush calls (#164086) 2026-01-13 08:44:48 -08:00
MIRFSDiscriminator.cpp
MIRNamerPass.cpp
MIRPrinter.cpp [MIR] Serialize/Deserialize MachineInstr::LRSplit flag (#197362) 2026-07-06 18:53:16 +02:00
MIRPrintingPass.cpp [MIR] Save internal VirtRegMap state in MIR (#197361) 2026-06-12 17:42:21 +02:00
MIRSampleProfile.cpp [IR] Remove ProfileCount Abstraction 2026-06-23 20:26:14 +00:00
MIRVRegNamerUtils.cpp [MIRVRegNamerUtils] Handle instructions with multiple definitions (#172982) 2025-12-22 09:44:34 +01:00
MIRVRegNamerUtils.h
MIRYamlMapping.cpp
MLRegAllocEvictAdvisor.cpp [CodeGen] Stop requiring analyses that no pass reads (#212430) 2026-07-28 18:04:48 +00:00
MLRegAllocEvictAdvisor.h
MLRegAllocPriorityAdvisor.cpp
ModuloSchedule.cpp [Pipeliner] Use VRMapPhi to generate phi in epilog (#211723) 2026-07-24 14:56:45 -05:00
MultiHazardRecognizer.cpp [CodeGen] Make ShouldPreferAnother const. NFC. (#185606) 2026-03-10 15:03:56 +00:00
NonRelocatableStringpool.cpp
OptimizePHIs.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
PatchableFunction.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
PeepholeOptimizer.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
PHIElimination.cpp [CodeGen] PHIEliminationImpl::LowerPHINode: Fix assertion failure when all phi operands are undefined (#209013) 2026-07-24 16:20:54 +02:00
PHIEliminationUtils.cpp [PHIElimination] Ensure correct copy emission for INLINEASM_BR indirect targets 2026-01-08 14:46:37 +01:00
PHIEliminationUtils.h
PostRAHazardRecognizer.cpp [AMDGPU] Hoist WMMA coexecution hazard V_NOPs from loops to preheaders (#176895) 2026-02-26 17:19:00 +05:30
PostRASchedulerList.cpp [CodeGen] Stop requiring analyses that no pass reads (#212430) 2026-07-28 18:04:48 +00:00
PreISelIntrinsicLowering.cpp CodeGen: Rename LibcallLoweringModuleAnalysisResult to ModuleLibcallLoweringInfo (#210176) 2026-07-17 08:22:00 +02:00
ProcessImplicitDefs.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
PrologEpilogInserter.cpp [RISCV] Add support for vector registers with -fzero-call-used-regs (#206206) 2026-07-27 09:37:37 +00:00
PseudoProbeInserter.cpp [PseudoProbe] Preserve pseudoprobe for tailcall pseudo instrs (#197246) 2026-06-02 08:50:08 -07:00
PseudoSourceValue.cpp
RDFGraph.cpp [RDF] Replace unordered_map with DenseMap. NFC (#204280) 2026-06-17 04:52:50 +00:00
RDFLiveness.cpp [RDF] Replace unordered_map with DenseMap. NFC (#204280) 2026-06-17 04:52:50 +00:00
RDFRegisters.cpp [CodeGen][NFC] Remove RegisterClasses pointer array (#207204) 2026-07-03 06:33:37 +00:00
ReachingDefAnalysis.cpp [RDA] Slightly optimize enterBasicBlock() (NFC) (#201608) 2026-06-04 18:08:19 +02:00
README.txt
RegAllocBase.cpp [NFC] Move TimePasses globals from Pass.h to PassTimingInfo.h (#192352) 2026-04-15 22:58:20 +00:00
RegAllocBase.h
RegAllocBasic.cpp
RegAllocBasic.h [regalloc][basic] Fix non-deterministic codegen in basic register allocator (#177998) 2026-01-27 08:37:47 -08:00
RegAllocEvictionAdvisor.cpp [RegAlloc] consider urgent evict in evictInterference (#192631) 2026-05-06 12:23:41 +08:00
RegAllocFast.cpp [AMDGPU] Set SGPR spill stack IDs when creating spill slots (#197628) 2026-06-09 17:42:03 +02:00
RegAllocGreedy.cpp [RegAlloc] consider urgent evict in evictInterference (#192631) 2026-05-06 12:23:41 +08:00
RegAllocGreedy.h [RegAlloc] Change the computation of CSRCost (#177226) 2026-02-04 10:08:57 -08:00
RegAllocPBQP.cpp [CodeGen][NFC] Move getRawAllocOrder to TargetRegInfo (#207124) 2026-07-02 07:50:47 +00:00
RegAllocPriorityAdvisor.cpp
RegAllocScore.cpp
RegAllocScore.h
RegisterBank.cpp
RegisterBankInfo.cpp [CodeGen] De-type getMinimalPhysRegClass and related APIs (#197495) 2026-06-02 06:49:26 +01:00
RegisterClassInfo.cpp [CodeGen] Precompute pressure-set register classes (#210751) 2026-07-23 07:45:47 +01:00
RegisterCoalescer.cpp [CodeGen] Ensure undef propagation when an undef copy is eliminated if used as a subregister def (#204039) 2026-07-22 20:02:13 +00:00
RegisterCoalescer.h [CodeGen] Merge TargetRegClass into MCRegClass (#207168) 2026-07-03 07:52:57 +02:00
RegisterPressure.cpp Fix typos and spelling errors across codebase (#156270) 2026-01-13 11:52:46 -05:00
RegisterScavenging.cpp [CodeGen][NFC] Move getRawAllocOrder to TargetRegInfo (#207124) 2026-07-02 07:50:47 +00:00
RegisterUsageInfo.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
RegUsageInfoCollector.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
RegUsageInfoPropagate.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
Rematerializer.cpp [NFC] Reword comment per post-merge feedback on #211031 (#211234) 2026-07-22 14:24:53 +02:00
RemoveLoadsIntoFakeUses.cpp [CodeGen] Debug insns must not affect liveness analysis (#193104) 2026-05-14 09:04:59 -05:00
RemoveRedundantDebugValues.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
RenameIndependentSubregs.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
ReplaceWithVeclib.cpp [CodeGen] Teach ReplaceWithVeclib split vector llvm.sincos when only sin/cos veclib mappings exist (#194639) 2026-07-15 09:54:09 +08:00
ResetMachineFunctionPass.cpp [GlobalISel] Provide a fast path for ResetMachineFunctionPass when the function is empty (#177341) 2026-01-29 16:29:49 +00:00
SafeStack.cpp CodeGen: Rename LibcallLoweringModuleAnalysisResult to ModuleLibcallLoweringInfo (#210176) 2026-07-17 08:22:00 +02:00
SafeStackLayout.cpp
SafeStackLayout.h
SanitizerBinaryMetadata.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
ScheduleDAG.cpp [ScheduleDAG] Add a reachability cache to amortize DFS calls (#195079) 2026-05-12 16:52:27 +01:00
ScheduleDAGInstrs.cpp [MachineScheduler] Check we don't add self dependency edge when adding barrier (#202743) 2026-06-09 13:37:15 -07:00
ScheduleDAGPrinter.cpp
ScoreboardHazardRecognizer.cpp
SelectOptimize.cpp [MCSched] Allow tuning LoadLatency/MispredictPenalty (#203139) 2026-07-15 16:18:20 -07:00
ShadowStackGCLowering.cpp Reland "[CodeGen] Use byte offsets and ptradd in ShadowStackGCLowering" (#197436) 2026-05-19 10:51:00 -04:00
ShrinkWrap.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
SjLjEHPrepare.cpp [CodeGen] Drop uses of BranchInst (#186391) 2026-03-13 21:51:38 +00:00
SlotIndexes.cpp [SlotIndexes] Further pack indices to improve spill placement time (#182640) 2026-02-27 10:55:20 -08:00
SpillPlacement.cpp Revert "[CodeGen] Use SmallMapVector for SpillPlacement::Node::Links" (#194801) 2026-04-29 08:12:21 +00:00
SplitKit.cpp [CodeGen][AMDGPU] Remove premature empty subrange elimination (#201263) 2026-06-04 06:22:51 +02:00
SplitKit.h Revert "[RegAlloc] Relax the split constrain on MBB prolog" (#169990) 2025-11-29 08:01:23 -05:00
StackColoring.cpp [StackColoring] Change TotalStackSize from unsigned to int64_t (#208671) 2026-07-11 11:29:56 +02:00
StackFrameLayoutAnalysisPass.cpp
StackMapLivenessAnalysis.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
StackMaps.cpp [CodeGen] Use natural type for StackMaps::ConstPool. NFC. (#208732) 2026-07-10 17:12:42 +01:00
StackProtector.cpp CodeGen: Rename LibcallLoweringModuleAnalysisResult to ModuleLibcallLoweringInfo (#210176) 2026-07-17 08:22:00 +02:00
StackSlotColoring.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
StaticDataAnnotator.cpp [NewPM] Port StaticDataAnnotator 2026-07-06 02:42:44 +00:00
StaticDataSplitter.cpp [CodeGen] Stop requiring analyses that no pass reads (#212430) 2026-07-28 18:04:48 +00:00
SwiftErrorValueTracking.cpp [GlobalISel] Fix UMR in SwiftErrorValueTracking (#190273) 2026-04-03 14:33:35 +01:00
SwitchLoweringUtils.cpp
TailDuplication.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
TailDuplicator.cpp Use auto for DenseMap/SmallDenseMap iterator variables. NFC (#196883) 2026-05-11 07:20:21 +00:00
TargetFrameLoweringImpl.cpp [CodeGen] Split determineCalleeSaves into smaller functions. (#203981) 2026-07-14 11:15:48 -07:00
TargetInstrInfo.cpp [MCSched] Allow tuning LoadLatency/MispredictPenalty (#203139) 2026-07-15 16:18:20 -07:00
TargetLoweringBase.cpp RuntimeLibcalls: Drop artificial __aeabi_?cmpeq suffixes (#211251) 2026-07-22 19:31:43 +02:00
TargetLoweringObjectFileImpl.cpp [x86] Handle implicit sections when determining if a global is large (#206210) 2026-07-23 21:06:13 +00:00
TargetOptionsImpl.cpp [CodeGen] Parse frame-pointer attribute once when creating MachineFunction (#191974) 2026-04-20 09:48:21 +01:00
TargetPassConfig.cpp [NewPM] Port StaticDataAnnotator 2026-07-06 02:42:44 +00:00
TargetRegisterInfo.cpp [CodeGen][NFC] Remove RegisterClasses pointer array (#207204) 2026-07-03 06:33:37 +00:00
TargetSchedule.cpp [MCSched] Allow tuning LoadLatency/MispredictPenalty (#203139) 2026-07-15 16:18:20 -07:00
TargetSubtargetInfo.cpp TableGen: Use a compact table for CPU aliases (#211952) 2026-07-27 19:57:14 +02:00
TwoAddressInstructionPass.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
TypePromotion.cpp [IR] Split Br into UncondBr and CondBr (#184027) 2026-03-11 12:31:10 +00:00
UnreachableBlockElim.cpp [CodeGen] Add MachineRegisterClassInfo analysis pass (#210826) 2026-07-22 21:34:54 +02:00
ValueTypes.cpp [WebAssembly] Represent reference types as TargetExtType (#203165) 2026-06-24 22:07:33 -07:00
VirtRegMap.cpp [MIR] Save internal VirtRegMap state in MIR (#197361) 2026-06-12 17:42:21 +02:00
VLIWMachineScheduler.cpp
WasmEHPrepare.cpp [WebAssembly] Call EH personality function instead of Unwind_CallPersonality (#209282) 2026-07-28 20:05:45 -07:00
WindowScheduler.cpp Handle IMPLICIT_DEF in TripleMBB for WindowScheduler (#179190) 2026-04-27 15:57:22 +05:30
WindowsSecureHotPatching.cpp [LLVM][CodeGen] Remove pass initialization calls from pass constructors (#173061) 2026-01-21 08:44:51 -08:00
WinEHPrepare.cpp [CodeGen] Drop uses of BranchInst (#186391) 2026-03-13 21:51:38 +00:00
XRayInstrumentation.cpp [LoopInfo] Build dominator tree only for irreducible CFG (#212098) 2026-07-27 09:56:51 -07:00

//===---------------------------------------------------------------------===//

Common register allocation / spilling problem:

        mul lr, r4, lr
        str lr, [sp, #+52]
        ldr lr, [r1, #+32]
        sxth r3, r3
        ldr r4, [sp, #+52]
        mla r4, r3, lr, r4

can be:

        mul lr, r4, lr
        mov r4, lr
        str lr, [sp, #+52]
        ldr lr, [r1, #+32]
        sxth r3, r3
        mla r4, r3, lr, r4

and then "merge" mul and mov:

        mul r4, r4, lr
        str r4, [sp, #+52]
        ldr lr, [r1, #+32]
        sxth r3, r3
        mla r4, r3, lr, r4

It also increase the likelihood the store may become dead.

//===---------------------------------------------------------------------===//

bb27 ...
        ...
        %reg1037 = ADDri %reg1039, 1
        %reg1038 = ADDrs %reg1032, %reg1039, %noreg, 10
    Successors according to CFG: 0x8b03bf0 (#5)

bb76 (0x8b03bf0, LLVM BB @0x8b032d0, ID#5):
    Predecessors according to CFG: 0x8b0c5f0 (#3) 0x8b0a7c0 (#4)
        %reg1039 = PHI %reg1070, mbb<bb76.outer,0x8b0c5f0>, %reg1037, mbb<bb27,0x8b0a7c0>

Note ADDri is not a two-address instruction. However, its result %reg1037 is an
operand of the PHI node in bb76 and its operand %reg1039 is the result of the
PHI node. We should treat it as a two-address code and make sure the ADDri is
scheduled after any node that reads %reg1039.

//===---------------------------------------------------------------------===//

Use local info (i.e. register scavenger) to assign it a free register to allow
reuse:
        ldr r3, [sp, #+4]
        add r3, r3, #3
        ldr r2, [sp, #+8]
        add r2, r2, #2
        ldr r1, [sp, #+4]  <==
        add r1, r1, #1
        ldr r0, [sp, #+4]
        add r0, r0, #2

//===---------------------------------------------------------------------===//

LLVM aggressively lift CSE out of loop. Sometimes this can be negative side-
effects:

R1 = X + 4
R2 = X + 7
R3 = X + 15

loop:
load [i + R1]
...
load [i + R2]
...
load [i + R3]

Suppose there is high register pressure, R1, R2, R3, can be spilled. We need
to implement proper re-materialization to handle this:

R1 = X + 4
R2 = X + 7
R3 = X + 15

loop:
R1 = X + 4  @ re-materialized
load [i + R1]
...
R2 = X + 7 @ re-materialized
load [i + R2]
...
R3 = X + 15 @ re-materialized
load [i + R3]

Furthermore, with re-association, we can enable sharing:

R1 = X + 4
R2 = X + 7
R3 = X + 15

loop:
T = i + X
load [T + 4]
...
load [T + 7]
...
load [T + 15]
//===---------------------------------------------------------------------===//

It's not always a good idea to choose rematerialization over spilling. If all
the load / store instructions would be folded then spilling is cheaper because
it won't require new live intervals / registers. See 2003-05-31-LongShifts for
an example.

//===---------------------------------------------------------------------===//

With a copying garbage collector, derived pointers must not be retained across
collector safe points; the collector could move the objects and invalidate the
derived pointer. This is bad enough in the first place, but safe points can
crop up unpredictably. Consider:

        %array = load { i32, [0 x %obj] }** %array_addr
        %nth_el = getelementptr { i32, [0 x %obj] }* %array, i32 0, i32 %n
        %old = load %obj** %nth_el
        %z = div i64 %x, %y
        store %obj* %new, %obj** %nth_el

If the i64 division is lowered to a libcall, then a safe point will (must)
appear for the call site. If a collection occurs, %array and %nth_el no longer
point into the correct object.

The fix for this is to copy address calculations so that dependent pointers
are never live across safe point boundaries. But the loads cannot be copied
like this if there was an intervening store, so may be hard to get right.

Only a concurrent mutator can trigger a collection at the libcall safe point.
So single-threaded programs do not have this requirement, even with a copying
collector. Still, LLVM optimizations would probably undo a front-end's careful
work.

//===---------------------------------------------------------------------===//

The ocaml frametable structure supports liveness information. It would be good
to support it.

//===---------------------------------------------------------------------===//

The FIXME in ComputeCommonTailLength in BranchFolding.cpp needs to be
revisited. The check is there to work around a misuse of directives in inline
assembly.

//===---------------------------------------------------------------------===//

It would be good to detect collector/target compatibility instead of silently
doing the wrong thing.

//===---------------------------------------------------------------------===//

It would be really nice to be able to write patterns in .td files for copies,
which would eliminate a bunch of explicit predicates on them (e.g. no side
effects).  Once this is in place, it would be even better to have tblgen
synthesize the various copy insertion/inspection methods in TargetInstrInfo.

//===---------------------------------------------------------------------===//

Stack coloring improvements:

1. Do proper LiveStacks analysis on all stack objects including those which are
   not spill slots.
2. Reorder objects to fill in gaps between objects.
   e.g. 4, 1, <gap>, 4, 1, 1, 1, <gap>, 4 => 4, 1, 1, 1, 1, 4, 4

//===---------------------------------------------------------------------===//

The scheduler should be able to sort nearby instructions by their address. For
example, in an expanded memset sequence it's not uncommon to see code like this:

  movl $0, 4(%rdi)
  movl $0, 8(%rdi)
  movl $0, 12(%rdi)
  movl $0, 0(%rdi)

Each of the stores is independent, and the scheduler is currently making an
arbitrary decision about the order.

//===---------------------------------------------------------------------===//

Another opportunitiy in this code is that the $0 could be moved to a register:

  movl $0, 4(%rdi)
  movl $0, 8(%rdi)
  movl $0, 12(%rdi)
  movl $0, 0(%rdi)

This would save substantial code size, especially for longer sequences like
this. It would be easy to have a rule telling isel to avoid matching MOV32mi
if the immediate has more than some fixed number of uses. It's more involved
to teach the register allocator how to do late folding to recover from
excessive register pressure.