Skip to content

Commit 98388f5

Browse files
committed
Don't process all inlinseAsm regs
Change-Id: I4afe3d78f83da3ab0f37d98047e9f5182c7c0610
1 parent a62e5c8 commit 98388f5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,13 +1110,12 @@ int GCNHazardRecognizer::checkInlineAsmHazards(MachineInstr *IA) {
11101110
const MachineOperand *Dst = getDstSelForwardingOperand(MI, ST);
11111111
// Assume inline asm reads the dst
11121112
if (Dst)
1113-
return true;
1113+
return IA->modifiesRegister(Dst->getReg(), &TRI) || IA->readsRegister(Dst->getReg(), &TRI);
11141114

11151115
if (MI.isInlineAsm()) {
11161116
// If MI is inline asm, assume it has dst forwarding hazard
1117-
for (auto &Op :
1118-
drop_begin(MI.operands(), InlineAsm::MIOp_FirstOperand)) {
1119-
if (Op.isReg() && IA->modifiesRegister(Op.getReg(), &TRI)) {
1117+
for (auto &Def : MI.all_defs()) {
1118+
if (IA->modifiesRegister(Def.getReg(), &TRI) || IA->readsRegister(Def.getReg(), &TRI)) {
11201119
return true;
11211120
}
11221121
}

0 commit comments

Comments
 (0)