[PATCH] D123284: [ArgPromotion][Attributor] Update min-legal-vector-width when do promotion

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 08:37:22 PDT 2022


pengfei added inline comments.


================
Comment at: llvm/lib/IR/Attributes.cpp:2041
+  }
+}
----------------
jdoerfert wrote:
> Can't this function walk the arguments of `Fn` and determine `Width` if necessary?
I don't think so. For one thing, "min-legal-vector-width" indicates not only for arguments of `Fn` but also the largest vector arguments in functions called by `Fn`. For another, The old "min-legal-vector-width" is already >= the largest vector width in old arguments. No need to walk again. We only need to update for the new argument.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2499
+        LargestVectorWidth = std::max(
+            LargestVectorWidth, VT->getPrimitiveSizeInBits().getKnownMinSize());
+
----------------
jdoerfert wrote:
> Shouldn't we use the DataLayout for size questions?
We can get the target capbility by features or target name. The problem here is "min-legal-vector-width" is different per function.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123284



More information about the llvm-commits mailing list