• Home
Name Date Size #Lines LOC

..--

AsmPrinter/03-May-2024-21,61214,330

GlobalISel/03-May-2024-7,4445,602

MIRParser/03-May-2024-4,8064,009

SelectionDAG/03-May-2024-78,65455,803

AggressiveAntiDepBreaker.cppD03-May-202437 KiB1,015689

AggressiveAntiDepBreaker.hD03-May-20246.8 KiB18587

AllocationOrder.cppD03-May-20241.9 KiB5634

AllocationOrder.hD03-May-20242.9 KiB9749

Analysis.cppD03-May-202429.3 KiB724440

AntiDepBreaker.hD03-May-20243.4 KiB8948

AtomicExpandPass.cppD03-May-202464.2 KiB1,6451,085

BasicTargetTransformInfo.cppD03-May-20241.5 KiB3613

BranchFolding.cppD03-May-202480.5 KiB2,1331,408

BranchFolding.hD03-May-20248.2 KiB228141

BranchRelaxation.cppD03-May-202419.6 KiB579336

BreakFalseDeps.cppD03-May-20249 KiB272162

BuiltinGCs.cppD03-May-20245.2 KiB14571

CFIInstrInserter.cppD03-May-202412.8 KiB327223

CMakeLists.txtD03-May-20244 KiB179174

CalcSpillWeights.cppD03-May-202411 KiB327219

CallingConvLower.cppD03-May-202410.6 KiB305235

CodeGen.cppD03-May-20244.7 KiB11697

CodeGenPrepare.cppD03-May-2024258.4 KiB6,9304,189

CriticalAntiDepBreaker.cppD03-May-202427.4 KiB695395

CriticalAntiDepBreaker.hD03-May-20244.2 KiB11458

DFAPacketizer.cppD03-May-202413.4 KiB378251

DeadMachineInstructionElim.cppD03-May-20246.1 KiB174109

DetectDeadLanes.cppD03-May-202420.9 KiB600440

DwarfEHPrepare.cppD03-May-20248.6 KiB269189

EarlyIfConversion.cppD03-May-202428.9 KiB819521

EdgeBundles.cppD03-May-20243.1 KiB10369

ExecutionDomainFix.cppD03-May-202414.7 KiB474346

ExpandISelPseudos.cppD03-May-20242.5 KiB7546

ExpandMemCmp.cppD03-May-202431.1 KiB825514

ExpandPostRAPseudos.cppD03-May-20247.2 KiB226156

ExpandReductions.cppD03-May-20245.8 KiB171142

FEntryInserter.cppD03-May-20241.7 KiB5434

FaultMaps.cppD03-May-20245 KiB156110

FuncletLayout.cppD03-May-20242.1 KiB6338

GCMetadata.cppD03-May-20245.2 KiB184125

GCMetadataPrinter.cppD03-May-2024720 235

GCRootLowering.cppD03-May-202412.1 KiB355232

GCStrategy.cppD03-May-2024680 224

GlobalMerge.cppD03-May-202424.2 KiB680392

IfConversion.cppD03-May-202483.7 KiB2,2281,488

ImplicitNullChecks.cppD03-May-202424.7 KiB724409

IndirectBrExpandPass.cppD03-May-20247.9 KiB222124

InlineSpiller.cppD03-May-202456 KiB1,5071,015

InterferenceCache.cppD03-May-20248.8 KiB263201

InterferenceCache.hD03-May-20247.2 KiB248128

InterleavedAccessPass.cppD03-May-202416.1 KiB468261

IntrinsicLowering.cppD03-May-202422.1 KiB613523

LLVMBuild.txtD03-May-2024848 2623

LLVMTargetMachine.cppD03-May-202410.1 KiB267189

LatencyPriorityQueue.cppD03-May-20245.6 KiB15490

LazyMachineBlockFrequencyInfo.cppD03-May-20243.3 KiB9864

LexicalScopes.cppD03-May-202411.4 KiB339244

LiveDebugValues.cppD03-May-202431.4 KiB824559

