| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Take MachineInstr by reference instead of by pointer in SlotIndexes and
the SlotIndex wrappers in LiveIntervals. The MachineInstrs here are
never null, so this cleans up the API a bit. It also incidentally
removes a few implicit conversions from MachineInstrBundleIterator to
MachineInstr* (see PR26753).
At a couple of call sites it was convenient to convert to a range-based
for loop over MachineBasicBlock::instr_begin/instr_end, so I added
MachineBasicBlock::instrs.
llvm-svn: 262115
|
|
|
|
|
|
| |
apropriate; NFC
llvm-svn: 248623
|
|
|
|
| |
llvm-svn: 248241
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR24139 contains an analysis of poor register allocation. One of the findings
was that when calculating the spill weight, a rematerializable interval once
split is no longer rematerializable. This is because the isRematerializable
check in CalcSpillWeights.cpp does not follow the copies introduced by live
range splitting (after splitting, the live interval register definition is a
copy which is not rematerializable).
Reviewers: qcolombet
Differential Revision: http://reviews.llvm.org/D11686
llvm-svn: 244439
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a dead instruction we may not only have a last-use in the main live
range but also in a subregister range if subregisters are tracked. We
need to partially rebuild live ranges in both cases.
The testcase only broke when subregister liveness was enabled. I
commited it in the current form because there is currently no flag to
enable/disable subregister liveness.
This fixes PR23720.
llvm-svn: 238785
|
|
|
|
| |
llvm-svn: 237726
|
|
|
|
|
|
|
| |
subtarget and so doesn't need the TargetMachine or to access via
getSubtargetImpl. Update all callers.
llvm-svn: 227160
|
|
|
|
|
|
|
|
|
|
|
| |
This cleans up code and is more in line with the general philosophy of
modifying LiveIntervals through LiveIntervalAnalysis instead of changing
them directly.
This also fixes a case where SplitEditor::removeBackCopies() would miss
the subregister ranges.
llvm-svn: 226690
|
|
|
|
|
|
|
|
| |
This cleans up code and is more in line with the general philosophy of
modifying LiveIntervals through LiveIntervalAnalysis instead of changing
them directly.
llvm-svn: 226687
|
|
|
|
|
|
|
| |
Completely empty subranges are not allowed and must be removed when
subreg liveness is enabled.
llvm-svn: 224804
|
|
|
|
| |
llvm-svn: 223991
|
|
|
|
| |
llvm-svn: 223978
|
|
|
|
| |
llvm-svn: 223882
|
|
|
|
| |
llvm-svn: 222119
|
|
|
|
|
|
|
|
| |
reduce static table size and number of relocation entries.
Indices into the table are stored in each MCRegisterClass instead of a pointer. A new method, getRegClassName, is added to MCRegisterInfo and TargetRegisterInfo to lookup the string in the table.
llvm-svn: 222118
|
|
|
|
| |
llvm-svn: 214158
|
|
|
|
|
|
|
|
|
|
|
|
| |
define below all header includes in the lib/CodeGen/... tree. While the
current modules implementation doesn't check for this kind of ODR
violation yet, it is likely to grow support for it in the future. It
also removes one layer of macro pollution across all the included
headers.
Other sub-trees will follow.
llvm-svn: 206837
|
|
|
|
|
|
| |
instead of comparing to nullptr.
llvm-svn: 206142
|
|
|
|
|
|
| |
the MachineRegisterInfo iterators are compatible with it.
llvm-svn: 204075
|
|
|
|
|
|
|
|
|
|
| |
operator* on the by-operand iterators to return a MachineOperand& rather than
a MachineInstr&. At this point they almost behave like normal iterators!
Again, this requires making some existing loops more verbose, but should pave
the way for the big range-based for-loop cleanups in the future.
llvm-svn: 203865
|
|
|
|
|
|
|
|
| |
Besides, this relates it more obviously to the VirtRegAuxInfo::calculateSpillWeightAndHint.
No functionnal change.
llvm-svn: 194404
|
|
|
|
|
|
|
| |
Previously LiveInterval has been used, but having a spill weight and
register number is unnecessary for a register unit.
llvm-svn: 192397
|
|
|
|
|
|
|
| |
This makes the API a bit more natural to use and makes it easier to make
LiveRanges implementation details private.
llvm-svn: 192394
|
|
|
|
|
|
| |
Remove redundant or bug-prone LiveInterval APIs.
llvm-svn: 189685
|
|
|
|
|
|
| |
Return true for LRGs that end at EarlyClobber or Register slots.
llvm-svn: 189642
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When new virtual registers are created during splitting/spilling, defer
creation of the live interval until we need to use the live interval.
Along with the recent commits to notify LiveRangeEdit when new virtual
registers are created, this makes it possible for functions like
TargetInstrInfo::loadRegFromStackSlot() and
TargetInstrInfo::storeRegToStackSlot() to create multiple virtual
registers as part of the process of generating loads/stores for
different register classes, and then have the live intervals for those
new registers computed when they are needed.
llvm-svn: 188437
|
|
|
|
|
|
|
|
|
| |
Add a delegate class to MachineRegisterInfo with a single virtual
function, MRI_NoteNewVirtualRegister(). Update LiveRangeEdit to inherit
from this delegate class and override the definition of the callback
with an implementation that tracks the newly created virtual registers.
llvm-svn: 188435
|
|
|
|
|
|
|
|
|
|
| |
Track new virtual registers by register number, rather than by the live
interval created for them. This is the first step in separating the
creation of new virtual registers and new live intervals. Eventually
live intervals will be created and populated on demand after the virtual
registers have been created and used in instructions.
llvm-svn: 188434
|
|
|
|
|
|
| |
Patch by Matthias Braun!
llvm-svn: 188393
|
|
|
|
|
|
|
|
|
| |
We have no targets on trunk that bundle before regalloc. However, we
have been advertising regalloc as bundle safe for use with out-of-tree
targets. We need to at least contain the parts of the code that are
still unsafe.
llvm-svn: 184620
|
|
|
|
|
|
|
|
|
|
| |
Live intervals for dead physregs may be created during coalescing. We
need to update these in the event that their instruction goes away.
crash.ll is the unit test that catches it when MI sched is enabled on
X86.
llvm-svn: 184572
|
|
|
|
|
|
| |
I want to add logic to handle more cases.
llvm-svn: 184571
|
|
|
|
| |
llvm-svn: 184570
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main advantages here are way better heuristics, taking into account not
just loop depth but also __builtin_expect and other static heuristics and will
eventually learn how to use profile info. Most of the work in this patch is
pushing the MachineBlockFrequencyInfo analysis into the right places.
This is good for a 5% speedup on zlib's deflate (x86_64), there were some very
unfortunate spilling decisions in its hottest loop in longest_match(). Other
benchmarks I tried were mostly neutral.
This changes register allocation in subtle ways, update the tests for it.
2012-02-20-MachineCPBug.ll was deleted as it's very fragile and the instruction
it looked for was gone already (but the FileCheck pattern picked up unrelated
stuff).
llvm-svn: 184105
|
|
|
|
| |
llvm-svn: 177356
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.
Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]
llvm-svn: 169131
|
|
|
|
|
|
|
|
|
|
|
| |
No functional change, just moved header files.
Targets can inject custom passes between register allocation and
rewriting. This makes it possible to tweak the register allocation
before rewriting, using the full global interference checking available
from LiveRegMatrix.
llvm-svn: 168806
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PR14098 contains an example where we would rematerialize a MOV8ri
immediately after the original instruction:
%vreg7:sub_8bit<def> = MOV8ri 9; GR32_ABCD:%vreg7
%vreg22:sub_8bit<def> = MOV8ri 9; GR32_ABCD:%vreg7
Besides being pointless, it is also wrong since the original instruction
only redefines part of the register, and the value read by the new
instruction is wrong.
The problem was the LiveRangeEdit::allUsesAvailableAt() didn't
special-case OrigIdx == UseIdx and found the wrong SSA value.
llvm-svn: 166068
|
|
|
|
|
|
| |
All callers can simply use the corresponding MRI functions.
llvm-svn: 165985
|
|
|
|
|
|
| |
Fixes PR13943.
llvm-svn: 164778
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LiveRangeEdit::eliminateDeadDefs() can delete a dead instruction that
reads unreserved physregs. This would leave the corresponding regunit
live interval dangling because we don't have shrinkToUses() for physical
registers.
Fix this problem by turning the instruction into a KILL instead of
deleting it. This happens in a landing pad in
test/CodeGen/X86/2012-05-19-CoalescerCrash.ll:
%vreg27<def,dead> = COPY %EDX<kill>; GR32:%vreg27
becomes:
KILL %EDX<kill>
An upcoming fix to the machine verifier will catch problems like this by
verifying regunit live intervals.
This fixes PR13498. I am not including the test case from the PR since
we already have one exposing the problem once the verifier is fixed.
llvm-svn: 161182
|
|
|
|
|
|
|
|
|
|
| |
LiveRangeEdit::foldAsLoad() can eliminate a register by folding a load
into its only use. Only do that when the load is safe to move, and it
won't extend any live ranges.
This fixes PR13414.
llvm-svn: 160575
|
|
|
|
|
|
|
| |
Don't depend on LiveIntervals::hasInterval() to determine if a physreg
is reserved and constant.
llvm-svn: 159013
|
|
|
|
|
|
|
|
|
| |
Also make sure registers aren't erased twice if the dead def mentions
the register twice.
This fixes PR12911.
llvm-svn: 157254
|
|
|
|
|
|
|
|
|
|
|
|
| |
Dead code elimination during coalescing could cause a virtual register
to be split into connected components. The following rewriting would be
confused about the already joined copies present in the code, but
without a corresponding value number in the live range.
Erase all joined copies instantly when joining intervals such that the
MI and LiveInterval representations are always in sync.
llvm-svn: 157135
|
|
|
|
|
|
| |
The dead code elimination with callbacks is still useful.
llvm-svn: 157100
|
|
|
|
|
|
| |
No functional change.
llvm-svn: 157079
|
|
|
|
| |
llvm-svn: 153975
|
|
|
|
|
|
| |
VirtRegMap is NULL. Also changed it in this case to just avoid updating the map, but live ranges or intervals will still get updated and created
llvm-svn: 153914
|
|
|
|
|
|
| |
backend, not just libCodeGen
llvm-svn: 153906
|