[llvm] r297060 - AMDGPU/R600: Fix ALU clause markers use detection
Jan Vesely via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 6 12:10:05 PST 2017
Author: jvesely
Date: Mon Mar 6 14:10:05 2017
New Revision: 297060
URL: http://llvm.org/viewvc/llvm-project?rev=297060&view=rev
Log:
AMDGPU/R600: Fix ALU clause markers use detection
also exit early on kill instead of redefinition.
Differential Revision: https://reviews.llvm.org/D30230
Modified:
llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp
llvm/trunk/test/CodeGen/AMDGPU/r600.alu-limits.ll
Modified: llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp?rev=297060&r1=297059&r2=297060&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp Mon Mar 6 14:10:05 2017
@@ -196,6 +196,7 @@ private:
MachineBasicBlock::iterator Def,
MachineBasicBlock::iterator BBEnd) {
const R600RegisterInfo &TRI = TII->getRegisterInfo();
+ //TODO: change this to defs?
for (MachineInstr::const_mop_iterator
MOI = Def->operands_begin(),
MOE = Def->operands_end(); MOI != MOE; ++MOI) {
@@ -218,15 +219,17 @@ private:
if (AluInstCount >= TII->getMaxAlusPerClause())
return false;
+ // TODO: Is this true? kill flag appears to work OK below
// Register kill flags have been cleared by the time we get to this
// pass, but it is safe to assume that all uses of this register
// occur in the same basic block as its definition, because
// it is illegal for the scheduler to schedule them in
// different blocks.
- if (UseI->findRegisterUseOperandIdx(MOI->getReg()))
+ if (UseI->readsRegister(MOI->getReg()))
LastUseCount = AluInstCount;
- if (UseI != Def && UseI->findRegisterDefOperandIdx(MOI->getReg()) != -1)
+ // Exit early if the current use kills the register
+ if (UseI != Def && UseI->killsRegister(MOI->getReg()))
break;
}
if (LastUseCount)
Modified: llvm/trunk/test/CodeGen/AMDGPU/r600.alu-limits.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/r600.alu-limits.ll?rev=297060&r1=297059&r2=297060&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/r600.alu-limits.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/r600.alu-limits.ll Mon Mar 6 14:10:05 2017
@@ -1,8 +1,8 @@
; RUN: opt -loop-unroll -unroll-threshold=2000 -S < %s | llc -march=r600 -mcpu=cypress | FileCheck %s
-; XFAIL: *
; REQUIRES: asserts
-; CHECK: {{^}}@alu_limits:
+; CHECK: {{^}}alu_limits:
+; CHECK: CF_END
%struct.foo = type {i32, i32, i32}
More information about the llvm-commits
mailing list