LiveDebugVariables.cppD03-May-202445.2 KiB1,280874

LiveDebugVariables.hD03-May-20242.5 KiB7327

LiveInterval.cppD03-May-202444.4 KiB1,371920

LiveIntervalUnion.cppD03-May-20246.3 KiB204129

LiveIntervals.cppD03-May-202462.2 KiB1,6601,170

LivePhysRegs.cppD03-May-202410.9 KiB332236

LiveRangeCalc.cppD03-May-202421.4 KiB608424

LiveRangeCalc.hD03-May-202412.8 KiB29979

LiveRangeEdit.cppD03-May-202416.9 KiB476336

LiveRangeShrink.cppD03-May-20248.7 KiB247164

LiveRangeUtils.hD03-May-20242.1 KiB6336

LiveRegMatrix.cppD03-May-20247.4 KiB224165

LiveRegUnits.cppD03-May-20245.1 KiB147104

LiveStacks.cppD03-May-20242.9 KiB8959

LiveVariables.cppD03-May-202429.1 KiB811544

LocalStackSlotAllocation.cppD03-May-202416.6 KiB431265

LoopTraversal.cppD03-May-20242.9 KiB7853

LowLevelType.cppD03-May-20241.4 KiB3921

LowerEmuTLS.cppD03-May-20245.7 KiB165113

MIRCanonicalizerPass.cppD03-May-202423.8 KiB805579

MIRPrinter.cppD03-May-202427.6 KiB801685

MIRPrintingPass.cppD03-May-20241.9 KiB7240

MachineBasicBlock.cppD03-May-202450.7 KiB1,4701,049

MachineBlockFrequencyInfo.cppD03-May-20249.6 KiB266198

MachineBlockPlacement.cppD03-May-2024118.8 KiB2,9151,638

MachineBranchProbabilityInfo.cppD03-May-20243.2 KiB9362

MachineCSE.cppD03-May-202425.6 KiB738520

MachineCombiner.cppD03-May-202427.2 KiB660447

MachineCopyPropagation.cppD03-May-202420 KiB604353

MachineDominanceFrontier.cppD03-May-20241.8 KiB5535

MachineDominators.cppD03-May-20245 KiB15494

MachineFrameInfo.cppD03-May-20249.5 KiB253184

MachineFunction.cppD03-May-202438.5 KiB1,095815

MachineFunctionPass.cppD03-May-20243.2 KiB9058

MachineFunctionPrinterPass.cppD03-May-20242.2 KiB7039

MachineInstr.cppD03-May-202466.5 KiB1,8791,390

MachineInstrBundle.cppD03-May-202410.8 KiB347265

MachineLICM.cppD03-May-202453.5 KiB1,529998

MachineLoopInfo.cppD03-May-20244.7 KiB147106

MachineModuleInfo.cppD03-May-202410.9 KiB349236

MachineModuleInfoImpls.cppD03-May-20241.4 KiB4317

MachineOperand.cppD03-May-202438.6 KiB1,154973

MachineOptimizationRemarkEmitter.cppD03-May-20243.2 KiB10066

MachineOutliner.cppD03-May-202453.4 KiB1,428640

MachinePassRegistry.cppD03-May-20241.7 KiB5630

MachinePipeliner.cppD03-May-2024157.4 KiB4,2153,111

MachinePostDominators.cppD03-May-20241.7 KiB5933

MachineRegionInfo.cppD03-May-20244.7 KiB15090

MachineRegisterInfo.cppD03-May-202423.1 KiB669483

MachineSSAUpdater.cppD03-May-202413 KiB363228

MachineScheduler.cppD03-May-2024131 KiB3,6442,541

MachineSink.cppD03-May-202443.1 KiB1,193734

MachineTraceMetrics.cppD03-May-202449.6 KiB1,354969

MachineVerifier.cppD03-May-202485 KiB2,3441,859

MacroFusion.cppD03-May-20246.7 KiB193122

OptimizePHIs.cppD03-May-20246.4 KiB206135

