OSDN Git Service

AMDGPU: Fix getInstSizeInBytes
authorNicolai Haehnle <nhaehnle@gmail.com>
Wed, 29 Aug 2018 07:46:09 +0000 (07:46 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Wed, 29 Aug 2018 07:46:09 +0000 (07:46 +0000)
commit1209b727bc328be5e920545739a8308c1e867c38
tree31613342460b5a5da11271f1243f507af6c38880
parent10a4287278d70f44ea14cee48aef3697b2ef1321
AMDGPU: Fix getInstSizeInBytes

Summary:
Add some optional code to validate getInstSizeInBytes for emitted
instructions. This flushed out some issues which are fixed by this
patch:

- Streamline getInstSizeInBytes
- Properly define the VI readlane/writelane instruction as VOP3
- Fix the inline constant determination. Specifically, this change
  fixes an issue where a 32-bit value of 0xffffffff was recorded
  as unsigned. This is equal to -1 when restricting to a 32-bit
  comparison, and an inline constant can be used.

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

Change-Id: Id87c3b7975839da0de8156a124b0ce98c5fb47f2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340903 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/VOP2Instructions.td
lib/Target/AMDGPU/VOP3Instructions.td
test/CodeGen/AMDGPU/llvm.amdgcn.writelane.ll