Name Last Update
..
AsmPrinter Loading commit data...
GlobalISel Loading commit data...
LiveDebugValues Loading commit data...
MIRParser Loading commit data...
SelectionDAG Loading commit data...
AggressiveAntiDepBreaker.cpp Loading commit data...
AggressiveAntiDepBreaker.h Loading commit data...
AllocationOrder.cpp Loading commit data...
AllocationOrder.h Loading commit data...
Analysis.cpp Loading commit data...
AtomicExpandPass.cpp Loading commit data...
BasicBlockSections.cpp Loading commit data...
BasicTargetTransformInfo.cpp Loading commit data...
BranchFolding.cpp Loading commit data...
BranchFolding.h Loading commit data...
BranchRelaxation.cpp Loading commit data...
BreakFalseDeps.cpp Loading commit data...
BuiltinGCs.cpp Loading commit data...
CFGuardLongjmp.cpp Loading commit data...
CFIInstrInserter.cpp Loading commit data...
CMakeLists.txt Loading commit data...
CalcSpillWeights.cpp Loading commit data...
CallingConvLower.cpp Loading commit data...
CodeGen.cpp Loading commit data...
CodeGenPrepare.cpp Loading commit data...
CommandFlags.cpp Loading commit data...
CriticalAntiDepBreaker.cpp Loading commit data...
CriticalAntiDepBreaker.h Loading commit data...
DFAPacketizer.cpp Loading commit data...
DeadMachineInstructionElim.cpp Loading commit data...
DetectDeadLanes.cpp Loading commit data...
DwarfEHPrepare.cpp Loading commit data...
EarlyIfConversion.cpp Loading commit data...
EdgeBundles.cpp Loading commit data...
ExecutionDomainFix.cpp Loading commit data...
ExpandMemCmp.cpp Loading commit data...
ExpandPostRAPseudos.cpp Loading commit data...
ExpandReductions.cpp Loading commit data...
FEntryInserter.cpp Loading commit data...
FaultMaps.cpp Loading commit data...
FinalizeISel.cpp Loading commit data...
FixupStatepointCallerSaved.cpp Loading commit data...
FuncletLayout.cpp Loading commit data...
GCMetadata.cpp Loading commit data...
GCMetadataPrinter.cpp Loading commit data...
GCRootLowering.cpp Loading commit data...
GCStrategy.cpp Loading commit data...
GlobalMerge.cpp Loading commit data...
HardwareLoops.cpp Loading commit data...
IfConversion.cpp Loading commit data...
ImplicitNullChecks.cpp Loading commit data...
IndirectBrExpandPass.cpp Loading commit data...
InlineSpiller.cpp Loading commit data...
InterferenceCache.cpp Loading commit data...
InterferenceCache.h Loading commit data...
InterleavedAccessPass.cpp Loading commit data...
InterleavedLoadCombinePass.cpp Loading commit data...
IntrinsicLowering.cpp Loading commit data...
LLVMBuild.txt Loading commit data...
LLVMTargetMachine.cpp Loading commit data...
LatencyPriorityQueue.cpp Loading commit data...
LazyMachineBlockFrequencyInfo.cpp Loading commit data...
LexicalScopes.cpp Loading commit data...
LiveDebugVariables.cpp Loading commit data...
LiveDebugVariables.h Loading commit data...
LiveInterval.cpp Loading commit data...
LiveIntervalCalc.cpp Loading commit data...
LiveIntervalUnion.cpp Loading commit data...
LiveIntervals.cpp Loading commit data...
LivePhysRegs.cpp Loading commit data...
LiveRangeCalc.cpp Loading commit data...
LiveRangeEdit.cpp Loading commit data...
LiveRangeShrink.cpp Loading commit data...
LiveRangeUtils.h Loading commit data...
LiveRegMatrix.cpp Loading commit data...
LiveRegUnits.cpp Loading commit data...
LiveStacks.cpp Loading commit data...
LiveVariables.cpp Loading commit data...
LocalStackSlotAllocation.cpp Loading commit data...
LoopTraversal.cpp Loading commit data...
LowLevelType.cpp Loading commit data...
LowerEmuTLS.cpp Loading commit data...
MBFIWrapper.cpp Loading commit data...
MIRCanonicalizerPass.cpp Loading commit data...
MIRNamerPass.cpp Loading commit data...
MIRPrinter.cpp Loading commit data...
MIRPrintingPass.cpp Loading commit data...
MIRVRegNamerUtils.cpp Loading commit data...
MIRVRegNamerUtils.h Loading commit data...
MachineBasicBlock.cpp Loading commit data...
MachineBlockFrequencyInfo.cpp Loading commit data...
MachineBlockPlacement.cpp Loading commit data...
MachineBranchProbabilityInfo.cpp Loading commit data...
MachineCSE.cpp Loading commit data...
MachineCombiner.cpp Loading commit data...
MachineCopyPropagation.cpp Loading commit data...
MachineDebugify.cpp Loading commit data...
MachineDominanceFrontier.cpp Loading commit data...
MachineDominators.cpp Loading commit data...
MachineFrameInfo.cpp Loading commit data...
MachineFunction.cpp Loading commit data...
MachineFunctionPass.cpp Loading commit data...
MachineFunctionPrinterPass.cpp Loading commit data...
MachineFunctionSplitter.cpp Loading commit data...
MachineInstr.cpp Loading commit data...
MachineInstrBundle.cpp Loading commit data...
MachineLICM.cpp Loading commit data...
MachineLoopInfo.cpp Loading commit data...
MachineLoopUtils.cpp Loading commit data...
MachineModuleInfo.cpp Loading commit data...
MachineModuleInfoImpls.cpp Loading commit data...
MachineOperand.cpp Loading commit data...
MachineOptimizationRemarkEmitter.cpp Loading commit data...
MachineOutliner.cpp Loading commit data...
MachinePassManager.cpp Loading commit data...
MachinePipeliner.cpp Loading commit data...
MachinePostDominators.cpp Loading commit data...
MachineRegionInfo.cpp Loading commit data...
MachineRegisterInfo.cpp Loading commit data...
MachineSSAUpdater.cpp Loading commit data...
MachineScheduler.cpp Loading commit data...
MachineSink.cpp Loading commit data...
MachineSizeOpts.cpp Loading commit data...
MachineStableHash.cpp Loading commit data...
MachineStripDebug.cpp Loading commit data...
MachineTraceMetrics.cpp Loading commit data...
MachineVerifier.cpp Loading commit data...
MacroFusion.cpp Loading commit data...
ModuloSchedule.cpp Loading commit data...
NonRelocatableStringpool.cpp Loading commit data...
OptimizePHIs.cpp Loading commit data...
PHIElimination.cpp Loading commit data...
PHIEliminationUtils.cpp Loading commit data...
PHIEliminationUtils.h Loading commit data...
ParallelCG.cpp Loading commit data...
PatchableFunction.cpp Loading commit data...
PeepholeOptimizer.cpp Loading commit data...
PostRAHazardRecognizer.cpp Loading commit data...
PostRASchedulerList.cpp Loading commit data...
PreISelIntrinsicLowering.cpp Loading commit data...
ProcessImplicitDefs.cpp Loading commit data...
PrologEpilogInserter.cpp Loading commit data...
PseudoSourceValue.cpp Loading commit data...
RDFGraph.cpp Loading commit data...
RDFLiveness.cpp Loading commit data...
RDFRegisters.cpp Loading commit data...
README.txt Loading commit data...
ReachingDefAnalysis.cpp Loading commit data...
RegAllocBase.cpp Loading commit data...
RegAllocBase.h Loading commit data...
RegAllocBasic.cpp Loading commit data...
RegAllocFast.cpp Loading commit data...
RegAllocGreedy.cpp Loading commit data...
RegAllocPBQP.cpp Loading commit data...
RegUsageInfoCollector.cpp Loading commit data...
RegUsageInfoPropagate.cpp Loading commit data...
RegisterClassInfo.cpp Loading commit data...
RegisterCoalescer.cpp Loading commit data...
RegisterCoalescer.h Loading commit data...
RegisterPressure.cpp Loading commit data...
RegisterScavenging.cpp Loading commit data...
RegisterUsageInfo.cpp Loading commit data...
RenameIndependentSubregs.cpp Loading commit data...
ResetMachineFunctionPass.cpp Loading commit data...
SafeStack.cpp Loading commit data...
SafeStackLayout.cpp Loading commit data...
SafeStackLayout.h Loading commit data...
ScalarizeMaskedMemIntrin.cpp Loading commit data...
ScheduleDAG.cpp Loading commit data...
ScheduleDAGInstrs.cpp Loading commit data...
ScheduleDAGPrinter.cpp Loading commit data...
ScoreboardHazardRecognizer.cpp Loading commit data...
ShadowStackGCLowering.cpp Loading commit data...
ShrinkWrap.cpp Loading commit data...
SjLjEHPrepare.cpp Loading commit data...
SlotIndexes.cpp Loading commit data...
SpillPlacement.cpp Loading commit data...
SpillPlacement.h Loading commit data...
SplitKit.cpp Loading commit data...
SplitKit.h Loading commit data...
StackColoring.cpp Loading commit data...
StackMapLivenessAnalysis.cpp Loading commit data...
StackMaps.cpp Loading commit data...
StackProtector.cpp Loading commit data...
StackSlotColoring.cpp Loading commit data...
SwiftErrorValueTracking.cpp Loading commit data...
SwitchLoweringUtils.cpp Loading commit data...
TailDuplication.cpp Loading commit data...
TailDuplicator.cpp Loading commit data...
TargetFrameLoweringImpl.cpp Loading commit data...
TargetInstrInfo.cpp Loading commit data...
TargetLoweringBase.cpp Loading commit data...
TargetLoweringObjectFileImpl.cpp Loading commit data...
TargetOptionsImpl.cpp Loading commit data...
TargetPassConfig.cpp Loading commit data...
TargetRegisterInfo.cpp Loading commit data...
TargetSchedule.cpp Loading commit data...
TargetSubtargetInfo.cpp Loading commit data...
TwoAddressInstructionPass.cpp Loading commit data...
TypePromotion.cpp Loading commit data...
UnreachableBlockElim.cpp Loading commit data...
ValueTypes.cpp Loading commit data...
VirtRegMap.cpp Loading commit data...
WasmEHPrepare.cpp Loading commit data...
WinEHPrepare.cpp Loading commit data...
XRayInstrumentation.cpp Loading commit data...
//===---------------------------------------------------------------------===//

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.