PHIElimination.cppD03-May-202426.1 KiB668429

PHIEliminationUtils.cppD03-May-20242.2 KiB6132

PHIEliminationUtils.hD03-May-2024944 269

ParallelCG.cppD03-May-20243.7 KiB10065

PatchableFunction.cppD03-May-20243 KiB9061

PeepholeOptimizer.cppD03-May-202477.9 KiB2,1121,188

PostRAHazardRecognizer.cppD03-May-20243.4 KiB9950

PostRASchedulerList.cppD03-May-202424.3 KiB708451

PreISelIntrinsicLowering.cppD03-May-20242.7 KiB9765

ProcessImplicitDefs.cppD03-May-20245.4 KiB167117

PrologEpilogInserter.cppD03-May-202443.4 KiB1,141726

PseudoSourceValue.cppD03-May-20244.7 KiB154114

README.txtD03-May-20246.2 KiB200149

ReachingDefAnalysis.cppD03-May-20246.8 KiB196136

RegAllocBase.cppD03-May-20246.1 KiB170114

RegAllocBase.hD03-May-20244.6 KiB12644

RegAllocBasic.cppD03-May-202411.3 KiB335212

RegAllocFast.cppD03-May-202440.7 KiB1,123798

RegAllocGreedy.cppD03-May-2024121.6 KiB3,2151,986

RegAllocPBQP.cppD03-May-202433.1 KiB944658

RegUsageInfoCollector.cppD03-May-20246.7 KiB194122

RegUsageInfoPropagate.cppD03-May-20244.9 KiB154105

RegisterClassInfo.cppD03-May-20246.5 KiB193127

RegisterCoalescer.cppD03-May-2024134.6 KiB3,5542,149

RegisterCoalescer.hD03-May-20244 KiB11436

RegisterPressure.cppD03-May-202448.5 KiB1,3741,052

RegisterScavenging.cppD03-May-202427.4 KiB810590

RegisterUsageInfo.cppD03-May-20243.2 KiB10370

RenameIndependentSubregs.cppD03-May-202414.7 KiB406278

ResetMachineFunctionPass.cppD03-May-20243.3 KiB8956

SafeStack.cppD03-May-202433.6 KiB904624

SafeStackColoring.cppD03-May-20249.6 KiB311240

SafeStackColoring.hD03-May-20244.7 KiB16793

SafeStackLayout.cppD03-May-20245.3 KiB155118

SafeStackLayout.hD03-May-20242.4 KiB8543

ScalarizeMaskedMemIntrin.cppD03-May-202423.2 KiB667383

ScheduleDAG.cppD03-May-202420.2 KiB717576

ScheduleDAGInstrs.cppD03-May-202450.9 KiB1,438971

ScheduleDAGPrinter.cppD03-May-20243.2 KiB9965

ScoreboardHazardRecognizer.cppD03-May-20247.9 KiB244165

ShadowStackGCLowering.cppD03-May-202414 KiB372226

ShrinkWrap.cppD03-May-202422.5 KiB611367

SjLjEHPrepare.cppD03-May-202418.5 KiB491325

SlotIndexes.cppD03-May-20249.4 KiB288191

SpillPlacement.cppD03-May-202412.5 KiB384233

SpillPlacement.hD03-May-20246.6 KiB17164

Spiller.hD03-May-20241.2 KiB4519

SplitKit.cppD03-May-202465.8 KiB1,8571,297

SplitKit.hD03-May-202423.1 KiB549192

StackColoring.cppD03-May-202448.2 KiB1,302680

StackMapLivenessAnalysis.cppD03-May-20246.1 KiB172100

StackMaps.cppD03-May-202419.8 KiB583403

StackProtector.cppD03-May-202420.2 KiB535344

StackSlotColoring.cppD03-May-202417.2 KiB533376

TailDuplication.cppD03-May-20242.5 KiB8654

TailDuplicator.cppD03-May-202436.7 KiB1,014693

