================
@@ -2506,14 +2507,18 @@ RValue CodeGenFunction::EmitLoadOfLValue(LValue LV,
SourceLocation Loc) {
if (LV.isMatrixElt()) {
llvm::Value *Idx = LV.getMatrixIdx();
- if (CGM.getCodeGenOpts().OptimizationLevel > 0) {
- const auto *const MatTy = LV.getType()->castAs<ConstantMatrixType>();
- llvm::MatrixBuilder MB(Builder);
- MB.CreateIndexAssumption(Idx, MatTy->getNumElementsFlattened());
+ QualType EltTy = LV.getType();
+ if (const auto *MatTy = EltTy->getAs<ConstantMatrixType>()) {
+ EltTy = MatTy->getElementType();
+ if (CGM.getCodeGenOpts().OptimizationLevel > 0) {
+ llvm::MatrixBuilder MB(Builder);
+ MB.CreateIndexAssumption(Idx, MatTy->getNumElementsFlattened());
+ }
----------------
Icohedron wrote:
I think the index assumption used by the OpenCL backend. Other than that I'm
not sure.
https://github.com/llvm/llvm-project/pull/178315
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits