[llvm] [AArch64][GlobalISel] Take abs scalar codegen closer to SDAG (PR #84886)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 01:56:51 PDT 2024


================
@@ -3914,8 +3914,12 @@ LegalizerHelper::lower(MachineInstr &MI, unsigned TypeIdx, LLT LowerHintTy) {
   case G_SSHLSAT:
   case G_USHLSAT:
     return lowerShlSat(MI);
-  case G_ABS:
+  case G_ABS: {
+    LLT Ty = MRI.getType(MI.getOperand(0).getReg());
+    if (LI.isLegalOrCustom({G_ABS, Ty}))
----------------
arsenm wrote:

For reference, the DAG has this chain of implementations: https://github.com/llvm/llvm-project/blob/8f68022f8e6e54d1aeae4ed301f5a015963089b7/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp#L8962



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


More information about the llvm-commits mailing list