@@ -2868,15 +2868,17 @@ mlir::Value IntrinsicLibrary::genAtomicOr(mlir::Type resultType,
2868
2868
}
2869
2869
2870
2870
// 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) {
2873
2874
assert (args.size () == 3 );
2874
2875
auto successOrdering = mlir::LLVM::AtomicOrdering::acq_rel;
2875
2876
auto failureOrdering = mlir::LLVM::AtomicOrdering::monotonic;
2876
2877
auto llvmPtrTy = mlir::LLVM::LLVMPointerType::get (resultType.getContext ());
2877
2878
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 ]);
2880
2882
2881
2883
auto bitCastFloat = [&](mlir::Value arg) -> mlir::Value {
2882
2884
if (mlir::isa<mlir::Float32Type>(arg.getType ()))
@@ -2897,7 +2899,7 @@ mlir::Value IntrinsicLibrary::genAtomicCas(mlir::Type resultType,
2897
2899
}
2898
2900
2899
2901
auto address =
2900
- builder.create <mlir::UnrealizedConversionCastOp>(loc, llvmPtrTy, args[ 0 ] )
2902
+ builder.create <mlir::UnrealizedConversionCastOp>(loc, llvmPtrTy, arg0 )
2901
2903
.getResult (0 );
2902
2904
auto cmpxchg = builder.create <mlir::LLVM::AtomicCmpXchgOp>(
2903
2905
loc, address, arg1, arg2, successOrdering, failureOrdering);
@@ -2914,13 +2916,16 @@ mlir::Value IntrinsicLibrary::genAtomicDec(mlir::Type resultType,
2914
2916
}
2915
2917
2916
2918
// 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) {
2919
2922
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 ());
2921
2926
2922
2927
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 );
2924
2929
}
2925
2930
2926
2931
mlir::Value IntrinsicLibrary::genAtomicInc (mlir::Type resultType,
0 commit comments