Skip to content

Commit 1b9a0bb

Browse files
Merge branch 'main' into breakpoint_change_notif
2 parents dd427aa + eaedab2 commit 1b9a0bb

File tree

6 files changed

+22
-10
lines changed

6 files changed

+22
-10
lines changed

flang/lib/Optimizer/Builder/IntrinsicCall.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3106,7 +3106,9 @@ IntrinsicLibrary::genAtomicCas(mlir::Type resultType,
31063106
.getResult(0);
31073107
auto cmpxchg = mlir::LLVM::AtomicCmpXchgOp::create(
31083108
builder, loc, address, arg1, arg2, successOrdering, failureOrdering);
3109-
return mlir::LLVM::ExtractValueOp::create(builder, loc, cmpxchg, 1);
3109+
mlir::Value boolResult =
3110+
mlir::LLVM::ExtractValueOp::create(builder, loc, cmpxchg, 1);
3111+
return builder.createConvert(loc, resultType, boolResult);
31103112
}
31113113

31123114
mlir::Value IntrinsicLibrary::genAtomicDec(mlir::Type resultType,

flang/test/Lower/CUDA/cuda-device-proc.cuf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,3 +479,16 @@ end subroutine
479479

480480
! CHECK-LABEL: func.func @_QPtest_bulk_s2g
481481
! CHECL: nvvm.cp.async.bulk.global.shared.cta %{{.*}}, %{{.*}}, %{{.*}} : <1>, <3>
482+
483+
attributes(device) subroutine testAtomicCasLoop(aa, n)
484+
integer :: a
485+
do while (atomiccas(a, 0, 1) == 1)
486+
end do
487+
end subroutine
488+
489+
! CHECK-LABEL: func.func @_QPtestatomiccasloop
490+
! CHECK: %[[CMP_XCHG:.*]] = llvm.cmpxchg %15, %c0_i32, %c1_i32 acq_rel monotonic : !llvm.ptr, i32
491+
! CHECK: %[[CMP_XCHG_EV:.*]] = llvm.extractvalue %[[CMP_XCHG]][1] : !llvm.struct<(i32, i1)>
492+
! CHECK: %[[CASTED_CMP_XCHG_EV:.*]] = fir.convert %[[CMP_XCHG_EV]] : (i1) -> i32
493+
! CHECK: %{{.*}} = arith.constant 1 : i32
494+
! CHECK: %19 = arith.cmpi eq, %[[CASTED_CMP_XCHG_EV]], %{{.*}} : i32

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,8 @@ AMDGPUTargetLowering::AMDGPUTargetLowering(const TargetMachine &TM,
514514
MVT::i64, Custom);
515515
setOperationAction(ISD::SELECT_CC, MVT::i64, Expand);
516516

517-
setOperationAction({ISD::ABS, ISD::SMIN, ISD::UMIN, ISD::SMAX, ISD::UMAX},
518-
MVT::i32, Legal);
517+
setOperationAction({ISD::SMIN, ISD::UMIN, ISD::SMAX, ISD::UMAX}, MVT::i32,
518+
Legal);
519519

520520
setOperationAction(
521521
{ISD::CTTZ, ISD::CTTZ_ZERO_UNDEF, ISD::CTLZ, ISD::CTLZ_ZERO_UNDEF},

llvm/lib/Target/AMDGPU/R600ISelLowering.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ R600TargetLowering::R600TargetLowering(const TargetMachine &TM,
4545
// Legalize loads and stores to the private address space.
4646
setOperationAction(ISD::LOAD, {MVT::i32, MVT::v2i32, MVT::v4i32}, Custom);
4747

48-
// 32-bit ABS is legal for AMDGPU except for R600
49-
setOperationAction(ISD::ABS, MVT::i32, Expand);
50-
5148
// EXTLOAD should be the same as ZEXTLOAD. It is legal for some address
5249
// spaces, so it is custom lowered to handle those where it isn't.
5350
for (auto Op : {ISD::SEXTLOAD, ISD::ZEXTLOAD, ISD::EXTLOAD})

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM,
298298
setOperationAction(ISD::BR_CC,
299299
{MVT::i1, MVT::i32, MVT::i64, MVT::f32, MVT::f64}, Expand);
300300

301-
setOperationAction({ISD::UADDO, ISD::USUBO}, MVT::i32, Legal);
301+
setOperationAction({ISD::ABS, ISD::UADDO, ISD::USUBO}, MVT::i32, Legal);
302302

303303
setOperationAction({ISD::UADDO_CARRY, ISD::USUBO_CARRY}, MVT::i32, Legal);
304304

mlir/lib/Target/SPIRV/Serialization/Serializer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ static std::string getDecorationName(StringRef attrName) {
260260
}
261261

262262
template <typename AttrTy, typename EmitF>
263-
LogicalResult processDecorationList(Location loc, Decoration decoration,
264-
Attribute attrList, StringRef attrName,
265-
EmitF emitter) {
263+
static LogicalResult processDecorationList(Location loc, Decoration decoration,
264+
Attribute attrList,
265+
StringRef attrName, EmitF emitter) {
266266
auto arrayAttr = dyn_cast<ArrayAttr>(attrList);
267267
if (!arrayAttr) {
268268
return emitError(loc, "expecting array attribute of ")

0 commit comments

Comments
 (0)