Skip to content

Commit 6aa3346

Browse files
committed
[Flang] Fix omp target alloc mem lowering
C-P from ivanradanov commit 73fd865
1 parent 688cbaa commit 6aa3346

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flang/lib/Optimizer/CodeGen/CodeGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ struct OmpTargetAllocMemOpConversion
12031203
mlir::Value size = genTypeSizeInBytes(loc, ity, rewriter, llvmObjectTy);
12041204
if (auto scaleSize = genAllocationScaleSize(heap, ity, rewriter))
12051205
size = rewriter.create<mlir::LLVM::MulOp>(loc, ity, size, scaleSize);
1206-
for (mlir::Value opnd : adaptor.getOperands())
1206+
for (mlir::Value opnd : adaptor.getOperands().drop_front())
12071207
size = rewriter.create<mlir::LLVM::MulOp>(
12081208
loc, ity, size, integerCast(loc, rewriter, ity, opnd));
12091209
auto mallocTyWidth = lowerTy().getIndexTypeBitwidth();

0 commit comments

Comments
 (0)