vvvv ee2b7fbda0 llvm16 targets 9 months ago
..
AsmPrinter ee2b7fbda0 llvm16 targets 9 months ago
GlobalISel ee2b7fbda0 llvm16 targets 9 months ago
LiveDebugValues ee2b7fbda0 llvm16 targets 9 months ago
MIRParser ee2b7fbda0 llvm16 targets 9 months ago
SelectionDAG ee2b7fbda0 llvm16 targets 9 months ago
AggressiveAntiDepBreaker.cpp ee2b7fbda0 llvm16 targets 9 months ago
AggressiveAntiDepBreaker.h ee2b7fbda0 llvm16 targets 9 months ago
AllocationOrder.cpp ee2b7fbda0 llvm16 targets 9 months ago
AllocationOrder.h ee2b7fbda0 llvm16 targets 9 months ago
Analysis.cpp ee2b7fbda0 llvm16 targets 9 months ago
AssignmentTrackingAnalysis.cpp ee2b7fbda0 llvm16 targets 9 months ago
AtomicExpandPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
BasicBlockSections.cpp ee2b7fbda0 llvm16 targets 9 months ago
BasicBlockSectionsProfileReader.cpp ee2b7fbda0 llvm16 targets 9 months ago
BasicTargetTransformInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
BranchFolding.cpp ee2b7fbda0 llvm16 targets 9 months ago
BranchFolding.h ee2b7fbda0 llvm16 targets 9 months ago
BranchRelaxation.cpp ee2b7fbda0 llvm16 targets 9 months ago
BreakFalseDeps.cpp ee2b7fbda0 llvm16 targets 9 months ago
CFGuardLongjmp.cpp ee2b7fbda0 llvm16 targets 9 months ago
CFIFixup.cpp ee2b7fbda0 llvm16 targets 9 months ago
CFIInstrInserter.cpp ee2b7fbda0 llvm16 targets 9 months ago
CalcSpillWeights.cpp ee2b7fbda0 llvm16 targets 9 months ago
CallingConvLower.cpp ee2b7fbda0 llvm16 targets 9 months ago
CodeGen.cpp ee2b7fbda0 llvm16 targets 9 months ago
CodeGenCommonISel.cpp ee2b7fbda0 llvm16 targets 9 months ago
CodeGenPassBuilder.cpp ee2b7fbda0 llvm16 targets 9 months ago
CodeGenPrepare.cpp ee2b7fbda0 llvm16 targets 9 months ago
CommandFlags.cpp ee2b7fbda0 llvm16 targets 9 months ago
ComplexDeinterleavingPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
CriticalAntiDepBreaker.cpp ee2b7fbda0 llvm16 targets 9 months ago
CriticalAntiDepBreaker.h ee2b7fbda0 llvm16 targets 9 months ago
DFAPacketizer.cpp ee2b7fbda0 llvm16 targets 9 months ago
DeadMachineInstructionElim.cpp ee2b7fbda0 llvm16 targets 9 months ago
DetectDeadLanes.cpp ee2b7fbda0 llvm16 targets 9 months ago
DwarfEHPrepare.cpp ee2b7fbda0 llvm16 targets 9 months ago
EHContGuardCatchret.cpp ee2b7fbda0 llvm16 targets 9 months ago
EarlyIfConversion.cpp ee2b7fbda0 llvm16 targets 9 months ago
EdgeBundles.cpp ee2b7fbda0 llvm16 targets 9 months ago
ExecutionDomainFix.cpp ee2b7fbda0 llvm16 targets 9 months ago
ExpandLargeDivRem.cpp ee2b7fbda0 llvm16 targets 9 months ago
ExpandLargeFpConvert.cpp ee2b7fbda0 llvm16 targets 9 months ago
ExpandMemCmp.cpp ee2b7fbda0 llvm16 targets 9 months ago
ExpandPostRAPseudos.cpp ee2b7fbda0 llvm16 targets 9 months ago
ExpandReductions.cpp ee2b7fbda0 llvm16 targets 9 months ago
ExpandVectorPredication.cpp ee2b7fbda0 llvm16 targets 9 months ago
FEntryInserter.cpp ee2b7fbda0 llvm16 targets 9 months ago
FaultMaps.cpp ee2b7fbda0 llvm16 targets 9 months ago
FinalizeISel.cpp ee2b7fbda0 llvm16 targets 9 months ago
FixupStatepointCallerSaved.cpp ee2b7fbda0 llvm16 targets 9 months ago
FuncletLayout.cpp ee2b7fbda0 llvm16 targets 9 months ago
GCMetadata.cpp ee2b7fbda0 llvm16 targets 9 months ago
GCMetadataPrinter.cpp ee2b7fbda0 llvm16 targets 9 months ago
GCRootLowering.cpp ee2b7fbda0 llvm16 targets 9 months ago
GlobalMerge.cpp ee2b7fbda0 llvm16 targets 9 months ago
HardwareLoops.cpp ee2b7fbda0 llvm16 targets 9 months ago
IfConversion.cpp ee2b7fbda0 llvm16 targets 9 months ago
ImplicitNullChecks.cpp ee2b7fbda0 llvm16 targets 9 months ago
IndirectBrExpandPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
InlineSpiller.cpp ee2b7fbda0 llvm16 targets 9 months ago
InterferenceCache.cpp ee2b7fbda0 llvm16 targets 9 months ago
InterferenceCache.h ee2b7fbda0 llvm16 targets 9 months ago
InterleavedAccessPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
InterleavedLoadCombinePass.cpp ee2b7fbda0 llvm16 targets 9 months ago
IntrinsicLowering.cpp ee2b7fbda0 llvm16 targets 9 months ago
JMCInstrumenter.cpp ee2b7fbda0 llvm16 targets 9 months ago
LLVMTargetMachine.cpp ee2b7fbda0 llvm16 targets 9 months ago
LatencyPriorityQueue.cpp ee2b7fbda0 llvm16 targets 9 months ago
LazyMachineBlockFrequencyInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
LexicalScopes.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveDebugVariables.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveDebugVariables.h ee2b7fbda0 llvm16 targets 9 months ago
LiveInterval.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveIntervalCalc.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveIntervalUnion.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveIntervals.cpp ee2b7fbda0 llvm16 targets 9 months ago
LivePhysRegs.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveRangeCalc.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveRangeEdit.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveRangeShrink.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveRangeUtils.h ee2b7fbda0 llvm16 targets 9 months ago
LiveRegMatrix.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveRegUnits.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveStacks.cpp ee2b7fbda0 llvm16 targets 9 months ago
LiveVariables.cpp ee2b7fbda0 llvm16 targets 9 months ago
LocalStackSlotAllocation.cpp ee2b7fbda0 llvm16 targets 9 months ago
LoopTraversal.cpp ee2b7fbda0 llvm16 targets 9 months ago
LowLevelType.cpp ee2b7fbda0 llvm16 targets 9 months ago
LowerEmuTLS.cpp ee2b7fbda0 llvm16 targets 9 months ago
MBFIWrapper.cpp ee2b7fbda0 llvm16 targets 9 months ago
MIRCanonicalizerPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
MIRFSDiscriminator.cpp ee2b7fbda0 llvm16 targets 9 months ago
MIRNamerPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
MIRPrinter.cpp ee2b7fbda0 llvm16 targets 9 months ago
MIRPrintingPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
MIRSampleProfile.cpp ee2b7fbda0 llvm16 targets 9 months ago
MIRVRegNamerUtils.cpp ee2b7fbda0 llvm16 targets 9 months ago
MIRVRegNamerUtils.h ee2b7fbda0 llvm16 targets 9 months ago
MIRYamlMapping.cpp ee2b7fbda0 llvm16 targets 9 months ago
MLRegallocEvictAdvisor.cpp ee2b7fbda0 llvm16 targets 9 months ago
MLRegallocEvictAdvisor.h ee2b7fbda0 llvm16 targets 9 months ago
MLRegallocPriorityAdvisor.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineBasicBlock.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineBlockFrequencyInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineBlockPlacement.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineBranchProbabilityInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineCFGPrinter.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineCSE.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineCheckDebugify.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineCombiner.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineCopyPropagation.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineCycleAnalysis.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineDebugify.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineDominanceFrontier.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineDominators.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineFrameInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineFunction.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineFunctionPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineFunctionPrinterPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineFunctionSplitter.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineInstr.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineInstrBundle.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineLICM.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineLateInstrsCleanup.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineLoopInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineLoopUtils.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineModuleInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineModuleInfoImpls.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineModuleSlotTracker.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineOperand.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineOptimizationRemarkEmitter.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineOutliner.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachinePassManager.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachinePipeliner.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachinePostDominators.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineRegionInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineRegisterInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineSSAContext.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineSSAUpdater.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineScheduler.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineSink.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineSizeOpts.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineStableHash.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineStripDebug.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineTraceMetrics.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineUniformityAnalysis.cpp ee2b7fbda0 llvm16 targets 9 months ago
MachineVerifier.cpp ee2b7fbda0 llvm16 targets 9 months ago
MacroFusion.cpp ee2b7fbda0 llvm16 targets 9 months ago
ModuloSchedule.cpp ee2b7fbda0 llvm16 targets 9 months ago
MultiHazardRecognizer.cpp ee2b7fbda0 llvm16 targets 9 months ago
NonRelocatableStringpool.cpp ee2b7fbda0 llvm16 targets 9 months ago
OptimizePHIs.cpp ee2b7fbda0 llvm16 targets 9 months ago
PHIElimination.cpp ee2b7fbda0 llvm16 targets 9 months ago
PHIEliminationUtils.cpp ee2b7fbda0 llvm16 targets 9 months ago
PHIEliminationUtils.h ee2b7fbda0 llvm16 targets 9 months ago
ParallelCG.cpp ee2b7fbda0 llvm16 targets 9 months ago
PatchableFunction.cpp ee2b7fbda0 llvm16 targets 9 months ago
PeepholeOptimizer.cpp ee2b7fbda0 llvm16 targets 9 months ago
PostRAHazardRecognizer.cpp ee2b7fbda0 llvm16 targets 9 months ago
PostRASchedulerList.cpp ee2b7fbda0 llvm16 targets 9 months ago
PreISelIntrinsicLowering.cpp ee2b7fbda0 llvm16 targets 9 months ago
ProcessImplicitDefs.cpp ee2b7fbda0 llvm16 targets 9 months ago
PrologEpilogInserter.cpp ee2b7fbda0 llvm16 targets 9 months ago
PseudoProbeInserter.cpp ee2b7fbda0 llvm16 targets 9 months ago
PseudoSourceValue.cpp ee2b7fbda0 llvm16 targets 9 months ago
RDFGraph.cpp ee2b7fbda0 llvm16 targets 9 months ago
RDFLiveness.cpp ee2b7fbda0 llvm16 targets 9 months ago
RDFRegisters.cpp ee2b7fbda0 llvm16 targets 9 months ago
README.txt 6ffe9e5365 YQ Connector: support managed ClickHouse 1 year ago
ReachingDefAnalysis.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocBase.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocBase.h ee2b7fbda0 llvm16 targets 9 months ago
RegAllocBasic.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocEvictionAdvisor.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocEvictionAdvisor.h ee2b7fbda0 llvm16 targets 9 months ago
RegAllocFast.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocGreedy.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocGreedy.h ee2b7fbda0 llvm16 targets 9 months ago
RegAllocPBQP.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocPriorityAdvisor.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocPriorityAdvisor.h ee2b7fbda0 llvm16 targets 9 months ago
RegAllocScore.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegAllocScore.h ee2b7fbda0 llvm16 targets 9 months ago
RegUsageInfoCollector.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegUsageInfoPropagate.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegisterBank.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegisterBankInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegisterClassInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegisterCoalescer.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegisterCoalescer.h ee2b7fbda0 llvm16 targets 9 months ago
RegisterPressure.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegisterScavenging.cpp ee2b7fbda0 llvm16 targets 9 months ago
RegisterUsageInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
RemoveRedundantDebugValues.cpp ee2b7fbda0 llvm16 targets 9 months ago
RenameIndependentSubregs.cpp ee2b7fbda0 llvm16 targets 9 months ago
ReplaceWithVeclib.cpp ee2b7fbda0 llvm16 targets 9 months ago
ResetMachineFunctionPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
SafeStack.cpp ee2b7fbda0 llvm16 targets 9 months ago
SafeStackLayout.cpp ee2b7fbda0 llvm16 targets 9 months ago
SafeStackLayout.h ee2b7fbda0 llvm16 targets 9 months ago
SanitizerBinaryMetadata.cpp ee2b7fbda0 llvm16 targets 9 months ago
ScheduleDAG.cpp ee2b7fbda0 llvm16 targets 9 months ago
ScheduleDAGInstrs.cpp ee2b7fbda0 llvm16 targets 9 months ago
ScheduleDAGPrinter.cpp ee2b7fbda0 llvm16 targets 9 months ago
ScoreboardHazardRecognizer.cpp ee2b7fbda0 llvm16 targets 9 months ago
SelectOptimize.cpp ee2b7fbda0 llvm16 targets 9 months ago
ShadowStackGCLowering.cpp ee2b7fbda0 llvm16 targets 9 months ago
ShrinkWrap.cpp ee2b7fbda0 llvm16 targets 9 months ago
SjLjEHPrepare.cpp ee2b7fbda0 llvm16 targets 9 months ago
SlotIndexes.cpp ee2b7fbda0 llvm16 targets 9 months ago
SpillPlacement.cpp ee2b7fbda0 llvm16 targets 9 months ago
SpillPlacement.h ee2b7fbda0 llvm16 targets 9 months ago
SplitKit.cpp ee2b7fbda0 llvm16 targets 9 months ago
SplitKit.h ee2b7fbda0 llvm16 targets 9 months ago
StackColoring.cpp ee2b7fbda0 llvm16 targets 9 months ago
StackFrameLayoutAnalysisPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
StackMapLivenessAnalysis.cpp ee2b7fbda0 llvm16 targets 9 months ago
StackMaps.cpp ee2b7fbda0 llvm16 targets 9 months ago
StackProtector.cpp ee2b7fbda0 llvm16 targets 9 months ago
StackSlotColoring.cpp ee2b7fbda0 llvm16 targets 9 months ago
SwiftErrorValueTracking.cpp ee2b7fbda0 llvm16 targets 9 months ago
SwitchLoweringUtils.cpp ee2b7fbda0 llvm16 targets 9 months ago
TailDuplication.cpp ee2b7fbda0 llvm16 targets 9 months ago
TailDuplicator.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetFrameLoweringImpl.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetInstrInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetLoweringBase.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetLoweringObjectFileImpl.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetOptionsImpl.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetPassConfig.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetRegisterInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetSchedule.cpp ee2b7fbda0 llvm16 targets 9 months ago
TargetSubtargetInfo.cpp ee2b7fbda0 llvm16 targets 9 months ago
TwoAddressInstructionPass.cpp ee2b7fbda0 llvm16 targets 9 months ago
TypePromotion.cpp ee2b7fbda0 llvm16 targets 9 months ago
UnreachableBlockElim.cpp ee2b7fbda0 llvm16 targets 9 months ago
VLIWMachineScheduler.cpp ee2b7fbda0 llvm16 targets 9 months ago
ValueTypes.cpp ee2b7fbda0 llvm16 targets 9 months ago
VirtRegMap.cpp ee2b7fbda0 llvm16 targets 9 months ago
WasmEHPrepare.cpp ee2b7fbda0 llvm16 targets 9 months ago
WinEHPrepare.cpp ee2b7fbda0 llvm16 targets 9 months ago
XRayInstrumentation.cpp ee2b7fbda0 llvm16 targets 9 months ago
ya.make ee2b7fbda0 llvm16 targets 9 months ago

README.txt

//===---------------------------------------------------------------------===//

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, %reg1037, mbb

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, , 4, 1, 1, 1, , 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.