Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit f94e4f3

Browse files
committed
AMDGPU/GlobalISel: Mark 32-bit G_FADD as legal
Reviewers: arsenm Reviewed By: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D38439 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316815 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent f84f672 commit f94e4f3

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo() {
4949

5050
setAction({G_FCONSTANT, S32}, Legal);
5151

52+
setAction({G_FADD, S32}, Legal);
53+
5254
setAction({G_FMUL, S32}, Legal);
5355

5456
setAction({G_GEP, P1}, Legal);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -run-pass=legalizer -global-isel %s -o - | FileCheck %s
2+
3+
--- |
4+
define void @test_fadd() {
5+
entry:
6+
ret void
7+
}
8+
9+
...
10+
11+
---
12+
name: test_fadd
13+
registers:
14+
- { id: 0, class: _ }
15+
- { id: 1, class: _ }
16+
- { id: 2, class: _ }
17+
body: |
18+
bb.0.entry:
19+
liveins: %vgpr0, %vgpr1
20+
; CHECK-LABEL: name: test_fadd
21+
; CHECK: %2:_(s32) = G_FADD %0, %1
22+
23+
%0(s32) = COPY %vgpr0
24+
%1(s32) = COPY %vgpr1
25+
%2(s32) = G_FADD %0, %1
26+
...

0 commit comments

Comments
 (0)