@@ -2868,15 +2868,17 @@ mlir::Value IntrinsicLibrary::genAtomicOr(mlir::Type resultType,
28682868}
28692869
28702870// ATOMICCAS
2871- mlir::Value IntrinsicLibrary::genAtomicCas (mlir::Type resultType,
2872- llvm::ArrayRef<mlir::Value> args) {
2871+ fir::ExtendedValue
2872+ IntrinsicLibrary::genAtomicCas (mlir::Type resultType,
2873+ llvm::ArrayRef<fir::ExtendedValue> args) {
28732874 assert (args.size () == 3 );
28742875 auto successOrdering = mlir::LLVM::AtomicOrdering::acq_rel;
28752876 auto failureOrdering = mlir::LLVM::AtomicOrdering::monotonic;
28762877 auto llvmPtrTy = mlir::LLVM::LLVMPointerType::get (resultType.getContext ());
28772878
2878- mlir::Value arg1 = args[1 ];
2879- mlir::Value arg2 = args[2 ];
2879+ mlir::Value arg0 = fir::getBase (args[0 ]);
2880+ mlir::Value arg1 = fir::getBase (args[1 ]);
2881+ mlir::Value arg2 = fir::getBase (args[2 ]);
28802882
28812883 auto bitCastFloat = [&](mlir::Value arg) -> mlir::Value {
28822884 if (mlir::isa<mlir::Float32Type>(arg.getType ()))
@@ -2897,7 +2899,7 @@ mlir::Value IntrinsicLibrary::genAtomicCas(mlir::Type resultType,
28972899 }
28982900
28992901 auto address =
2900- builder.create <mlir::UnrealizedConversionCastOp>(loc, llvmPtrTy, args[ 0 ] )
2902+ builder.create <mlir::UnrealizedConversionCastOp>(loc, llvmPtrTy, arg0 )
29012903 .getResult (0 );
29022904 auto cmpxchg = builder.create <mlir::LLVM::AtomicCmpXchgOp>(
29032905 loc, address, arg1, arg2, successOrdering, failureOrdering);
@@ -2914,13 +2916,16 @@ mlir::Value IntrinsicLibrary::genAtomicDec(mlir::Type resultType,
29142916}
29152917
29162918// ATOMICEXCH
2917- mlir::Value IntrinsicLibrary::genAtomicExch (mlir::Type resultType,
2918- llvm::ArrayRef<mlir::Value> args) {
2919+ fir::ExtendedValue
2920+ IntrinsicLibrary::genAtomicExch (mlir::Type resultType,
2921+ llvm::ArrayRef<fir::ExtendedValue> args) {
29192922 assert (args.size () == 2 );
2920- assert (args[1 ].getType ().isIntOrFloat ());
2923+ mlir::Value arg0 = fir::getBase (args[0 ]);
2924+ mlir::Value arg1 = fir::getBase (args[1 ]);
2925+ assert (arg1.getType ().isIntOrFloat ());
29212926
29222927 mlir::LLVM::AtomicBinOp binOp = mlir::LLVM::AtomicBinOp::xchg;
2923- return genAtomBinOp (builder, loc, binOp, args[ 0 ], args[ 1 ] );
2928+ return genAtomBinOp (builder, loc, binOp, arg0, arg1 );
29242929}
29252930
29262931mlir::Value IntrinsicLibrary::genAtomicInc (mlir::Type resultType,
0 commit comments