diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp +++ b/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); } diff --git a/llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll b/llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll --- a/llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll +++ b/llvm/test/Analysis/CostModel/AMDGPU/control-flow.ll @@ -4,11 +4,9 @@ ; ALL-LABEL: 'test_br_cost' ; SPEED: estimated cost of 7 for instruction: br i1 ; SPEED: estimated cost of 4 for instruction: br label -; SPEED: estimated cost of 1 for instruction: %phi = phi i32 [ ; 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 1 for instruction: ret void define amdgpu_kernel void @test_br_cost(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 { bb0: