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

..--

AsmPrinter/22-Nov-2023-18,50211,993

GlobalISel/22-Nov-2023-2,0321,371

MIRParser/22-Nov-2023-3,8323,180

SelectionDAG/22-Nov-2023-69,47249,249

AggressiveAntiDepBreaker.cppD22-Nov-202336.3 KiB999673

AggressiveAntiDepBreaker.hD22-Nov-20236.7 KiB18083

AllocationOrder.cppD22-Nov-20231.9 KiB5533

AllocationOrder.hD22-Nov-20232.8 KiB9045

Analysis.cppD22-Nov-202329.3 KiB732448

Android.bpD22-Nov-2023140 108

AntiDepBreaker.hD22-Nov-20232.5 KiB6832

AtomicExpandPass.cppD22-Nov-202364.3 KiB1,6411,081

BasicTargetTransformInfo.cppD22-Nov-20231.6 KiB3916

BranchFolding.cppD22-Nov-202371 KiB1,9201,274

BranchFolding.hD22-Nov-20235.6 KiB161129

BuiltinGCs.cppD22-Nov-20235.1 KiB14069

CMakeLists.txtD22-Nov-20233.5 KiB155150

CalcSpillWeights.cppD22-Nov-20237.8 KiB237162

CallingConvLower.cppD22-Nov-202310.3 KiB288221

CodeGen.cppD22-Nov-20233.8 KiB9677

CodeGenPrepare.cppD22-Nov-2023209.5 KiB5,6573,379

CriticalAntiDepBreaker.cppD22-Nov-202327 KiB682382

CriticalAntiDepBreaker.hD22-Nov-20234.1 KiB10754

DFAPacketizer.cppD22-Nov-202311.3 KiB326198

DeadMachineInstructionElim.cppD22-Nov-20236.4 KiB182112

DetectDeadLanes.cppD22-Nov-202320.8 KiB603443

DwarfEHPrepare.cppD22-Nov-20238.6 KiB265185

EarlyIfConversion.cppD22-Nov-202328.6 KiB818520

EdgeBundles.cppD22-Nov-20233 KiB9866

ExecutionDepsFix.cppD22-Nov-202326.3 KiB812532

ExpandISelPseudos.cppD22-Nov-20232.5 KiB7546

ExpandPostRAPseudos.cppD22-Nov-20237.1 KiB228158

FaultMaps.cppD22-Nov-20234.7 KiB151102

FuncletLayout.cppD22-Nov-20232 KiB6038

GCMetadata.cppD22-Nov-20235.2 KiB178122

GCMetadataPrinter.cppD22-Nov-2023649 204

GCRootLowering.cppD22-Nov-202312.1 KiB356233

GCStrategy.cppD22-Nov-2023807 236

GlobalMerge.cppD22-Nov-202322.1 KiB606345

IfConversion.cppD22-Nov-202367.6 KiB1,8451,228

ImplicitNullChecks.cppD22-Nov-202319.5 KiB577316

InlineSpiller.cppD22-Nov-202353.6 KiB1,457985

InterferenceCache.cppD22-Nov-20238.4 KiB251189

InterferenceCache.hD22-Nov-20237 KiB239121

InterleavedAccessPass.cppD22-Nov-202312.8 KiB387213

IntrinsicLowering.cppD22-Nov-202322 KiB609516

LLVMBuild.txtD22-Nov-2023864 2623

LLVMTargetMachine.cppD22-Nov-202311.1 KiB312206

LatencyPriorityQueue.cppD22-Nov-20235.2 KiB14178

LexicalScopes.cppD22-Nov-202311.3 KiB333240

LiveDebugValues.cppD22-Nov-202318.5 KiB517348

LiveDebugVariables.cppD22-Nov-202335.8 KiB1,048751

LiveDebugVariables.hD22-Nov-20232.5 KiB7628

LiveInterval.cppD22-Nov-202339.6 KiB1,251823

LiveIntervalAnalysis.cppD22-Nov-202358.2 KiB1,5761,105

LiveIntervalUnion.cppD22-Nov-20236.5 KiB206130

LivePhysRegs.cppD22-Nov-20236.1 KiB190132

LiveRangeCalc.cppD22-Nov-202316.7 KiB485319

LiveRangeCalc.hD22-Nov-202310.1 KiB24961

LiveRangeEdit.cppD22-Nov-202315.7 KiB450323

LiveRangeUtils.hD22-Nov-20232.1 KiB6336

LiveRegMatrix.cppD22-Nov-20236.6 KiB198143

LiveStackAnalysis.cppD22-Nov-20233 KiB8959

LiveVariables.cppD22-Nov-202329.1 KiB811544

LocalStackSlotAllocation.cppD22-Nov-202316.5 KiB421267

LowerEmuTLS.cppD22-Nov-20235.7 KiB163113

MIRPrinter.cppD22-Nov-202332.5 KiB1,006887

MIRPrinter.hD22-Nov-20231 KiB3410

MIRPrintingPass.cppD22-Nov-20232 KiB7241

MachineBasicBlock.cppD22-Nov-202345 KiB1,290905

MachineBlockFrequencyInfo.cppD22-Nov-20236.9 KiB201151

MachineBlockPlacement.cppD22-Nov-202372.1 KiB1,7761,034

MachineBranchProbabilityInfo.cppD22-Nov-20233.2 KiB9463

MachineCSE.cppD22-Nov-202325.2 KiB717508

MachineCombiner.cppD22-Nov-202319.1 KiB478312

MachineCopyPropagation.cppD22-Nov-202312.5 KiB372233

MachineDominanceFrontier.cppD22-Nov-20231.7 KiB5534

MachineDominators.cppD22-Nov-20234.9 KiB15895

MachineFunction.cppD22-Nov-202336.4 KiB1,008720

MachineFunctionAnalysis.cppD22-Nov-20231.9 KiB6139

MachineFunctionPass.cppD22-Nov-20233.3 KiB9059

MachineFunctionPrinterPass.cppD22-Nov-20232.2 KiB7039

MachineInstr.cppD22-Nov-202375.7 KiB2,2061,656

MachineInstrBundle.cppD22-Nov-202310.8 KiB345263

MachineLICM.cppD22-Nov-202348.1 KiB1,389904

MachineLoopInfo.cppD22-Nov-20232.9 KiB8559

MachineModuleInfo.cppD22-Nov-202316 KiB464303

MachineModuleInfoImpls.cppD22-Nov-20231.5 KiB4519

MachinePassRegistry.cppD22-Nov-20231.7 KiB5630

MachinePipeliner.cppD22-Nov-2023147.8 KiB3,9442,906

MachinePostDominators.cppD22-Nov-20231.7 KiB5630

MachineRegionInfo.cppD22-Nov-20234.1 KiB14188

MachineRegisterInfo.cppD22-Nov-202318 KiB530377

MachineSSAUpdater.cppD22-Nov-202312.8 KiB356226

MachineScheduler.cppD22-Nov-2023128.2 KiB3,5542,467

MachineSink.cppD22-Nov-202331 KiB858503

MachineTraceMetrics.cppD22-Nov-202348.9 KiB1,329950

MachineVerifier.cppD22-Nov-202373.1 KiB2,0501,619

OptimizePHIs.cppD22-Nov-20236.3 KiB197132

PHIElimination.cppD22-Nov-202325.6 KiB653415

PHIEliminationUtils.cppD22-Nov-20232.2 KiB6032

PHIEliminationUtils.hD22-Nov-2023944 269

ParallelCG.cppD22-Nov-20233.7 KiB10065

PatchableFunction.cppD22-Nov-20233 KiB8960

PeepholeOptimizer.cppD22-Nov-202373.8 KiB1,9481,092

PostRAHazardRecognizer.cppD22-Nov-20233.4 KiB9950

PostRASchedulerList.cppD22-Nov-202324.2 KiB706449

PreISelIntrinsicLowering.cppD22-Nov-20232.6 KiB9565

ProcessImplicitDefs.cppD22-Nov-20235.4 KiB169119

PrologEpilogInserter.cppD22-Nov-202346.8 KiB1,235765

PseudoSourceValue.cppD22-Nov-20234.3 KiB140100

