• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

AsmPrinter/23-Nov-2023-23,94016,098

GlobalISel/23-Nov-2023-15,69711,985

MIRParser/23-Nov-2023-5,1904,418

SelectionDAG/23-Nov-2023-87,54862,665

AggressiveAntiDepBreaker.cppD23-Nov-202337.1 KiB1,014690

AggressiveAntiDepBreaker.hD23-Nov-20236.8 KiB18487

AllocationOrder.cppD23-Nov-20232 KiB5534

AllocationOrder.hD23-Nov-20232.9 KiB9649

Analysis.cppD23-Nov-202332.7 KiB810501

AntiDepBreaker.hD23-Nov-20233.4 KiB8848

AtomicExpandPass.cppD23-Nov-202370.8 KiB1,8101,214

BasicTargetTransformInfo.cppD23-Nov-20231.5 KiB3513

BranchFolding.cppD23-Nov-202379.4 KiB2,0831,383

BranchFolding.hD23-Nov-20238.4 KiB231145

BranchRelaxation.cppD23-Nov-202319.7 KiB577335

BreakFalseDeps.cppD23-Nov-20239.6 KiB282168

BuiltinGCs.cppD23-Nov-20234.9 KiB13158

CFGuardLongjmp.cppD23-Nov-20233.7 KiB12166

CFIInstrInserter.cppD23-Nov-202313.1 KiB331226

CMakeLists.txtD23-Nov-20234.3 KiB190185

CalcSpillWeights.cppD23-Nov-202310.2 KiB305209

CallingConvLower.cppD23-Nov-202310.5 KiB294225

CodeGen.cppD23-Nov-20235 KiB122104

CodeGenPrepare.cppD23-Nov-2023279 KiB7,5024,562

CriticalAntiDepBreaker.cppD23-Nov-202327.8 KiB705404

CriticalAntiDepBreaker.hD23-Nov-20234.2 KiB11358

DFAPacketizer.cppD23-Nov-202310.9 KiB319216

DeadMachineInstructionElim.cppD23-Nov-20236.5 KiB185119

DetectDeadLanes.cppD23-Nov-202320.7 KiB599440

DwarfEHPrepare.cppD23-Nov-20238.7 KiB269190

EarlyIfConversion.cppD23-Nov-202337.5 KiB1,065697

EdgeBundles.cppD23-Nov-20233.2 KiB10370

ExecutionDomainFix.cppD23-Nov-202314.7 KiB473346

ExpandMemCmp.cppD23-Nov-202334.5 KiB890570

ExpandPostRAPseudos.cppD23-Nov-20237.3 KiB228159

ExpandReductions.cppD23-Nov-20237.2 KiB202170

FEntryInserter.cppD23-Nov-20231.8 KiB5435

FaultMaps.cppD23-Nov-20235 KiB153109

FinalizeISel.cppD23-Nov-20232.7 KiB7848

FuncletLayout.cppD23-Nov-20232.2 KiB6339

GCMetadata.cppD23-Nov-20235.1 KiB174117

GCMetadataPrinter.cppD23-Nov-2023748 225

GCRootLowering.cppD23-Nov-202311.6 KiB334212

GCStrategy.cppD23-Nov-2023708 214

GlobalMerge.cppD23-Nov-202324.5 KiB685396

HardwareLoops.cppD23-Nov-202318.4 KiB525372

IfConversion.cppD23-Nov-202389.5 KiB2,3681,595

ImplicitNullChecks.cppD23-Nov-202325 KiB728414

IndirectBrExpandPass.cppD23-Nov-20237.8 KiB220125

InlineSpiller.cppD23-Nov-202357.8 KiB1,5381,028

InterferenceCache.cppD23-Nov-20238.8 KiB262201

InterferenceCache.hD23-Nov-20237.2 KiB247128

InterleavedAccessPass.cppD23-Nov-202316.5 KiB474267

InterleavedLoadCombinePass.cppD23-Nov-202342.2 KiB1,361712

IntrinsicLowering.cppD23-Nov-202317 KiB474399

LLVMBuild.txtD23-Nov-2023877 2522

LLVMTargetMachine.cppD23-Nov-202310.3 KiB271191

LatencyPriorityQueue.cppD23-Nov-20235.6 KiB15390

LazyMachineBlockFrequencyInfo.cppD23-Nov-20233.4 KiB9865

LexicalScopes.cppD23-Nov-202311.5 KiB339245

LiveDebugValues.cppD23-Nov-202363.9 KiB1,6441,085

LiveDebugVariables.cppD23-Nov-202351.5 KiB1,456975

LiveDebugVariables.hD23-Nov-20232.2 KiB6526

LiveInterval.cppD23-Nov-202346.7 KiB1,427964

LiveIntervalUnion.cppD23-Nov-20236.4 KiB203129

LiveIntervals.cppD23-Nov-202363.1 KiB1,6851,184

LivePhysRegs.cppD23-Nov-202310.7 KiB327231

