• Home
Name
Date
Size
#Lines
LOC

..--

AsmPrinter/03-May-2024-10,3526,640

SelectionDAG/03-May-2024-52,37237,740

AggressiveAntiDepBreaker.cppD03-May-202434.6 KiB966672

AggressiveAntiDepBreaker.hD03-May-20247 KiB18580

AllocationOrder.cppD03-May-20242.8 KiB8044

AllocationOrder.hD03-May-20242.1 KiB7335

Analysis.cppD03-May-202411.9 KiB309208

Android.mkD03-May-20243.1 KiB130116

AntiDepBreaker.hD03-May-20242.6 KiB7232

BranchFolding.cppD03-May-202463.9 KiB1,7261,165

BranchFolding.hD03-May-20244.1 KiB12499

CMakeLists.txtD03-May-20242.4 KiB108106

CalcSpillWeights.cppD03-May-20246 KiB188131

CallingConvLower.cppD03-May-20246.5 KiB183135

CodeGen.cppD03-May-20242.9 KiB7455

CodePlacementOpt.cppD03-May-202415.5 KiB423246

CriticalAntiDepBreaker.cppD03-May-202426.2 KiB682406

CriticalAntiDepBreaker.hD03-May-20244.1 KiB11054

DFAPacketizer.cppD03-May-20248.6 KiB245138

DeadMachineInstructionElim.cppD03-May-20247.5 KiB207138

DwarfEHPrepare.cppD03-May-20246.1 KiB184123

EdgeBundles.cppD03-May-20243.1 KiB9866

ExecutionDepsFix.cppD03-May-202423.2 KiB722472

ExpandISelPseudos.cppD03-May-20242.5 KiB7547

ExpandPostRAPseudos.cppD03-May-20247.7 KiB234166

GCMetadata.cppD03-May-20245.6 KiB214146

GCMetadataPrinter.cppD03-May-2024824 288

GCStrategy.cppD03-May-202413.9 KiB423279

IfConversion.cppD03-May-202456 KiB1,5771,132

InlineSpiller.cppD03-May-202445.7 KiB1,294867

InterferenceCache.cppD03-May-20246.3 KiB197149

InterferenceCache.hD03-May-20246.1 KiB211106

IntrinsicLowering.cppD03-May-202420.9 KiB566477

JITCodeEmitter.cppD03-May-2024440 153

LLVMBuild.txtD03-May-2024795 2623

LLVMTargetMachine.cppD03-May-202411.5 KiB300194

LatencyPriorityQueue.cppD03-May-20245.5 KiB15390

LexicalScopes.cppD03-May-202410.8 KiB338244

LiveDebugVariables.cppD03-May-202434.4 KiB1,011714

LiveDebugVariables.hD03-May-20242.3 KiB7124

LiveInterval.cppD03-May-202424.3 KiB755498

LiveIntervalAnalysis.cppD03-May-202455.5 KiB1,5451,108

LiveIntervalUnion.cppD03-May-20246.7 KiB212131

LiveIntervalUnion.hD03-May-20246.6 KiB191103

LiveRangeCalc.cppD03-May-20249.5 KiB271167

LiveRangeCalc.hD03-May-20249.6 KiB22763

LiveRangeEdit.cppD03-May-202410.8 KiB325247

LiveStackAnalysis.cppD03-May-20242.7 KiB8455

LiveVariables.cppD03-May-202430.4 KiB825559

LocalStackSlotAllocation.cppD03-May-202413.9 KiB356218

MachineBasicBlock.cppD03-May-202432.3 KiB942642

MachineBlockFrequencyInfo.cppD03-May-20242.3 KiB6234

MachineBlockPlacement.cppD03-May-202444.8 KiB1,121717

MachineBranchProbabilityInfo.cppD03-May-20243.9 KiB11980

MachineCSE.cppD03-May-202420.4 KiB605459

MachineCodeEmitter.cppD03-May-2024449 153

MachineCopyPropagation.cppD03-May-202411.3 KiB341234

MachineDominators.cppD03-May-20241.7 KiB6033

MachineFunction.cppD03-May-202426.4 KiB756535

MachineFunctionAnalysis.cppD03-May-20241.8 KiB5836

MachineFunctionPass.cppD03-May-20242 KiB5730

MachineFunctionPrinterPass.cppD03-May-20241.7 KiB6131

MachineInstr.cppD03-May-202465.4 KiB1,9141,412

