[clang] [CIR] Upstream insert op for VectorType (PR #139146)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Thu May 8 15:26:10 PDT 2025
================
@@ -666,18 +678,26 @@ CIRGenFunction::emitArraySubscriptExpr(const clang::ArraySubscriptExpr *e) {
assert((e->getIdx() == e->getLHS() || e->getIdx() == e->getRHS()) &&
"index was neither LHS nor RHS");
- auto emitIdxAfterBase = [&]() -> mlir::Value {
+ auto emitIdxAfterBase = [&](bool promote) -> mlir::Value {
const mlir::Value idx = emitScalarExpr(e->getIdx());
// Extend or truncate the index type to 32 or 64-bits.
auto ptrTy = mlir::dyn_cast<cir::PointerType>(idx.getType());
- if (ptrTy && mlir::isa<cir::IntType>(ptrTy.getPointee()))
+ if (promote && ptrTy && mlir::isa<cir::IntType>(ptrTy.getPointee()))
cgm.errorNYI(e->getSourceRange(),
"emitArraySubscriptExpr: index type cast");
return idx;
};
- const mlir::Value idx = emitIdxAfterBase();
+ if (e->getBase()->getType()->isVectorType() &&
----------------
andykaylor wrote:
You dropped a comment from the incubator here. Can you bring it in?
https://github.com/llvm/llvm-project/pull/139146
More information about the cfe-commits
mailing list