[llvm] [Scalarizer][DirectX] support structs return types (PR #111569)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 09:06:51 PDT 2024


================
@@ -197,6 +197,23 @@ struct VectorLayout {
   uint64_t SplitSize = 0;
 };
 
+static bool isStructAllVectors(Type *Ty) {
+  if (!isa<StructType>(Ty))
+    return false;
----------------
bogner wrote:

It doesn't make much difference in this case, because `StructType::element_iterator` is just an alias for `Type::subtype_iterator`, but this would arguably be clearer if we start with `auto *ST = dyn_cast<StructType>(Ty)` and phrase all of this in terms of the StructType accessors.

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


More information about the llvm-commits mailing list