[PATCH] D99037: [Matrix] Implement C-style explicit type conversions for matrix types
Saurabh Jha via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 6 11:48:16 PDT 2021
SaurabhJha added inline comments.
================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1324
+
+ if (SrcElementTy->isFloatTy() || SrcElementTy->isDoubleTy()) {
+ QualType DstElementType = DstType->castAs<MatrixType>()->getElementType();
----------------
fhahn wrote:
> SaurabhJha wrote:
> > fhahn wrote:
> > > I think we should support all floating point type here (`isFloatingPointTy`). Basically we want the same rules as for integer types (around line 1418). Perhaps it would be possible to generalize this code in a separate function that takes the LLVM types & the element type/scalar types?
> > I think we should move this code to `MatrixBuilder` but then generalising floating point after that would be problematic since the code is splitted across this function and in MatrixBuilder, right?
> That's a good point. Sharing the logic with the scalar case in Clang directly seems much more valuable than having it in the MatrixBuilder IMO.
Whoops, I just moved the code to MatrixBuilder. Will revert it back and generalise it :)
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