[PATCH] D99037: [Matrix] Implement C-style explicit type conversions for matrix types

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 7 14:45:07 PDT 2021


fhahn added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1219
+  } else {
+    SrcElementTy = SrcTy;
+    DstElementTy = DstTy;
----------------
We should be able to assert here that both types are not matrix types, I think?


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1377
 
+  if (SrcType->isMatrixType() && DstType->isMatrixType()) {
+    return EmitScalarCast(Src, SrcType, DstType, SrcTy, DstTy, Opts);
----------------
nit: no braces required here


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1453
+          CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16,
+                               CGF.CGM.FloatTy),
+          Res);
----------------
SaurabhJha wrote:
> Not sure why this was changed. Perhaps clang-clean.
Not sure, but please remove the change from the diff.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99037



More information about the cfe-commits mailing list