[PATCH] D89876: [ARM][SchedModels] Convert IsLdrAm3RegOffPred to MCSchedPredicate
Eugene Leviant via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 21 09:38:33 PDT 2020
evgeny777 updated this revision to Diff 299726.
evgeny777 added a comment.
Addressed
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89876/new/
https://reviews.llvm.org/D89876
Files:
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/lib/Target/ARM/ARMScheduleA57.td
llvm/test/tools/llvm-mca/ARM/cortex-a57-memory-instructions.s
Index: llvm/test/tools/llvm-mca/ARM/cortex-a57-memory-instructions.s
===================================================================
--- llvm/test/tools/llvm-mca/ARM/cortex-a57-memory-instructions.s
+++ llvm/test/tools/llvm-mca/ARM/cortex-a57-memory-instructions.s
@@ -180,7 +180,7 @@
# CHECK-NEXT: 2 4 1.00 * ldrbt r1, [r2], -r6, lsl #12
# CHECK-NEXT: 2 4 2.00 * ldrd r0, r1, [r5]
# CHECK-NEXT: 2 4 2.00 * ldrd r8, r9, [r2, #15]
-# CHECK-NEXT: 4 4 2.00 * ldrd r2, r3, [r9, #32]!
+# CHECK-NEXT: 4 5 2.00 * ldrd r2, r3, [r9, #32]!
# CHECK-NEXT: 4 4 2.00 * ldrd r6, r7, [r1], #8
# CHECK-NEXT: 4 4 2.00 * ldrd r2, r3, [r8], #0
# CHECK-NEXT: 4 4 2.00 * ldrd r2, r3, [r8], #0
Index: llvm/lib/Target/ARM/ARMScheduleA57.td
===================================================================
--- llvm/lib/Target/ARM/ARMScheduleA57.td
+++ llvm/lib/Target/ARM/ARMScheduleA57.td
@@ -28,14 +28,9 @@
// Cortex A57 rev. r1p0 or later (false = r0px)
def IsR1P0AndLaterPred : SchedPredicate<[{false}]>;
-// If Addrmode3 contains register offset (not immediate)
-def IsLdrAm3RegOffPred :
- SchedPredicate<[{!TII->isAddrMode3OpImm(*MI, 1)}]>;
-// The same predicate with operand offset 2 and 3:
-def IsLdrAm3RegOffPredX2 :
- SchedPredicate<[{!TII->isAddrMode3OpImm(*MI, 2)}]>;
-def IsLdrAm3RegOffPredX3 :
- SchedPredicate<[{!TII->isAddrMode3OpImm(*MI, 3)}]>;
+def IsLdrAm3RegOffPred : MCSchedPredicate<CheckInvalidRegOperand<2>>;
+def IsLdrAm3RegOffPredX2 : MCSchedPredicate<CheckInvalidRegOperand<3>>;
+def IsLdrAm3RegOffPredX3 : MCSchedPredicate<CheckInvalidRegOperand<4>>;
// If Addrmode3 contains "minus register"
def IsLdrAm3NegRegOffPred :
Index: llvm/lib/Target/ARM/ARMBaseInstrInfo.h
===================================================================
--- llvm/lib/Target/ARM/ARMBaseInstrInfo.h
+++ llvm/lib/Target/ARM/ARMBaseInstrInfo.h
@@ -178,7 +178,6 @@
// CPSR defined in instruction
static bool isCPSRDefined(const MachineInstr &MI);
- bool isAddrMode3OpImm(const MachineInstr &MI, unsigned Op) const;
bool isAddrMode3OpMinusReg(const MachineInstr &MI, unsigned Op) const;
// Load, scaled register offset
Index: llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
===================================================================
--- llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -612,12 +612,6 @@
return false;
}
-bool ARMBaseInstrInfo::isAddrMode3OpImm(const MachineInstr &MI,
- unsigned Op) const {
- const MachineOperand &Offset = MI.getOperand(Op + 1);
- return Offset.getReg() != 0;
-}
-
// Load with negative register offset requires additional 1cyc and +I unit
// for Cortex A57
bool ARMBaseInstrInfo::isAddrMode3OpMinusReg(const MachineInstr &MI,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89876.299726.patch
Type: text/x-patch
Size: 3022 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201021/062619f5/attachment-0001.bin>
More information about the llvm-commits
mailing list