[PATCH] D139607: [AArch64][NFC] Change order of instructions in isAssociativeAndCommutative
KAWASHIMA Takahiro via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 11 17:03:37 PST 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa008b892a999: [AArch64][NFC] Change order of instructions in isAssociativeAndCommutative (authored by kawashima-fj).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139607/new/
https://reviews.llvm.org/D139607
Files:
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
Index: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -4944,35 +4944,47 @@
if (Invert)
return false;
switch (Inst.getOpcode()) {
- case AArch64::FADDDrr:
+ // == Floating-point types ==
+ // -- Floating-point instructions --
case AArch64::FADDSrr:
- case AArch64::FADDv2f32:
- case AArch64::FADDv2f64:
- case AArch64::FADDv4f32:
- case AArch64::FMULDrr:
+ case AArch64::FADDDrr:
case AArch64::FMULSrr:
+ case AArch64::FMULDrr:
case AArch64::FMULX32:
case AArch64::FMULX64:
- case AArch64::FMULXv2f32:
- case AArch64::FMULXv2f64:
- case AArch64::FMULXv4f32:
+ // -- Advanced SIMD instructions --
+ case AArch64::FADDv2f32:
+ case AArch64::FADDv4f32:
+ case AArch64::FADDv2f64:
case AArch64::FMULv2f32:
- case AArch64::FMULv2f64:
case AArch64::FMULv4f32:
+ case AArch64::FMULv2f64:
+ case AArch64::FMULXv2f32:
+ case AArch64::FMULXv4f32:
+ case AArch64::FMULXv2f64:
return Inst.getParent()->getParent()->getTarget().Options.UnsafeFPMath ||
(Inst.getFlag(MachineInstr::MIFlag::FmReassoc) &&
Inst.getFlag(MachineInstr::MIFlag::FmNsz));
- case AArch64::ADDXrr:
- case AArch64::ANDXrr:
- case AArch64::ORRXrr:
- case AArch64::EORXrr:
- case AArch64::EONXrr:
+
+ // == Integer types ==
+ // -- Base instructions --
+ // Opcodes MULWrr and MULXrr don't exist because
+ // `MUL <Wd>, <Wn>, <Wm>` and `MUL <Xd>, <Xn>, <Xm>` are aliases of
+ // `MADD <Wd>, <Wn>, <Wm>, WZR` and `MADD <Xd>, <Xn>, <Xm>, XZR` respectively.
+ // The machine-combiner does not support three-source-operands machine
+ // instruction. So we cannot reassociate MULs.
case AArch64::ADDWrr:
+ case AArch64::ADDXrr:
case AArch64::ANDWrr:
+ case AArch64::ANDXrr:
case AArch64::ORRWrr:
+ case AArch64::ORRXrr:
case AArch64::EORWrr:
+ case AArch64::EORXrr:
case AArch64::EONWrr:
+ case AArch64::EONXrr:
return true;
+
default:
return false;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139607.481959.patch
Type: text/x-patch
Size: 2097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221212/156aade3/attachment.bin>
More information about the llvm-commits
mailing list