summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCInstrInfo.h
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2015-09-21 15:09:11 +0000
committerChad Rosier <mcrosier@codeaurora.org>2015-09-21 15:09:11 +0000
commit03a47305ec90068eeb9c5dd04daf0d1adc6ef563 (patch)
tree6f760d1d4ce4d5bebe9d932e6c30f84a720e7985 /llvm/lib/Target/PowerPC/PPCInstrInfo.h
parente2bab44ca961d1862282fee1a6d247822029378e (diff)
downloadbcm5719-llvm-03a47305ec90068eeb9c5dd04daf0d1adc6ef563.tar.gz
bcm5719-llvm-03a47305ec90068eeb9c5dd04daf0d1adc6ef563.zip
[Machine Combiner] Refactor machine reassociation code to be target-independent.
No functional change intended. Patch by Haicheng Wu <haicheng@codeaurora.org>! http://reviews.llvm.org/D12887 PR24522 llvm-svn: 248164
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCInstrInfo.h')
-rw-r--r--llvm/lib/Target/PowerPC/PPCInstrInfo.h25
1 files changed, 3 insertions, 22 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.h b/llvm/lib/Target/PowerPC/PPCInstrInfo.h
index 1d3687ee69d..f0d12a025e3 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.h
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.h
@@ -63,19 +63,6 @@ enum PPC970_Unit {
};
} // end namespace PPCII
-namespace MachineCombinerPattern {
-enum MC_PATTERN : int {
- // These are commutative variants for reassociating a computation chain
- // of the form:
- // B = A op X (Prev)
- // C = B op Y (Root)
- MC_REASSOC_AX_BY = 0,
- MC_REASSOC_AX_YB = 1,
- MC_REASSOC_XA_BY = 2,
- MC_REASSOC_XA_YB = 3,
-};
-} // end namespace MachineCombinerPattern
-
class PPCSubtarget;
class PPCInstrInfo : public PPCGenInstrInfo {
PPCSubtarget &Subtarget;
@@ -135,21 +122,15 @@ public:
bool useMachineCombiner() const override {
return true;
}
-
+
/// Return true when there is potentially a faster code sequence
/// for an instruction chain ending in <Root>. All potential patterns are
/// output in the <Pattern> array.
bool getMachineCombinerPatterns(
MachineInstr &Root,
SmallVectorImpl<MachineCombinerPattern::MC_PATTERN> &P) const override;
-
- /// When getMachineCombinerPatterns() finds a pattern, this function generates
- /// the instructions that could replace the original code sequence.
- void genAlternativeCodeSequence(
- MachineInstr &Root, MachineCombinerPattern::MC_PATTERN P,
- SmallVectorImpl<MachineInstr *> &InsInstrs,
- SmallVectorImpl<MachineInstr *> &DelInstrs,
- DenseMap<unsigned, unsigned> &InstrIdxForVirtReg) const override;
+
+ bool isAssociativeAndCommutative(const MachineInstr &Inst) const override;
bool isCoalescableExtInstr(const MachineInstr &MI,
unsigned &SrcReg, unsigned &DstReg,
OpenPOWER on IntegriCloud