[PATCH] D128926: [AArch64] NFC: Move safe predicate casting to a separate function.

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 10:31:38 PDT 2022


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:4287-4288
+  EVT InVT = Op.getValueType();
+  const TargetLowering &TLI = DAG.getTargetLoweringInfo();
+  (void)TLI;
+
----------------
This'll be because of my original rubbish code.  Given this is a `AArch64TargetLowering` member function, you should be able to call `isTypeLegal()` directly.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:4514
   case Intrinsic::aarch64_sve_convert_from_svbool:
-    return DAG.getNode(AArch64ISD::REINTERPRET_CAST, dl, Op.getValueType(),
-                       Op.getOperand(1));
+    return getSVESafePredicateBitCast(Op.getValueType(), Op.getOperand(1), DAG);
   case Intrinsic::aarch64_sve_convert_to_svbool:
----------------
sdesmalen wrote:
> paulwalker-arm wrote:
> > Why is this change needed? This is the scenario when `AArch64ISD::REINTERPRET_CAST` is safe to use directly?
> It's not strictly needed, but the function implements this behaviour so I figured we might just as well use it. I can also restrict getSVEPredicateBitCast to only "widening" casts.
I'm not totally against its use here, I mean it does reduce the line wrapping :), I'm just a little conscious of compiler time creep.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128926/new/

https://reviews.llvm.org/D128926



More information about the llvm-commits mailing list