Skip to content

Commit

Permalink
[AMDGPU] Use a named predicate instead of a magic number.
Browse files Browse the repository at this point in the history
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64201

llvm-svn: 365294
  • Loading branch information
jayfoad committed Jul 8, 2019
1 parent 1deca50 commit 3890235
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,9 @@ 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.
CallInst *const Ballot =
B.CreateIntrinsic(Intrinsic::amdgcn_icmp,
{B.getInt64Ty(), B.getInt32Ty()},
{B.getInt32(1), B.getInt32(0), B.getInt32(33)});
CallInst *const Ballot = B.CreateIntrinsic(
Intrinsic::amdgcn_icmp, {B.getInt64Ty(), B.getInt32Ty()},
{B.getInt32(1), B.getInt32(0), B.getInt32(CmpInst::ICMP_NE)});

// 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
Expand Down

0 comments on commit 3890235

Please sign in to comment.