Skip to content

Commit

Permalink
AMDGPU/GlobalISel: Mark 32-bit integer constants as legal
Browse files Browse the repository at this point in the history
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/D33115

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302919 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tstellar committed May 12, 2017
1 parent f0dc104 commit f366f4c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo() {
const LLT P1 = LLT::pointer(1, 64);
const LLT P2 = LLT::pointer(2, 64);

setAction({G_CONSTANT, S32}, Legal);
setAction({G_CONSTANT, S64}, Legal);

setAction({G_GEP, P1}, Legal);
Expand Down
20 changes: 20 additions & 0 deletions test/CodeGen/AMDGPU/GlobalISel/legalize-constant.mir
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -O0 -run-pass=legalizer -global-isel %s -o - | FileCheck %s

--- |
define void @test_constant() {
entry:
ret void
}
...

---
name: test_constant
registers:
- { id: 0, class: _ }
body: |
bb.0.entry:
; CHECK-LABEL: name: test_constant
; CHECK: %0(s32) = G_CONSTANT i32 5
%0(s32) = G_CONSTANT i32 5
...

0 comments on commit f366f4c

Please sign in to comment.