File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -627,18 +627,16 @@ RValue CIRGenFunction::emitLoadOfLValue(LValue lv, SourceLocation loc) {
627627 lv.getVectorIdx ()));
628628 }
629629
630- if (lv.isExtVectorElt ()) {
630+ if (lv.isExtVectorElt ())
631631 return emitLoadOfExtVectorElementLValue (lv);
632- }
633632
634633 cgm.errorNYI (loc, " emitLoadOfLValue" );
635634 return RValue::get (nullptr );
636635}
637636
638637int64_t CIRGenFunction::getAccessedFieldNo (unsigned int idx,
639638 const mlir::ArrayAttr elts) {
640- auto elt = mlir::dyn_cast<mlir::IntegerAttr>(elts[idx]);
641- assert (elt && " The indices should be integer attributes" );
639+ auto elt = mlir::cast<mlir::IntegerAttr>(elts[idx]);
642640 return elt.getInt ();
643641}
644642
@@ -1186,11 +1184,7 @@ LValue CIRGenFunction::emitExtVectorElementExpr(const ExtVectorElementExpr *e) {
11861184 e->getEncodedElementAccess (indices);
11871185
11881186 if (base.isSimple ()) {
1189- SmallVector<int64_t > attrElts;
1190- for (uint32_t i : indices) {
1191- attrElts.push_back (static_cast <int64_t >(i));
1192- }
1193-
1187+ SmallVector<int64_t > attrElts (indices.begin (), indices.end ());
11941188 mlir::ArrayAttr elts = builder.getI64ArrayAttr (attrElts);
11951189 return LValue::makeExtVectorElt (base.getAddress (), elts, type,
11961190 base.getBaseInfo ());
You can’t perform that action at this time.
0 commit comments