-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[AArch64] Mark FMOVvXfY_ns as rematerializable, cheap #169186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AArch64] Mark FMOVvXfY_ns as rematerializable, cheap #169186
Conversation
|
@llvm/pr-subscribers-backend-aarch64 Author: Guy David (guy-david) ChangesOtherwise, the register allocator may spill and reload constants that can be rematerialized with a single instruction. Full diff: https://github.com/llvm/llvm-project/pull/169186.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
index 50a3a4ab8d8b6..8dca6a054aa52 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
@@ -8354,6 +8354,7 @@ def : InstAlias<"orr.4s $Vd, $imm", (ORRv4i32 V128:$Vd, imm0_255:$imm, 0)>;
}
// AdvSIMD FMOV
+let isReMaterializable = 1, isAsCheapAsAMove = 1 in {
def FMOVv2f64_ns : SIMDModifiedImmVectorNoShift<1, 1, 0, 0b1111, V128, fpimm8,
"fmov", ".2d",
[(set (v2f64 V128:$Rd), (AArch64fmov imm0_255:$imm8))]>;
@@ -8371,6 +8372,7 @@ def FMOVv8f16_ns : SIMDModifiedImmVectorNoShift<1, 0, 1, 0b1111, V128, fpimm8,
"fmov", ".8h",
[(set (v8f16 V128:$Rd), (AArch64fmov imm0_255:$imm8))]>;
} // Predicates = [HasNEON, HasFullFP16]
+}
// AdvSIMD MOVI
|
tomershafir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls add a test for all of the variants that verifies they get rematerialized
bac88b5 to
592ce32
Compare
|
✅ With the latest revision this PR passed the undef deprecator. |
9132a1b to
eea688f
Compare
eea688f to
b5750aa
Compare
Otherwise, the register allocator may spill and reload constants that can be rematerialized with a single instruction.
b5750aa to
9be344a
Compare
davemgreen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - LGTM
Otherwise, the register allocator may spill and reload constants that can be rematerialized with a single instruction.
We have the same behaviour for
movi.2d, but this change concerns floating-point instructions such asfmov.4s v0, #1.00000000orfmov.2d v0, #0.25000000.