]> granicus.if.org Git - llvm/commitdiff
AMDGPU/GlobalISel: Mark 32-bit G_FMUL as legal
authorTom Stellard <tstellar@redhat.com>
Wed, 2 Aug 2017 22:56:30 +0000 (22:56 +0000)
committerTom Stellard <tstellar@redhat.com>
Wed, 2 Aug 2017 22:56:30 +0000 (22:56 +0000)
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye

Differential Revision: https://reviews.llvm.org/D36218

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309898 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
test/CodeGen/AMDGPU/GlobalISel/legalize-fmul.mir [new file with mode: 0644]

index 21b2181b8ef70a03b79dbd882ec64aa222dfc174..7d7848cf9164b93132f9fdc0f297210bf9d7ee91 100644 (file)
@@ -53,6 +53,8 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo() {
 
   setAction({G_FCONSTANT, S32}, Legal);
 
+  setAction({G_FMUL, S32}, Legal);
+
   setAction({G_GEP, P1}, Legal);
   setAction({G_GEP, P2}, Legal);
   setAction({G_GEP, 1, S64}, Legal);
diff --git a/test/CodeGen/AMDGPU/GlobalISel/legalize-fmul.mir b/test/CodeGen/AMDGPU/GlobalISel/legalize-fmul.mir
new file mode 100644 (file)
index 0000000..2191ff4
--- /dev/null
@@ -0,0 +1,22 @@
+# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer -global-isel %s -o - | FileCheck %s
+
+--- |
+  define void @test_fmul() { ret void }
+...
+
+---
+name:            test_fmul
+registers:
+  - { id: 0, class: _ }
+  - { id: 1, class: _ }
+  - { id: 2, class: _ }
+body: |
+  bb.0:
+    liveins: %vgpr0, %vgpr1
+    ; CHECK-LABEL: name: test_fmul
+    ; CHECK: %2(s32) = G_FMUL %0, %1
+
+    %0(s32) = COPY %vgpr0
+    %1(s32) = COPY %vgpr1
+    %2(s32) = G_FMUL %0, %1
+...