[AMDGPU] Return better Changed status from AMDGPUPerfHintAnalysis
authorJay Foad <jay.foad@amd.com>
Wed, 16 Feb 2022 11:00:05 +0000 (11:00 +0000)
committerJay Foad <jay.foad@amd.com>
Thu, 17 Feb 2022 09:31:42 +0000 (09:31 +0000)
Differential Revision: https://reviews.llvm.org/D119944

llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.cpp

index 8ad3448..de97b76 100644 (file)
@@ -267,19 +267,23 @@ bool AMDGPUPerfHint::runOnFunction(Function &F) {
                     << " LSMInst cost: " << Info->LSMInstCost << '\n'
                     << " TotalInst cost: " << Info->InstCost << '\n');
 
+  bool Changed = false;
+
   if (isMemBound(*Info)) {
     LLVM_DEBUG(dbgs() << F.getName() << " is memory bound\n");
     NumMemBound++;
     F.addFnAttr("amdgpu-memory-bound", "true");
+    Changed = true;
   }
 
   if (AMDGPU::isEntryFunctionCC(F.getCallingConv()) && needLimitWave(*Info)) {
     LLVM_DEBUG(dbgs() << F.getName() << " needs limit wave\n");
     NumLimitWave++;
     F.addFnAttr("amdgpu-wave-limiter", "true");
+    Changed = true;
   }
 
-  return true;
+  return Changed;
 }
 
 bool AMDGPUPerfHint::isMemBound(const AMDGPUPerfHintAnalysis::FuncInfo &FI) {