Skip to content

Commit 3115963

Browse files
committed
added ret and no-ret opt tests for floating point
atomic ops with double type.
1 parent f79911d commit 3115963

File tree

3 files changed

+1247
-2
lines changed

3 files changed

+1247
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -921,8 +921,10 @@ void AMDGPUAtomicOptimizerImpl::optimizeAtomic(Instruction &I,
921921
Value *BroadcastI = nullptr;
922922

923923
if (TyBitWidth == 64) {
924-
Value *const ExtractLo = B.CreateTrunc(PHI, Int32Ty);
925-
Value *const ExtractHi = B.CreateTrunc(B.CreateLShr(PHI, 32), Int32Ty);
924+
Value *CastedPhi = B.CreateBitCast(PHI, IntNTy);
925+
Value *const ExtractLo = B.CreateTrunc(CastedPhi, Int32Ty);
926+
Value *const ExtractHi =
927+
B.CreateTrunc(B.CreateLShr(CastedPhi, 32), Int32Ty);
926928
CallInst *const ReadFirstLaneLo =
927929
B.CreateIntrinsic(Intrinsic::amdgcn_readfirstlane, {}, ExtractLo);
928930
CallInst *const ReadFirstLaneHi =

0 commit comments

Comments
 (0)