Operation *allocOp = alloc.getDefiningOp();
Operation *alloca = builder.create<memref::AllocaOp>(
alloc.getLoc(), alloc.getType().cast<MemRefType>(),
- allocOp->getOperands());
+ allocOp->getOperands(), allocOp->getAttrs());
// Replace the original alloc by a newly created alloca.
allocOp->replaceAllUsesWith(alloca);
// CHECK-LABEL: func @bigIndexElementType
module attributes { dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<index, 256>>} {
func.func @bigIndexElementType() {
- %0 = memref.alloc() : memref<4xindex>
+ %0 = memref.alloc() {alignment = 64 : i64, custom_attr} : memref<4xindex>
return
}
}
-// DEFINDEX-NEXT: memref.alloca()
-// LOWLIMIT-NEXT: memref.alloc()
-// RANK-NEXT: memref.alloca()
+// DEFINDEX-NEXT: memref.alloca() {alignment = 64 : i64, custom_attr}
+// LOWLIMIT-NEXT: memref.alloc() {alignment = 64 : i64, custom_attr}
+// RANK-NEXT: memref.alloca() {alignment = 64 : i64, custom_attr}
// CHECK-NEXT: return