]> granicus.if.org Git - llvm/commitdiff
[AMDGPU] Use a named predicate instead of a magic number.
authorJay Foad <jay.foad@gmail.com>
Mon, 8 Jul 2019 07:04:58 +0000 (07:04 +0000)
committerJay Foad <jay.foad@gmail.com>
Mon, 8 Jul 2019 07:04:58 +0000 (07:04 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365294 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp

index 1c503c29d551282e3a3c694f56fe193c12b68f27..810861503be55f987c7e0cc4e79ed6f1afffe9e6 100644 (file)
@@ -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