LiveRangeCalc.cppD23-Nov-202321.5 KiB607424

LiveRangeEdit.cppD23-Nov-202317 KiB477338

LiveRangeShrink.cppD23-Nov-20238.7 KiB247165

LiveRangeUtils.hD23-Nov-20232.1 KiB6236

LiveRegMatrix.cppD23-Nov-20237.5 KiB224166

LiveRegUnits.cppD23-Nov-20234.7 KiB14195

LiveStacks.cppD23-Nov-20233 KiB8960

LiveVariables.cppD23-Nov-202329 KiB809543

LocalStackSlotAllocation.cppD23-Nov-202317.3 KiB447271

LoopTraversal.cppD23-Nov-20232.9 KiB7753

LowLevelType.cppD23-Nov-20231.9 KiB6137

LowerEmuTLS.cppD23-Nov-20235.8 KiB164113

MIRCanonicalizerPass.cppD23-Nov-202312.5 KiB437310

MIRNamerPass.cppD23-Nov-20232.2 KiB8044

MIRPrinter.cppD23-Nov-202331.5 KiB908778

MIRPrintingPass.cppD23-Nov-20232 KiB7141

MIRVRegNamerUtils.cppD23-Nov-20236 KiB157112

MIRVRegNamerUtils.hD23-Nov-20233.4 KiB9439

MachineBasicBlock.cppD23-Nov-202351.3 KiB1,5061,068

MachineBlockFrequencyInfo.cppD23-Nov-20239.9 KiB273205

MachineBlockPlacement.cppD23-Nov-2023130.2 KiB3,2301,832

MachineBranchProbabilityInfo.cppD23-Nov-20233.5 KiB10069

MachineCSE.cppD23-Nov-202331.7 KiB898636

MachineCombiner.cppD23-Nov-202327.9 KiB676463

MachineCopyPropagation.cppD23-Nov-202329.2 KiB881548

MachineDominanceFrontier.cppD23-Nov-20231.8 KiB5536

MachineDominators.cppD23-Nov-20234.9 KiB15191

MachineFrameInfo.cppD23-Nov-20239.9 KiB259189

MachineFunction.cppD23-Nov-202340.2 KiB1,153848

MachineFunctionPass.cppD23-Nov-20234.8 KiB12585

MachineFunctionPrinterPass.cppD23-Nov-20232.3 KiB7242

MachineInstr.cppD23-Nov-202376.1 KiB2,1961,642

MachineInstrBundle.cppD23-Nov-202311.5 KiB362278

MachineLICM.cppD23-Nov-202356.3 KiB1,5921,044

MachineLoopInfo.cppD23-Nov-20235 KiB154113

MachineLoopUtils.cppD23-Nov-20235.2 KiB145113

MachineModuleInfo.cppD23-Nov-202312.1 KiB379265

MachineModuleInfoImpls.cppD23-Nov-20231.5 KiB4318

MachineOperand.cppD23-Nov-202339.5 KiB1,177994

MachineOptimizationRemarkEmitter.cppD23-Nov-20233.3 KiB10067

MachineOutliner.cppD23-Nov-202357.2 KiB1,487694

MachinePipeliner.cppD23-Nov-2023107.2 KiB3,0272,324

MachinePostDominators.cppD23-Nov-20232.4 KiB8048

MachineRegionInfo.cppD23-Nov-20234.8 KiB15091

MachineRegisterInfo.cppD23-Nov-202322.9 KiB674498

MachineSSAUpdater.cppD23-Nov-202313 KiB362228

MachineScheduler.cppD23-Nov-2023135.3 KiB3,7612,630

MachineSink.cppD23-Nov-202351.6 KiB1,401852

MachineSizeOpts.cppD23-Nov-20234.7 KiB12393

MachineTraceMetrics.cppD23-Nov-202349.6 KiB1,353969

MachineVerifier.cppD23-Nov-2023103.8 KiB2,8662,273

MacroFusion.cppD23-Nov-20237.6 KiB215136

ModuloSchedule.cppD23-Nov-202384.4 KiB2,1841,630

NonRelocatableStringpool.cppD23-Nov-20231.7 KiB5538

OptimizePHIs.cppD23-Nov-20236.7 KiB211138

PHIElimination.cppD23-Nov-202326.3 KiB670434

PHIEliminationUtils.cppD23-Nov-20232.2 KiB6032

PHIEliminationUtils.hD23-Nov-2023972 259

ParallelCG.cppD23-Nov-20233.7 KiB9965

PatchableFunction.cppD23-Nov-20233.6 KiB10475

PeepholeOptimizer.cppD23-Nov-202378.1 KiB2,1161,190

PostRAHazardRecognizer.cppD23-Nov-20233.5 KiB9951

PostRASchedulerList.cppD23-Nov-202324.3 KiB704448

PreISelIntrinsicLowering.cppD23-Nov-20237.9 KiB241186

ProcessImplicitDefs.cppD23-Nov-20235.4 KiB167118

