summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-31 17:58:15 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-10-31 18:00:29 +0000
commit3842b94c4e7292de5f9e368bd60c64fc084c1bbe (patch)
treecd3c53f5d0df19bd7cea8da654ec063498fdbfaa /llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
parent05a2d70d963b83f1ed68eddd91b017b5f0a0fa72 (diff)
downloadbcm5719-llvm-3842b94c4e7292de5f9e368bd60c64fc084c1bbe.tar.gz
bcm5719-llvm-3842b94c4e7292de5f9e368bd60c64fc084c1bbe.zip
Revert rG57ee0435bd47f23f3939f402914c231b4f65ca5e - [TII] Use optional destination and source pair as a return value; NFC
This is breaking MSVC builds: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/20375
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64InstrInfo.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrInfo.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index c627ad4004b..d6578e3f4f9 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -5936,33 +5936,39 @@ bool AArch64InstrInfo::shouldOutlineFromFunctionByDefault(
return MF.getFunction().hasMinSize();
}
-Optional<DestSourcePair>
-AArch64InstrInfo::isCopyInstrImpl(const MachineInstr &MI) const {
+bool AArch64InstrInfo::isCopyInstrImpl(
+ const MachineInstr &MI, const MachineOperand *&Source,
+ const MachineOperand *&Destination) const {
// AArch64::ORRWrs and AArch64::ORRXrs with WZR/XZR reg
// and zero immediate operands used as an alias for mov instruction.
if (MI.getOpcode() == AArch64::ORRWrs &&
MI.getOperand(1).getReg() == AArch64::WZR &&
MI.getOperand(3).getImm() == 0x0) {
- return DestSourcePair{MI.getOperand(0), MI.getOperand(2)};
+ Destination = &MI.getOperand(0);
+ Source = &MI.getOperand(2);
+ return true;
}
if (MI.getOpcode() == AArch64::ORRXrs &&
MI.getOperand(1).getReg() == AArch64::XZR &&
MI.getOperand(3).getImm() == 0x0) {
- return DestSourcePair{MI.getOperand(0), MI.getOperand(2)};
+ Destination = &MI.getOperand(0);
+ Source = &MI.getOperand(2);
+ return true;
}
- return None;
+ return false;
}
-Optional<DestSourcePair>
-AArch64InstrInfo::isAddImmediate(const MachineInstr &MI,
- int64_t &Offset) const {
+bool AArch64InstrInfo::isAddImmediate(const MachineInstr &MI,
+ const MachineOperand *&Destination,
+ const MachineOperand *&Source,
+ int64_t &Offset) const {
int Sign = 1;
switch (MI.getOpcode()) {
default:
- return None;
+ return false;
case AArch64::SUBWri:
case AArch64::SUBXri:
case AArch64::SUBSWri:
@@ -5976,14 +5982,16 @@ AArch64InstrInfo::isAddImmediate(const MachineInstr &MI,
// TODO: Third operand can be global address (usually some string).
if (!MI.getOperand(0).isReg() || !MI.getOperand(1).isReg() ||
!MI.getOperand(2).isImm())
- return None;
+ return false;
+ Source = &MI.getOperand(1);
Offset = MI.getOperand(2).getImm() * Sign;
int Shift = MI.getOperand(3).getImm();
assert((Shift == 0 || Shift == 12) && "Shift can be either 0 or 12");
Offset = Offset << Shift;
}
}
- return DestSourcePair{MI.getOperand(0), MI.getOperand(1)};
+ Destination = &MI.getOperand(0);
+ return true;
}
Optional<ParamLoadedValue>
OpenPOWER on IntegriCloud