diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2020-01-06 14:39:13 -0500 |
---|---|---|
committer | Matt Arsenault <arsenm2@gmail.com> | 2020-01-06 17:21:51 -0500 |
commit | 14d25052a2902dacdd73aa1714ba1fb639c1dedd (patch) | |
tree | 50984ad334cbd84cd93ecb1940e0554fcb81624d /llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp | |
parent | 5518a02a83e855edeff7d8b4db685ec5d1b4144e (diff) | |
download | bcm5719-llvm-14d25052a2902dacdd73aa1714ba1fb639c1dedd.tar.gz bcm5719-llvm-14d25052a2902dacdd73aa1714ba1fb639c1dedd.zip |
AMDGPU: Use ImmLeaf for inline immediate predicates
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp index 4de5578ca7c..aadec1a005b 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp @@ -2117,3 +2117,19 @@ void AMDGPUInstructionSelector::renderTruncImm32(MachineInstrBuilder &MIB, assert(CstVal && "Expected constant value"); MIB.addImm(CstVal.getValue()); } + +bool AMDGPUInstructionSelector::isInlineImmediate16(int64_t Imm) const { + return AMDGPU::isInlinableLiteral16(Imm, STI.hasInv2PiInlineImm()); +} + +bool AMDGPUInstructionSelector::isInlineImmediate32(int64_t Imm) const { + return AMDGPU::isInlinableLiteral32(Imm, STI.hasInv2PiInlineImm()); +} + +bool AMDGPUInstructionSelector::isInlineImmediate64(int64_t Imm) const { + return AMDGPU::isInlinableLiteral64(Imm, STI.hasInv2PiInlineImm()); +} + +bool AMDGPUInstructionSelector::isInlineImmediate(const APFloat &Imm) const { + return TII.isInlineConstant(Imm); +} |