MachineInstrBundle.cppD03-May-20249 KiB279207

MachineLICM.cppD03-May-202453.3 KiB1,490960

MachineLoopInfo.cppD03-May-20242.8 KiB8459

MachineLoopRanges.cppD03-May-20244 KiB11778

MachineModuleInfo.cppD03-May-202420.5 KiB577359

MachineModuleInfoImpls.cppD03-May-20241.6 KiB4619

MachinePassRegistry.cppD03-May-20241.7 KiB5630

MachineRegisterInfo.cppD03-May-20249.9 KiB283190

MachineSSAUpdater.cppD03-May-202413.3 KiB372239

MachineScheduler.cppD03-May-202421 KiB615394

MachineSink.cppD03-May-202424.6 KiB702425

MachineVerifier.cppD03-May-202447.4 KiB1,3611,074

MakefileD03-May-2024719 238

OcamlGC.cppD03-May-2024999 3816

OptimizePHIs.cppD03-May-20246.2 KiB194131

PHIElimination.cppD03-May-202417.4 KiB441262

PHIEliminationUtils.cppD03-May-20242.3 KiB6234

PHIEliminationUtils.hD03-May-2024936 269

Passes.cppD03-May-202423.8 KiB630342

PeepholeOptimizer.cppD03-May-202415.2 KiB466301

PostRASchedulerList.cppD03-May-202427.2 KiB795512

ProcessImplicitDefs.cppD03-May-202410.3 KiB306239

PrologEpilogInserter.cppD03-May-202431.9 KiB864525

PrologEpilogInserter.hD03-May-20246.1 KiB17484

PseudoSourceValue.cppD03-May-20244 KiB13393

README.txtD03-May-20246.2 KiB200149

RegAllocBase.cppD03-May-202410.3 KiB281207

RegAllocBase.hD03-May-20246.4 KiB18269

RegAllocBasic.cppD03-May-202413 KiB358211

RegAllocFast.cppD03-May-202442.3 KiB1,159838

RegAllocGreedy.cppD03-May-202460.8 KiB1,7091,080

RegAllocPBQP.cppD03-May-202425.1 KiB757525

RegisterClassInfo.cppD03-May-20244.3 KiB12672

RegisterClassInfo.hD03-May-20244.3 KiB13359

RegisterCoalescer.cppD03-May-202472.2 KiB1,9761,319

RegisterCoalescer.hD03-May-20243.9 KiB10735

RegisterScavenging.cppD03-May-202412.7 KiB398273

RenderMachineFunction.cppD03-May-202433.6 KiB1,014804

RenderMachineFunction.hD03-May-202411.3 KiB339190

ScheduleDAG.cppD03-May-202417.7 KiB579431

ScheduleDAGInstrs.cppD03-May-202432.6 KiB831542

ScheduleDAGPrinter.cppD03-May-20243.1 KiB9865

ScoreboardHazardRecognizer.cppD03-May-20247.4 KiB239160

ShadowStackGC.cppD03-May-202417.1 KiB453265

ShrinkWrapping.cppD03-May-202439.5 KiB1,154801

SjLjEHPrepare.cppD03-May-202420.9 KiB526357

SlotIndexes.cppD03-May-20245.5 KiB180109

SpillPlacement.cppD03-May-202412.5 KiB370224

SpillPlacement.hD03-May-20246.1 KiB15756

Spiller.cppD03-May-20246.1 KiB195137

Spiller.hD03-May-20241.3 KiB4821

SplitKit.cppD03-May-202450 KiB1,430971

SplitKit.hD03-May-202419.1 KiB470149

StackProtector.cppD03-May-20248.8 KiB256133

StackSlotColoring.cppD03-May-202414.5 KiB443311

StrongPHIElimination.cppD03-May-202432 KiB827496

TailDuplication.cppD03-May-202433.7 KiB943674

TargetFrameLoweringImpl.cppD03-May-20241.7 KiB4621

TargetInstrInfoImpl.cppD03-May-202419.8 KiB540378

TargetLoweringObjectFileImpl.cppD03-May-202425.5 KiB717495

TargetOptionsImpl.cppD03-May-20242.1 KiB5320

TwoAddressInstructionPass.cppD03-May-202471.4 KiB1,9431,360

UnreachableBlockElim.cppD03-May-20247.3 KiB216149

VirtRegMap.cppD03-May-20248.5 KiB238166

VirtRegMap.hD03-May-20246.9 KiB198106

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 lr, [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