README.txtD22-Nov-20236.2 KiB200149

RegAllocBase.cppD22-Nov-20235.8 KiB162109

RegAllocBase.hD22-Nov-20234.5 KiB12341

RegAllocBasic.cppD22-Nov-202310.3 KiB299188

RegAllocFast.cppD22-Nov-202341.5 KiB1,123807

RegAllocGreedy.cppD22-Nov-202397 KiB2,6201,639

RegAllocPBQP.cppD22-Nov-202331.4 KiB894603

RegUsageInfoCollector.cppD22-Nov-20234.9 KiB14389

RegUsageInfoPropagate.cppD22-Nov-20234.3 KiB13288

RegisterClassInfo.cppD22-Nov-20236.3 KiB182119

RegisterCoalescer.cppD22-Nov-2023115.2 KiB3,0591,905

RegisterCoalescer.hD22-Nov-20234.2 KiB11740

RegisterPressure.cppD22-Nov-202347.6 KiB1,3511,029

RegisterScavenging.cppD22-Nov-202314.5 KiB459326

RegisterUsageInfo.cppD22-Nov-20232.9 KiB9358

RenameIndependentSubregs.cppD22-Nov-202314 KiB389270

SafeStack.cppD22-Nov-202332.4 KiB852585

SafeStackColoring.cppD22-Nov-20239 KiB292221

SafeStackColoring.hD22-Nov-20234.6 KiB15088

SafeStackLayout.cppD22-Nov-20234.7 KiB140105

SafeStackLayout.hD22-Nov-20232.1 KiB6937

ScheduleDAG.cppD22-Nov-202319.9 KiB642485

ScheduleDAGInstrs.cppD22-Nov-202361.3 KiB1,7121,136

ScheduleDAGPrinter.cppD22-Nov-20233.2 KiB10167

ScoreboardHazardRecognizer.cppD22-Nov-20237.8 KiB241159

ShadowStackGCLowering.cppD22-Nov-202317.2 KiB469287

ShrinkWrap.cppD22-Nov-202320.2 KiB557337

SjLjEHPrepare.cppD22-Nov-202318.1 KiB481322

SlotIndexes.cppD22-Nov-20237.9 KiB246160

SpillPlacement.cppD22-Nov-202312.4 KiB376226

SpillPlacement.hD22-Nov-20236.6 KiB17164

Spiller.hD22-Nov-20231.2 KiB4320

SplitKit.cppD22-Nov-202353.9 KiB1,5261,032

SplitKit.hD22-Nov-202320.4 KiB504173

StackColoring.cppD22-Nov-202340.9 KiB1,127630

StackMapLivenessAnalysis.cppD22-Nov-20236.2 KiB173101

StackMaps.cppD22-Nov-202318.8 KiB553377

StackProtector.cppD22-Nov-202317.7 KiB472287

StackSlotColoring.cppD22-Nov-202315.3 KiB470333

TailDuplication.cppD22-Nov-20231.9 KiB6636

TailDuplicator.cppD22-Nov-202333.5 KiB933643

TargetFrameLoweringImpl.cppD22-Nov-20234 KiB10557

TargetInstrInfo.cppD22-Nov-202344.2 KiB1,196844

TargetLoweringBase.cppD22-Nov-202372.7 KiB1,8431,431

TargetLoweringObjectFileImpl.cppD22-Nov-202337.4 KiB1,099809

TargetOptionsImpl.cppD22-Nov-20232 KiB5021

TargetPassConfig.cppD22-Nov-202333.6 KiB889511

TargetRegisterInfo.cppD22-Nov-202314.6 KiB400279

TargetSchedule.cppD22-Nov-202311.3 KiB301207

TwoAddressInstructionPass.cppD22-Nov-202364.3 KiB1,8071,214

UnreachableBlockElim.cppD22-Nov-20237.3 KiB221153

VirtRegMap.cppD22-Nov-202316.6 KiB468330

WinEHPrepare.cppD22-Nov-202349.1 KiB1,236864

XRayInstrumentation.cppD22-Nov-20233.5 KiB9761

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 LiveStackAnalysis 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