From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp') diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp index 59aa0ea98aa79..c9d25d4250d55 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp @@ -438,7 +438,7 @@ void AMDGPUAtomicOptimizer::optimizeAtomic(Instruction &I, Type *const Ty = I.getType(); const unsigned TyBitWidth = DL->getTypeSizeInBits(Ty); - Type *const VecTy = VectorType::get(B.getInt32Ty(), 2); + auto *const VecTy = FixedVectorType::get(B.getInt32Ty(), 2); // This is the value in the atomic operation we need to combine in order to // reduce the number of atomic operations. @@ -447,9 +447,8 @@ void AMDGPUAtomicOptimizer::optimizeAtomic(Instruction &I, // We need to know how many lanes are active within the wavefront, and we do // this by doing a ballot of active lanes. Type *const WaveTy = B.getIntNTy(ST->getWavefrontSize()); - CallInst *const Ballot = B.CreateIntrinsic( - Intrinsic::amdgcn_icmp, {WaveTy, B.getInt32Ty()}, - {B.getInt32(1), B.getInt32(0), B.getInt32(CmpInst::ICMP_NE)}); + CallInst *const Ballot = + B.CreateIntrinsic(Intrinsic::amdgcn_ballot, WaveTy, B.getTrue()); // We need to know how many lanes are active within the wavefront that are // below us. If we counted each lane linearly starting from 0, a lane is -- cgit v1.2.3