AMDGPU: Pattern match ffbh pattern to instruction.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 11 Jan 2016 17:02:00 +0000 (17:02 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 11 Jan 2016 17:02:00 +0000 (17:02 +0000)
commitf12a12cd25602e8447aeb3d49313bed3f29a2c68
treebf0dc08903860e70ad7c04d52fcd3da70e617520
parentd9ff2aaafdd3572f02848cd21d08c5d1c279ca33
AMDGPU: Pattern match ffbh pattern to instruction.

The hardware instruction's output on 0 is -1 rather than 32.
Eliminate a test and select to -1. This removes an extra instruction
from the compatability function with HSAIL's firstbit instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257352 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.h
lib/Target/AMDGPU/AMDGPUInstrInfo.td
lib/Target/AMDGPU/EvergreenInstructions.td
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIInstructions.td
test/CodeGen/AMDGPU/ctlz.ll
test/CodeGen/AMDGPU/ctlz_zero_undef.ll