[llvm] [AArch64] Put legal action first for G_ATOMIC_CMPXCHG (PR #74613)

Thomas Preud'homme via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 15 07:15:04 PST 2023


================
@@ -758,18 +758,16 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
           all(typeInSet(0, {s8, s16, s32, s64, s128}), typeIs(2, p0)));
 
   getActionDefinitionsBuilder(G_ATOMIC_CMPXCHG)
-      .customIf([](const LegalityQuery &Query) {
-        return Query.Types[0].getSizeInBits() == 128;
-      })
-      .clampScalar(0, s32, s64)
-      .legalIf(all(typeInSet(0, {s32, s64}), typeIs(1, p0)));
+      .legalFor({{s32, p0}, {s64, p0}})
+      .customIf(typeIs(0, s128))
----------------
RoboTux wrote:

@ilinpv pointed out that testing for s128 is not equivalent to what was done so I've changed to keep the old test to keep this more of an RFC. Strangely, it required updating the legalizer-info-validation test. Would you happen to know why that changed?

https://github.com/llvm/llvm-project/pull/74613


More information about the llvm-commits mailing list