Skip to content

Commit 22f4a2e

Browse files
committed
fix ambiguity
1 parent 9ceb506 commit 22f4a2e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

flang/lib/Optimizer/CodeGen/CodeGen.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,8 @@ struct ConvertOpConversion : public fir::FIROpConversion<fir::ConvertOp> {
878878
auto rc = convertFpToFp(rp, fromBits, toBits, nt);
879879
auto ic = convertFpToFp(ip, fromBits, toBits, nt);
880880
auto un = mlir::LLVM::UndefOp::create(rewriter, loc, toTy);
881-
auto i1 = mlir::LLVM::InsertValueOp::create(rewriter, loc, un, rc, 0);
881+
llvm::SmallVector<int64_t> pos{0};
882+
auto i1 = mlir::LLVM::InsertValueOp::create(rewriter, loc, un, rc, pos);
882883
rewriter.replaceOpWithNewOp<mlir::LLVM::InsertValueOp>(convert, i1, ic,
883884
1);
884885
return mlir::success();
@@ -1038,8 +1039,9 @@ struct EmboxCharOpConversion : public fir::FIROpConversion<fir::EmboxCharOp> {
10381039
charBuffer =
10391040
mlir::LLVM::BitcastOp::create(rewriter, loc, addrTy, charBuffer);
10401041

1042+
llvm::SmallVector<int64_t> pos{0};
10411043
auto insertBufferOp = mlir::LLVM::InsertValueOp::create(
1042-
rewriter, loc, llvmStruct, charBuffer, 0);
1044+
rewriter, loc, llvmStruct, charBuffer, pos);
10431045
rewriter.replaceOpWithNewOp<mlir::LLVM::InsertValueOp>(
10441046
emboxChar, insertBufferOp, lenAfterCast, 1);
10451047

@@ -3888,7 +3890,8 @@ complexSum(OPTY sumop, mlir::ValueRange opnds,
38883890
auto rx = LLVMOP::create(rewriter, loc, eleTy, x0, x1, fmf);
38893891
auto ry = LLVMOP::create(rewriter, loc, eleTy, y0, y1, fmf);
38903892
auto r0 = mlir::LLVM::UndefOp::create(rewriter, loc, ty);
3891-
auto r1 = mlir::LLVM::InsertValueOp::create(rewriter, loc, r0, rx, 0);
3893+
llvm::SmallVector<int64_t> pos{0};
3894+
auto r1 = mlir::LLVM::InsertValueOp::create(rewriter, loc, r0, rx, pos);
38923895
return mlir::LLVM::InsertValueOp::create(rewriter, loc, r1, ry, 1);
38933896
}
38943897
} // namespace
@@ -3951,7 +3954,8 @@ struct MulcOpConversion : public fir::FIROpConversion<fir::MulcOp> {
39513954
auto yy = mlir::LLVM::FMulOp::create(rewriter, loc, eleTy, y0, y1, fmf);
39523955
auto rr = mlir::LLVM::FSubOp::create(rewriter, loc, eleTy, xx, yy, fmf);
39533956
auto ra = mlir::LLVM::UndefOp::create(rewriter, loc, ty);
3954-
auto r1 = mlir::LLVM::InsertValueOp::create(rewriter, loc, ra, rr, 0);
3957+
llvm::SmallVector<int64_t> pos{0};
3958+
auto r1 = mlir::LLVM::InsertValueOp::create(rewriter, loc, ra, rr, pos);
39553959
auto r0 = mlir::LLVM::InsertValueOp::create(rewriter, loc, r1, ri, 1);
39563960
rewriter.replaceOp(mulc, r0.getResult());
39573961
return mlir::success();
@@ -3991,7 +3995,8 @@ struct DivcOpConversion : public fir::FIROpConversion<fir::DivcOp> {
39913995
auto rr = mlir::LLVM::FDivOp::create(rewriter, loc, eleTy, rrn, d, fmf);
39923996
auto ri = mlir::LLVM::FDivOp::create(rewriter, loc, eleTy, rin, d, fmf);
39933997
auto ra = mlir::LLVM::UndefOp::create(rewriter, loc, ty);
3994-
auto r1 = mlir::LLVM::InsertValueOp::create(rewriter, loc, ra, rr, 0);
3998+
llvm::SmallVector<int64_t> pos{0};
3999+
auto r1 = mlir::LLVM::InsertValueOp::create(rewriter, loc, ra, rr, pos);
39954000
auto r0 = mlir::LLVM::InsertValueOp::create(rewriter, loc, r1, ri, 1);
39964001
rewriter.replaceOp(divc, r0.getResult());
39974002
return mlir::success();
@@ -4014,7 +4019,8 @@ struct NegcOpConversion : public fir::FIROpConversion<fir::NegcOp> {
40144019
auto ip = mlir::LLVM::ExtractValueOp::create(rewriter, loc, o0, 1);
40154020
auto nrp = mlir::LLVM::FNegOp::create(rewriter, loc, eleTy, rp);
40164021
auto nip = mlir::LLVM::FNegOp::create(rewriter, loc, eleTy, ip);
4017-
auto r = mlir::LLVM::InsertValueOp::create(rewriter, loc, o0, nrp, 0);
4022+
llvm::SmallVector<int64_t> pos{0};
4023+
auto r = mlir::LLVM::InsertValueOp::create(rewriter, loc, o0, nrp, pos);
40184024
rewriter.replaceOpWithNewOp<mlir::LLVM::InsertValueOp>(neg, r, nip, 1);
40194025
return mlir::success();
40204026
}

0 commit comments

Comments
 (0)