[PATCH] D126380: [clang][AArch64][SVE] Implicit conversions for vector-scalar operations

David Truby via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 9 09:01:12 PDT 2022


DavidTruby added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:13591-13595
+    if (!Target->isVLSTBuiltinType() && !isa<VectorType>(OriginalTarget)) {
+      if (S.SourceMgr.isInSystemMacro(CC))
+        return;
+      return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_vector_scalar);
+    }
----------------
c-rhodes wrote:
> DavidTruby wrote:
> > c-rhodes wrote:
> > > can a test be added for this?
> > It appears this code doesn't actually do anything as this condition is covered elsewhere (and tested below) so I've just removed it
> > It appears this code doesn't actually do anything as this condition is covered elsewhere (and tested below) so I've just removed it
> 
> Great! Thanks for investigating, can this code also be removed from the generic vector version this was copied from then? Just curious I won't let that hold up this patch.
I don't think so, I believe the reason this isn't necessary here is that vector -> scalar casts are forbidden for SVE vectors but are allowed in specific cases for fixed width vectors, this warning is here for cases where it's allowed but nonsensical. That's at least my understanding


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126380



More information about the cfe-commits mailing list