This is an archive of the discontinued LLVM Phabricator instance.

[TargetInstrInfo] Add TargetInstrInfo interface isProfitableToBranch.
AbandonedPublic

Authored by bmakam on Feb 29 2016, 12:42 PM.

Details

Summary

Add TargetInstrInfo::isProfitableToBranch and implement for AArch64. This
implements heuristics to determine if it is profitable to branch from a
dominating head block that is terminated by the conditional branch into the compare
block that contains the compare instruction and the conditional branch.
AArch64ConditionalCompares pass uses this heuristics to decide on merging the compare
block into the head block. The heuristics are only enabled for Kryo subtarget.
NFC for subtargets other than Kryo.

Diff Detail

Event Timeline

bmakam updated this revision to Diff 49407.Feb 29 2016, 12:42 PM
bmakam retitled this revision from to [TargetInstrInfo] Add TargetInstrInfo interface isProfitableToBranch..
bmakam updated this object.
bmakam added reviewers: mcrosier, apazos.
bmakam added a subscriber: llvm-commits.
bmakam updated this object.Mar 14 2016, 9:48 AM
bmakam added reviewers: t.p.northover, jmolloy.
bmakam updated this object.
jmolloy requested changes to this revision.Apr 27 2016, 6:42 AM
jmolloy edited edge metadata.

Hi,

Sorry for how long it's taken - I only just saw this on my phab list.

I think this generally looks fine, but I don't see the need for isProfitableToBranch to be in TargetInstrInfo. You can simply put it in AArch64InstrInfo and query that directly in AArch64ConditionalCompares (much like is done in AArch64LdStOptimizer).

Cheers,

James

This revision now requires changes to proceed.Apr 27 2016, 6:42 AM
bmakam abandoned this revision.May 6 2016, 2:08 PM

Moved to a more general solution in D20030