PrologEpilogInserter.cppD23-Nov-202350.3 KiB1,306832

PseudoSourceValue.cppD23-Nov-20234.7 KiB153114

README.txtD23-Nov-20236.2 KiB200149

ReachingDefAnalysis.cppD23-Nov-202310.8 KiB333243

RegAllocBase.cppD23-Nov-20236.3 KiB173118

RegAllocBase.hD23-Nov-20234.6 KiB12544

RegAllocBasic.cppD23-Nov-202311.3 KiB334212

RegAllocFast.cppD23-Nov-202345.8 KiB1,330953

RegAllocGreedy.cppD23-Nov-2023124.1 KiB3,2742,030

RegAllocPBQP.cppD23-Nov-202333.1 KiB943658

RegUsageInfoCollector.cppD23-Nov-20237.4 KiB217135

RegUsageInfoPropagate.cppD23-Nov-20235.1 KiB157109

RegisterClassInfo.cppD23-Nov-20236.6 KiB195130

RegisterCoalescer.cppD23-Nov-2023150.1 KiB3,9362,390

RegisterCoalescer.hD23-Nov-20234 KiB11336

RegisterPressure.cppD23-Nov-202348.9 KiB1,3941,068

RegisterScavenging.cppD23-Nov-202327.5 KiB818596

RegisterUsageInfo.cppD23-Nov-20233.2 KiB10270

RenameIndependentSubregs.cppD23-Nov-202314.8 KiB406279

ResetMachineFunctionPass.cppD23-Nov-20233.5 KiB9159

SafeStack.cppD23-Nov-202333.6 KiB904624

SafeStackColoring.cppD23-Nov-20239.6 KiB311240

SafeStackColoring.hD23-Nov-20234.7 KiB16693

SafeStackLayout.cppD23-Nov-20235.3 KiB154118

SafeStackLayout.hD23-Nov-20232.4 KiB8443

ScalarizeMaskedMemIntrin.cppD23-Nov-202331 KiB900542

ScheduleDAG.cppD23-Nov-202321 KiB744593

ScheduleDAGInstrs.cppD23-Nov-202354.5 KiB1,5261,030

ScheduleDAGPrinter.cppD23-Nov-20233.2 KiB9865

ScoreboardHazardRecognizer.cppD23-Nov-20237.9 KiB242164

ShadowStackGCLowering.cppD23-Nov-202314.2 KiB374229

ShrinkWrap.cppD23-Nov-202323 KiB619369

SjLjEHPrepare.cppD23-Nov-202318.7 KiB496331

SlotIndexes.cppD23-Nov-20239.3 KiB283187

SpillPlacement.cppD23-Nov-202312.6 KiB384234

SpillPlacement.hD23-Nov-20236.7 KiB17064

Spiller.hD23-Nov-20231.2 KiB4419

SplitKit.cppD23-Nov-202365.9 KiB1,8571,298

SplitKit.hD23-Nov-202323.7 KiB565205

StackColoring.cppD23-Nov-202348.8 KiB1,322696

StackMapLivenessAnalysis.cppD23-Nov-20236.2 KiB172101

StackMaps.cppD23-Nov-202319.8 KiB581402

StackProtector.cppD23-Nov-202321.5 KiB572366

StackSlotColoring.cppD23-Nov-202317.1 KiB533377

SwiftErrorValueTracking.cppD23-Nov-202311.4 KiB314215

SwitchLoweringUtils.cppD23-Nov-202318.3 KiB492346

TailDuplication.cppD23-Nov-20233.2 KiB9967

TailDuplicator.cppD23-Nov-202336.8 KiB1,015697

TargetFrameLoweringImpl.cppD23-Nov-20235.9 KiB15795

TargetInstrInfo.cppD23-Nov-202347.9 KiB1,294913

TargetLoweringBase.cppD23-Nov-202376.1 KiB2,0081,472

TargetLoweringObjectFileImpl.cppD23-Nov-202371 KiB1,9541,459

TargetOptionsImpl.cppD23-Nov-20231.8 KiB4826

TargetPassConfig.cppD23-Nov-202346.4 KiB1,241767

TargetRegisterInfo.cppD23-Nov-202318.6 KiB524385

TargetSchedule.cppD23-Nov-202313.2 KiB360260

TargetSubtargetInfo.cppD23-Nov-20231.9 KiB6640

TwoAddressInstructionPass.cppD23-Nov-202367.1 KiB1,8751,260

TypePromotion.cppD23-Nov-202332.4 KiB1,018640

UnreachableBlockElim.cppD23-Nov-20237.6 KiB213151

ValueTypes.cppD23-Nov-202316.8 KiB367325

VirtRegMap.cppD23-Nov-202321.4 KiB593416

WasmEHPrepare.cppD23-Nov-202314.1 KiB375205

WinEHPrepare.cppD23-Nov-202350.1 KiB1,250874

XRayInstrumentation.cppD23-Nov-20239.1 KiB252172

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