This is an archive of the discontinued LLVM Phabricator instance.

[AggressiveAntiDepBreaker] Handle predicate operands better
Needs ReviewPublic

Authored by jmolloy on Apr 23 2019, 7:49 AM.

Details

Reviewers
hfinkel
Summary

[note: I tried hard to make a test for this. I thought Hexagon might be a good target, but alas it has a control register that aliases all of its predicate registers, which makes AggressiveAntiDependencyBreaker bail out even after this patch]

For targets that have a predicate register class, we want to be able to break antidepedencies in that regclass. This patch enhances AggressiveAntiDepBreaker to understand that even though an instruction is predicated, it may still unconditionally read the predicate operand and so can be handled by the existing logic.

To do this, a target hook is created. No test as no targets have this functionality.

Diff Detail

Repository
rL LLVM

Event Timeline

jmolloy created this revision.Apr 23 2019, 7:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2019, 7:49 AM

Why don't we always do this? Isn't assuming that the register is always read the conservatively-correct thing to do here?

include/llvm/CodeGen/TargetInstrInfo.h
1253

We'd need to document whether Reg must already occur as a read register in one of the MI's MO, or if this function should simply return false in this case.