[PATCH] D105104: [AMDGPU] PHI node cost should not be counted for the size and latency.

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 06:11:45 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe585b332e423: [AMDGPU] PHI node cost should not be counted for the size and latency. (authored by alex-t).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105104/new/

https://reviews.llvm.org/D105104

Files:
  llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll


Index: llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll
===================================================================
--- llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll
+++ llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll
@@ -8,7 +8,7 @@
 ; SPEED: estimated cost of 10 for instruction: ret void
 ; SIZE: estimated cost of 5 for instruction: br i1
 ; SIZE: estimated cost of 1 for instruction: br label
-; SIZE: estimated cost of 1 for instruction: %phi = phi i32 [
+; SIZE: estimated cost of 0 for instruction: %phi = phi i32 [
 ; SIZE: estimated cost of 1 for instruction: ret void
 define amdgpu_kernel void @test_br_cost(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 {
 bb0:
Index: llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -837,10 +837,6 @@
   }
   case Instruction::Ret:
     return SCost ? 1 : 10;
-  case Instruction::PHI:
-    // TODO: 1. A prediction phi won't be eliminated?
-    //       2. Estimate data copy instructions in this case.
-    return 1;
   }
   return BaseT::getCFInstrCost(Opcode, CostKind, I);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105104.355523.patch
Type: text/x-patch
Size: 1253 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210630/4f092f70/attachment.bin>


More information about the llvm-commits mailing list