This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] deduplicate tablegen predicates
ClosedPublic

Authored by rampitec on Nov 4 2019, 11:57 AM.

Details

Summary

We are duplicating predicates if several parts of the combined
predicate list contain the same condition. Added code to deduplicate
the list.

We have AssemblerPredicates and AssemblerPredicate in the
PredicateControl, but we never use AssemblerPredicates with an
actual list, so this one is dropped.

This addresses the first part of the llvm bug 43886:
https://bugs.llvm.org/show_bug.cgi?id=43886

Diff Detail

Event Timeline

rampitec created this revision.Nov 4 2019, 11:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2019, 11:57 AM

Where are the redundant settings coming from?

llvm/lib/Target/AMDGPU/AMDGPUInstructions.td
81–84

Should add comment that this deduplicates

rampitec marked an inline comment as done.Nov 4 2019, 12:09 PM

Where are the redundant settings coming from?

For example in MIMG:

let SubtargetPredicate = isGFX6GFX7GFX8GFX9;
let AssemblerPredicate = isGFX6GFX7GFX8GFX9;

This is the obvious place, but it is in fact hard to track when we start coping predicates from pseudos to real instructions and then concat all of that.

rampitec updated this revision to Diff 227756.Nov 4 2019, 12:09 PM

Added comment.

arsenm accepted this revision.Nov 4 2019, 12:14 PM

LGTM

This revision is now accepted and ready to land.Nov 4 2019, 12:14 PM
This revision was automatically updated to reflect the committed changes.