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)
commit283b995097f91f340f69b229d2554e95a87fbe10
tree940f6c73dd2086d3538614e46ca9e8bd20a027fe
parent025bb56a86cd9d681171e7033d003b4b76370b5d
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
llvm-svn: 340903
llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/VOP2Instructions.td
llvm/lib/Target/AMDGPU/VOP3Instructions.td
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.writelane.ll