LLVM 20.0.0git
|
#include "Target/Hexagon/MCTargetDesc/HexagonShuffler.h"
Public Types | |
using | iterator = HexagonPacket::iterator |
using | const_iterator = HexagonPacket::const_iterator |
using | packet_range = iterator_range< HexagonPacket::iterator > |
using | const_packet_range = iterator_range< HexagonPacket::const_iterator > |
using | InstPredicate = bool(*)(MCInstrInfo const &, MCInst const &) |
Public Member Functions | |
HexagonShuffler (MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI) | |
void | reset () |
bool | check (const bool RequireShuffle=true) |
Check that the packet is legal and enforce relative insn order. | |
bool | shuffle () |
unsigned | size () const |
bool | isMemReorderDisabled () const |
iterator | begin () |
iterator | end () |
const_iterator | cbegin () const |
const_iterator | cend () const |
packet_range | insts (HexagonPacket &P) |
const_packet_range | insts (HexagonPacket const &P) const |
packet_range | insts () |
const_packet_range | insts () const |
bool | HasInstWith (InstPredicate Pred) const |
void | append (MCInst const &ID, MCInst const *Extender, unsigned S) |
void | reportError (Twine const &Msg) |
void | reportResourceError (HexagonPacketSummary const &Summary, StringRef Err) |
void | reportResourceUsage (HexagonPacketSummary const &Summary) |
Protected Member Functions | |
bool | applySlotRestrictions (HexagonPacketSummary const &Summary, const bool DoShuffle) |
void | restrictSlot1AOK (HexagonPacketSummary const &Summary) |
void | restrictNoSlot1Store (HexagonPacketSummary const &Summary) |
void | restrictNoSlot1 () |
bool | restrictStoreLoadOrder (HexagonPacketSummary const &Summary) |
void | restrictBranchOrder (HexagonPacketSummary const &Summary) |
void | restrictPreferSlot3 (HexagonPacketSummary const &Summary, const bool DoShuffle) |
void | permitNonSlot () |
std::optional< HexagonPacket > | tryAuction (HexagonPacketSummary const &Summary) |
HexagonPacketSummary | GetPacketSummary () |
bool | ValidPacketMemoryOps (HexagonPacketSummary const &Summary) const |
bool | ValidResourceUsage (HexagonPacketSummary const &Summary) |
Protected Attributes | |
MCContext & | Context |
int64_t | BundleFlags |
MCInstrInfo const & | MCII |
MCSubtargetInfo const & | STI |
SMLoc | Loc |
bool | ReportErrors |
bool | CheckFailure |
std::vector< std::pair< SMLoc, std::string > > | AppliedRestrictions |
Definition at line 132 of file HexagonShuffler.h.
Definition at line 190 of file HexagonShuffler.h.
Definition at line 192 of file HexagonShuffler.h.
using llvm::HexagonShuffler::InstPredicate = bool (*)(MCInstrInfo const &, MCInst const &) |
Definition at line 223 of file HexagonShuffler.h.
Definition at line 189 of file HexagonShuffler.h.
Definition at line 191 of file HexagonShuffler.h.
HexagonShuffler::HexagonShuffler | ( | MCContext & | Context, |
bool | ReportErrors, | ||
MCInstrInfo const & | MCII, | ||
MCSubtargetInfo const & | STI | ||
) |
Definition at line 168 of file HexagonShuffler.cpp.
References reset().
Definition at line 182 of file HexagonShuffler.cpp.
References MCII, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and STI.
|
protected |
Definition at line 249 of file HexagonShuffler.cpp.
References CheckFailure, permitNonSlot(), restrictBranchOrder(), restrictNoSlot1Store(), restrictPreferSlot3(), restrictSlot1AOK(), and restrictStoreLoadOrder().
Referenced by check().
|
inline |
Definition at line 210 of file HexagonShuffler.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
Referenced by GetPacketSummary(), insts(), and restrictStoreLoadOrder().
|
inline |
Definition at line 212 of file HexagonShuffler.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin().
Referenced by insts().
|
inline |
Definition at line 213 of file HexagonShuffler.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by insts().
Check that the packet is legal and enforce relative insn order.
Definition at line 611 of file HexagonShuffler.cpp.
References applySlotRestrictions(), CheckFailure, GetPacketSummary(), reportError(), ValidPacketMemoryOps(), and ValidResourceUsage().
Referenced by shuffle().
|
inline |
Definition at line 211 of file HexagonShuffler.h.
References llvm::SmallVectorTemplateCommon< T, typename >::end().
Referenced by GetPacketSummary(), insts(), and restrictStoreLoadOrder().
|
protected |
Definition at line 452 of file HexagonShuffler.cpp.
References AppliedRestrictions, assert(), begin(), end(), llvm::HexagonMCInstrInfo::getDesc(), llvm::HexagonMCInstrInfo::getOtherReservedSlots(), llvm::HexagonMCInstrInfo::getType(), llvm::HexagonMCInstrInfo::IsABranchingInst(), isBranch(), llvm::HexagonMCInstrInfo::isRestrictNoSlot1Store(), llvm::HexagonMCInstrInfo::isRestrictSlot1AOK(), MCII, llvm::HexagonMCInstrInfo::prefersSlot3(), SlotMaskToText(), slotSingleLoad, slotSingleStore, STI, llvm::HexagonII::TypeALU64, llvm::HexagonII::TypeCJ, llvm::HexagonII::TypeCR, llvm::HexagonII::TypeCVI_GATHER, llvm::HexagonII::TypeCVI_GATHER_DV, llvm::HexagonII::TypeCVI_GATHER_RST, llvm::HexagonII::TypeCVI_SCATTER, llvm::HexagonII::TypeCVI_SCATTER_DV, llvm::HexagonII::TypeCVI_SCATTER_NEW_RST, llvm::HexagonII::TypeCVI_SCATTER_NEW_ST, llvm::HexagonII::TypeCVI_SCATTER_RST, llvm::HexagonII::TypeCVI_VM_LD, llvm::HexagonII::TypeCVI_VM_NEW_ST, llvm::HexagonII::TypeCVI_VM_ST, llvm::HexagonII::TypeCVI_VM_STU, llvm::HexagonII::TypeCVI_VM_TMP_LD, llvm::HexagonII::TypeCVI_VM_VP_LDU, llvm::HexagonII::TypeCVI_ZW, llvm::HexagonII::TypeDUPLEX, llvm::HexagonII::TypeJ, llvm::HexagonII::TypeLD, llvm::HexagonII::TypeNCJ, llvm::HexagonII::TypeS_2op, llvm::HexagonII::TypeS_3op, llvm::HexagonII::TypeST, llvm::HexagonII::TypeV2LDST, and llvm::HexagonII::TypeV4LDST.
Referenced by check().
|
inline |
Definition at line 225 of file HexagonShuffler.h.
References llvm::any_of(), I, insts(), and MCII.
|
inline |
Definition at line 220 of file HexagonShuffler.h.
References begin(), end(), and llvm::make_range().
Referenced by HasInstWith(), permitNonSlot(), reportResourceUsage(), restrictNoSlot1Store(), restrictPreferSlot3(), restrictSlot1AOK(), restrictStoreLoadOrder(), shuffle(), and tryAuction().
|
inline |
Definition at line 221 of file HexagonShuffler.h.
References cbegin(), cend(), and llvm::make_range().
|
inline |
Definition at line 214 of file HexagonShuffler.h.
References llvm::make_range(), and P.
|
inline |
Definition at line 217 of file HexagonShuffler.h.
References llvm::make_range(), and P.
|
inline |
Definition at line 206 of file HexagonShuffler.h.
References BundleFlags, and llvm::HexagonMCInstrInfo::memReorderDisabledMask.
Referenced by restrictStoreLoadOrder().
|
protected |
Definition at line 311 of file HexagonShuffler.cpp.
References insts(), llvm::HexagonMCInstrInfo::requiresSlot(), and STI.
Referenced by applySlotRestrictions().
Definition at line 732 of file HexagonShuffler.cpp.
References AppliedRestrictions, CheckFailure, Context, llvm::SourceMgr::DK_Note, llvm::MCContext::getSourceManager(), I, Loc, llvm::SourceMgr::PrintMessage(), llvm::MCContext::reportError(), and ReportErrors.
Referenced by check(), reportResourceError(), restrictBranchOrder(), restrictStoreLoadOrder(), shuffle(), and ValidResourceUsage().
Definition at line 706 of file HexagonShuffler.cpp.
References reportError(), ReportErrors, and reportResourceUsage().
Referenced by restrictBranchOrder(), and ValidResourceUsage().
void HexagonShuffler::reportResourceUsage | ( | HexagonPacketSummary const & | Summary | ) |
Definition at line 713 of file HexagonShuffler.cpp.
References Context, llvm::SourceMgr::DK_Note, llvm::MCContext::getSourceManager(), I, insts(), llvm::HexagonMCInstrInfo::isImmext(), llvm::HexagonMCInstrInfo::requiresSlot(), SlotMaskToText(), and STI.
Referenced by reportResourceError().
void HexagonShuffler::reset | ( | ) |
Definition at line 176 of file HexagonShuffler.cpp.
References BundleFlags, CheckFailure, and llvm::SmallVectorImpl< T >::clear().
Referenced by HexagonShuffler().
|
protected |
Definition at line 271 of file HexagonShuffler.cpp.
References reportError(), reportResourceError(), and tryAuction().
Referenced by applySlotRestrictions().
|
protected |
|
protected |
Definition at line 219 of file HexagonShuffler.cpp.
References AppliedRestrictions, llvm::HexagonMCInstrInfo::getDesc(), llvm::MCInst::getLoc(), insts(), MCII, and Slot1Mask.
Referenced by applySlotRestrictions().
|
protected |
Definition at line 585 of file HexagonShuffler.cpp.
References llvm::any_of(), llvm::HexagonResource::getUnits(), I, insts(), llvm::HexagonResource::setUnits(), Slot3Mask, and tryAuction().
Referenced by applySlotRestrictions().
|
protected |
Definition at line 196 of file HexagonShuffler.cpp.
References AppliedRestrictions, llvm::MCInst::getLoc(), llvm::HexagonMCInstrInfo::getType(), insts(), MCII, Slot1Mask, llvm::HexagonII::TypeALU32_2op, llvm::HexagonII::TypeALU32_3op, and llvm::HexagonII::TypeALU32_ADDI.
Referenced by applySlotRestrictions().
Definition at line 357 of file HexagonShuffler.cpp.
References begin(), end(), llvm::HexagonMCInstrInfo::getDesc(), I, insts(), isMemReorderDisabled(), llvm::MCInstrDesc::mayLoad(), MCII, llvm::none_of(), reportError(), Slot0Mask, Slot1Mask, slotSingleLoad, and slotSingleStore.
Referenced by applySlotRestrictions().
bool HexagonShuffler::shuffle | ( | ) |
Definition at line 653 of file HexagonShuffler.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), check(), llvm::dbgs(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::HexagonMCInstrInfo::getDesc(), llvm::MCInstrDesc::getOpcode(), HEXAGON_PACKET_SIZE, insts(), LLVM_DEBUG, MCII, reportError(), size(), and llvm::raw_ostream::write_hex().
Referenced by llvm::HexagonMCShuffler::reshuffleTo().
|
inline |
Definition at line 204 of file HexagonShuffler.h.
References llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::HexagonMCShuffle(), and shuffle().
|
protected |
Definition at line 628 of file HexagonShuffler.cpp.
References llvm::all_of(), llvm::dbgs(), llvm::format_hex(), llvm::HexagonMCInstrInfo::getName(), I, insts(), llvm::HexagonInstr::lessCore(), LLVM_DEBUG, MCII, and llvm::stable_sort().
Referenced by restrictBranchOrder(), restrictPreferSlot3(), and ValidResourceUsage().
Definition at line 572 of file HexagonShuffler.cpp.
Referenced by check().
Definition at line 319 of file HexagonShuffler.cpp.
References checkHVXPipes(), llvm::SmallVectorImpl< T >::clear(), I, CVIUnits::Lanes, llvm::HexagonInstr::lessCVI(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), reportError(), reportResourceError(), llvm::SmallVectorBase< Size_T >::size(), llvm::stable_sort(), tryAuction(), and CVIUnits::Units.
Referenced by check().
|
protected |
Definition at line 169 of file HexagonShuffler.h.
Referenced by GetPacketSummary(), reportError(), restrictNoSlot1Store(), and restrictSlot1AOK().
|
protected |
Definition at line 163 of file HexagonShuffler.h.
Referenced by llvm::HexagonMCShuffler::copyTo(), isMemReorderDisabled(), and reset().
|
protected |
Definition at line 168 of file HexagonShuffler.h.
Referenced by applySlotRestrictions(), check(), reportError(), and reset().
|
protected |
Definition at line 162 of file HexagonShuffler.h.
Referenced by reportError(), and reportResourceUsage().
|
protected |
Definition at line 166 of file HexagonShuffler.h.
Referenced by llvm::HexagonMCShuffler::copyTo(), and reportError().
|
protected |
Definition at line 164 of file HexagonShuffler.h.
Referenced by append(), GetPacketSummary(), HasInstWith(), restrictNoSlot1Store(), restrictSlot1AOK(), restrictStoreLoadOrder(), shuffle(), and tryAuction().
|
protected |
Definition at line 167 of file HexagonShuffler.h.
Referenced by reportError(), and reportResourceError().
|
protected |
Definition at line 165 of file HexagonShuffler.h.
Referenced by append(), GetPacketSummary(), permitNonSlot(), and reportResourceUsage().