mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Teach ProcessImplicitDefs to transform more COPY instructions into IMPLICIT_DEF (and subsequently eliminate them). This allows machine LICM to hoist IMPLICIT_DEF's. PR7620.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108304 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -497,11 +497,6 @@ void MachineLICM::HoistRegion(MachineDomTreeNode *N) {
|
||||
/// candidate for LICM. e.g. If the instruction is a call, then it's obviously
|
||||
/// not safe to hoist it.
|
||||
bool MachineLICM::IsLICMCandidate(MachineInstr &I) {
|
||||
// It is not profitable to hoist implicitdefs. FIXME: Why not? what if they
|
||||
// are an argument to some other otherwise-hoistable instruction?
|
||||
if (I.isImplicitDef())
|
||||
return false;
|
||||
|
||||
// Check if it's safe to move the instruction.
|
||||
bool DontMoveAcrossStore = true;
|
||||
if (!I.isSafeToMove(TII, AA, DontMoveAcrossStore))
|
||||
@@ -717,7 +712,9 @@ MachineLICM::LookForDuplicate(const MachineInstr *MI,
|
||||
|
||||
bool MachineLICM::EliminateCSE(MachineInstr *MI,
|
||||
DenseMap<unsigned, std::vector<const MachineInstr*> >::iterator &CI) {
|
||||
if (CI == CSEMap.end())
|
||||
// Do not CSE implicit_def so ProcessImplicitDefs can properly propagate
|
||||
// the undef property onto uses.
|
||||
if (CI == CSEMap.end() || MI->isImplicitDef())
|
||||
return false;
|
||||
|
||||
if (const MachineInstr *Dup = LookForDuplicate(MI, CI->second)) {
|
||||
|
||||
Reference in New Issue
Block a user