summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2018-02-07 04:47:59 +0000
committerTom Stellard <tstellar@redhat.com>2018-02-07 04:47:59 +0000
commit33445765dde8fa341d71500ae6f734b67de2f275 (patch)
tree66f49bb8fa0b26b9876a5c183c4cf616fa2c3a79
parente82e83fcce6d88c1850ab876f5ee0e2172f65e8e (diff)
downloadbcm5719-llvm-33445765dde8fa341d71500ae6f734b67de2f275.tar.gz
bcm5719-llvm-33445765dde8fa341d71500ae6f734b67de2f275.zip
AMDGPU/GlobalISel: Mark 32-bit G_FPTOUI as legal
Reviewers: arsenm Reviewed By: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, llvm-commits, t-tye Differential Revision: https://reviews.llvm.org/D42152 llvm-svn: 324446
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp3
-rw-r--r--llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fptoui.mir22
2 files changed, 25 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
index 4c83f1151c2..04faf6e37eb 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -54,6 +54,9 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo() {
setAction({G_FMUL, S32}, Legal);
+ setAction({G_FPTOUI, S32}, Legal);
+ setAction({G_FPTOUI, 1, S32}, Legal);
+
setAction({G_GEP, P1}, Legal);
setAction({G_GEP, P2}, Legal);
setAction({G_GEP, 1, S64}, Legal);
diff --git a/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fptoui.mir b/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fptoui.mir
new file mode 100644
index 00000000000..5c11d08a1eb
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fptoui.mir
@@ -0,0 +1,22 @@
+# RUN: llc -mtriple=amdgcn-mesa-mesa3d -run-pass=legalizer -global-isel %s -o - | FileCheck %s
+
+--- |
+ define void @test_fptoui() { ret void }
+...
+
+---
+name: test_fptoui
+registers:
+ - { id: 0, class: _ }
+ - { id: 1, class: _ }
+ - { id: 2, class: _ }
+body: |
+ bb.0:
+ liveins: $vgpr0
+ ; CHECK-LABEL: name: test_fptoui
+ ; CHECK: %1:_(s32) = G_FPTOUI %0
+
+ %0(s32) = COPY $vgpr0
+ %1(s32) = G_FPTOUI %0
+ $vgpr0 = COPY %1
+...
OpenPOWER on IntegriCloud