TargetFrameLoweringImpl.cppD03-May-20245.3 KiB13576

TargetInstrInfo.cppD03-May-202445.5 KiB1,232872

TargetLoweringBase.cppD03-May-202468.8 KiB1,8581,349

TargetLoweringObjectFileImpl.cppD03-May-202456.4 KiB1,5891,185

TargetOptionsImpl.cppD03-May-20241.6 KiB4218

TargetPassConfig.cppD03-May-202443.9 KiB1,169709

TargetRegisterInfo.cppD03-May-202418.2 KiB513376

TargetSchedule.cppD03-May-202413.1 KiB361260

TargetSubtargetInfo.cppD03-May-20243.7 KiB11782

TwoAddressInstructionPass.cppD03-May-202466.7 KiB1,8691,257

UnreachableBlockElim.cppD03-May-20248.2 KiB236166

ValueTypes.cppD03-May-202413.1 KiB322279

VirtRegMap.cppD03-May-202421.5 KiB595417

WasmEHPrepare.cppD03-May-202414.5 KiB375178

WinEHPrepare.cppD03-May-202449.9 KiB1,247870

XRayInstrumentation.cppD03-May-20249 KiB250169

README.txt

1//===---------------------------------------------------------------------===//
2
3Common register allocation / spilling problem:
4
5        mul lr, r4, lr
6        str lr, [sp, #+52]
7        ldr lr, [r1, #+32]
8        sxth r3, r3
9        ldr r4, [sp, #+52]
10        mla r4, r3, lr, r4
11
12can be:
13
14        mul lr, r4, lr
15        mov r4, lr
16        str lr, [sp, #+52]
17        ldr lr, [r1, #+32]
18        sxth r3, r3
19        mla r4, r3, lr, r4
20
21and then "merge" mul and mov:
22
23        mul r4, r4, lr
24        str r4, [sp, #+52]
25        ldr lr, [r1, #+32]
26        sxth r3, r3
27        mla r4, r3, lr, r4
28
29It also increase the likelihood the store may become dead.
30
31//===---------------------------------------------------------------------===//
32
33bb27 ...
34        ...
35        %reg1037 = ADDri %reg1039, 1
36        %reg1038 = ADDrs %reg1032, %reg1039, %noreg, 10
37    Successors according to CFG: 0x8b03bf0 (#5)
38
39bb76 (0x8b03bf0, LLVM BB @0x8b032d0, ID#5):
40    Predecessors according to CFG: 0x8b0c5f0 (#3) 0x8b0a7c0 (#4)
41        %reg1039 = PHI %reg1070, mbb<bb76.outer,0x8b0c5f0>, %reg1037, mbb<bb27,0x8b0a7c0>
42
43Note ADDri is not a two-address instruction. However, its result %reg1037 is an
44operand of the PHI node in bb76 and its operand %reg1039 is the result of the
45PHI node. We should treat it as a two-address code and make sure the ADDri is
46scheduled after any node that reads %reg1039.
47
48//===---------------------------------------------------------------------===//
49
50Use local info (i.e. register scavenger) to assign it a free register to allow
51reuse:
52        ldr r3, [sp, #+4]
53        add r3, r3, #3
54        ldr r2, [sp, #+8]
55        add r2, r2, #2
56        ldr r1, [sp, #+4]  <==
57        add r1, r1, #1
58        ldr r0, [sp, #+4]
59        add r0, r0, #2
60
61//===---------------------------------------------------------------------===//
62
63LLVM aggressively lift CSE out of loop. Sometimes this can be negative side-
64effects:
65
66R1 = X + 4
67R2 = X + 7
68R3 = X + 15
69
70loop:
71load [i + R1]
72...
73load [i + R2]
74...
75load [i + R3]
76
77Suppose there is high register pressure, R1, R2, R3, can be spilled. We need
78to implement proper re-materialization to handle this:
79
80R1 = X + 4
81R2 = X + 7
82R3 = X + 15
83
84loop:
85R1 = X + 4  @ re-materialized
86load [i + R1]
87...
88R2 = X + 7 @ re-materialized
89load [i + R2]
90...
91R3 = X + 15 @ re-materialized
92load [i + R3]
93
94Furthermore, with re-association, we can enable sharing:
95
96R1 = X + 4
97R2 = X + 7
98R3 = X + 15
99
100loop:
101T = i + X
102load [T + 4]
103...
104load [T + 7]
105...
106load [T + 15]
107//===---------------------------------------------------------------------===//
108
109It's not always a good idea to choose rematerialization over spilling. If all
110the load / store instructions would be folded then spilling is cheaper because
111it won't require new live intervals / registers. See 2003-05-31-LongShifts for
112an example.
113
114//===---------------------------------------------------------------------===//
115
116With a copying garbage collector, derived pointers must not be retained across
117collector safe points; the collector could move the objects and invalidate the
118derived pointer. This is bad enough in the first place, but safe points can
119crop up unpredictably. Consider:
120
121        %array = load { i32, [0 x %obj] }** %array_addr
122        %nth_el = getelementptr { i32, [0 x %obj] }* %array, i32 0, i32 %n
123        %old = load %obj** %nth_el
124        %z = div i64 %x, %y
125        store %obj* %new, %obj** %nth_el
126
127If the i64 division is lowered to a libcall, then a safe point will (must)
128appear for the call site. If a collection occurs, %array and %nth_el no longer
129point into the correct object.
130
131The fix for this is to copy address calculations so that dependent pointers
132are never live across safe point boundaries. But the loads cannot be copied
133like this if there was an intervening store, so may be hard to get right.
134
135Only a concurrent mutator can trigger a collection at the libcall safe point.
136So single-threaded programs do not have this requirement, even with a copying
137collector. Still, LLVM optimizations would probably undo a front-end's careful
138work.
139
140//===---------------------------------------------------------------------===//
141
142The ocaml frametable structure supports liveness information. It would be good
143to support it.
144
145//===---------------------------------------------------------------------===//
146
147The FIXME in ComputeCommonTailLength in BranchFolding.cpp needs to be
148revisited. The check is there to work around a misuse of directives in inline
149assembly.
150
151//===---------------------------------------------------------------------===//
152
153It would be good to detect collector/target compatibility instead of silently
154doing the wrong thing.
155
156//===---------------------------------------------------------------------===//
157
158It would be really nice to be able to write patterns in .td files for copies,
159which would eliminate a bunch of explicit predicates on them (e.g. no side
160effects).  Once this is in place, it would be even better to have tblgen
161synthesize the various copy insertion/inspection methods in TargetInstrInfo.
162
163//===---------------------------------------------------------------------===//
164
165Stack coloring improvements:
166
1671. Do proper LiveStacks analysis on all stack objects including those which are
168   not spill slots.
1692. Reorder objects to fill in gaps between objects.
170   e.g. 4, 1, <gap>, 4, 1, 1, 1, <gap>, 4 => 4, 1, 1, 1, 1, 4, 4
171
172//===---------------------------------------------------------------------===//
173
174The scheduler should be able to sort nearby instructions by their address. For
175example, in an expanded memset sequence it's not uncommon to see code like this:
176
177  movl $0, 4(%rdi)
178  movl $0, 8(%rdi)
179  movl $0, 12(%rdi)
180  movl $0, 0(%rdi)
181
182Each of the stores is independent, and the scheduler is currently making an
183arbitrary decision about the order.
184
185//===---------------------------------------------------------------------===//
186
187Another opportunitiy in this code is that the $0 could be moved to a register:
188
189  movl $0, 4(%rdi)
190  movl $0, 8(%rdi)
191  movl $0, 12(%rdi)
192  movl $0, 0(%rdi)
193
194This would save substantial code size, especially for longer sequences like
195this. It would be easy to have a rule telling isel to avoid matching MOV32mi
196if the immediate has more than some fixed number of uses. It's more involved
197to teach the register allocator how to do late folding to recover from
198excessive register pressure.
199
200