mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG like
(almost) a register copy. However, it always coalesced to the register of the RHS (the super-register). All uses of the result of a EXTRACT_SUBREG are sub- register uses which adds subtle complications to load folding, spiller rewrite, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42899 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1097,6 +1097,11 @@ namespace {
|
||||
// CopyToReg should be close to its uses to facilitate coalescing and
|
||||
// avoid spilling.
|
||||
return 0;
|
||||
else if (Opc == TargetInstrInfo::EXTRACT_SUBREG ||
|
||||
Opc == TargetInstrInfo::INSERT_SUBREG)
|
||||
// EXTRACT_SUBREG / INSERT_SUBREG should be close to its use to
|
||||
// facilitate coalescing.
|
||||
return 0;
|
||||
else if (SU->NumSuccs == 0)
|
||||
// If SU does not have a use, i.e. it doesn't produce a value that would
|
||||
// be consumed (e.g. store), then it terminates a chain of computation.
|
||||
@@ -1308,6 +1313,14 @@ void BURegReductionPriorityQueue<SF>::AddPseudoTwoAddrDeps() {
|
||||
// Be conservative. Ignore if nodes aren't at the same depth.
|
||||
if (SuccSU->Depth != SU->Depth)
|
||||
continue;
|
||||
if (!SuccSU->Node || !SuccSU->Node->isTargetOpcode())
|
||||
continue;
|
||||
// Don't constraint extract_subreg / insert_subreg these may be
|
||||
// coalesced away. We don't them close to their uses.
|
||||
unsigned SuccOpc = SuccSU->Node->getTargetOpcode();
|
||||
if (SuccOpc == TargetInstrInfo::EXTRACT_SUBREG ||
|
||||
SuccOpc == TargetInstrInfo::INSERT_SUBREG)
|
||||
continue;
|
||||
if ((!canClobber(SuccSU, DUSU) ||
|
||||
(hasCopyToRegUse(SU) && !hasCopyToRegUse(SuccSU)) ||
|
||||
(!SU->isCommutable && SuccSU->isCommutable)) &&
|
||||
|
Reference in New Issue
Block a user