summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-02-12 14:54:55 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-02-12 14:54:55 +0000
commit00ccd13c73a34cb5da8b2ba7a5a66123ab22b445 (patch)
treead5900d8b2b32258d9e0aa20dfd556d4f2bf65c3 /llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
parent996c66620ee22a795b1298a894eadaacda4efb01 (diff)
downloadbcm5719-llvm-00ccd13c73a34cb5da8b2ba7a5a66123ab22b445.tar.gz
bcm5719-llvm-00ccd13c73a34cb5da8b2ba7a5a66123ab22b445.zip
AMDGPU/GlobalISel: Only make f16 constants legal on f16 targets
We could deal with it, but there's no real point. llvm-svn: 353845
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
index 3319a04eced..ecf8e1b732e 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -149,8 +149,15 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST,
// Don't worry about the size constraint.
.legalIf(all(isPointer(0), isPointer(1)));
- getActionDefinitionsBuilder(G_FCONSTANT)
- .legalFor({S32, S64, S16});
+ if (ST.has16BitInsts()) {
+ getActionDefinitionsBuilder(G_FCONSTANT)
+ .legalFor({S32, S64, S16})
+ .clampScalar(0, S16, S64);
+ } else {
+ getActionDefinitionsBuilder(G_FCONSTANT)
+ .legalFor({S32, S64})
+ .clampScalar(0, S32, S64);
+ }
getActionDefinitionsBuilder(G_IMPLICIT_DEF)
.legalFor({S1, S32, S64, V2S32, V4S32, V2S16, V4S16, GlobalPtr,
OpenPOWER on IntegriCloud