[PATCH] D129560: [AArch64] Add target hook for preferPredicateOverEpilogue

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 17:04:41 PDT 2022


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:67
+      else if (TailFoldType == "simple")
+        Bits = TFSimple;
+      else if (TailFoldType == "reductions")
----------------
Can this be `add(TFSimple)` so it's not position dependent?


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:3034-3042
+  if (!(TailFoldingKindLoc & TailFoldingKind::TFReductions) &&
+      LVL->getReductionVars().size())
+    return false;
+
+  if (!(TailFoldingKindLoc & TailFoldingKind::TFRecurrences) &&
+      LVL->getFirstOrderRecurrences().size())
+    return false;
----------------
I don't think this works now we have the expanded bitfield.  I think you need logic like:
```
TailFoldingKind Required = 0;
if (LVL->getReductionVars().size())
  Required.add(TailFoldingKind::TFReductions)
if (LVL->getReductionVars().size())
  Required.add(TailFoldingKind::TFRecurrences)
if (!Required)
  Required.add(TailFoldingKind::TFSimple)

return TailFoldingKindLoc & Required
```


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

https://reviews.llvm.org/D129560



More information about the llvm-commits mailing list