OSDN Git Service

AMDGPU: Optimize VOP2 operand legalization
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Dec 2015 19:57:17 +0000 (19:57 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Dec 2015 19:57:17 +0000 (19:57 +0000)
commitdc53fde2a4db54e23bbda116cf66e9557ed2487f
tree2a33695d478b8305c6ea68478898bb5d6d63da2a
parent76c60c37de0a6250ce3be524e121d95ba7035c2e
AMDGPU: Optimize VOP2 operand legalization

Don't use commuteInstruction, and don't commute if
doing so will not improve legality. Skip the more
complex checks for literal operands and constant bus restrictions,
which are not a concern for VOP2 instructions because src1
does not accept SGPRs or constants and few implicitly
read vcc.

This gets called quite a few times and the
attempts at commuting are a significant fraction
of the time spent in SIFixSGPRCopies, so it's
somewhat worthwhile to optimize. With this patch and others
leading up to it, this reduces the compile time of SIFixSGPRCopies
on some of the LuxMark 2 kernels from ~8ms to ~5ms on my system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254452 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIInstrInfo.h
lib/Target/AMDGPU/SIRegisterInfo.h