LLVM 20.0.0git
Public Member Functions | List of all members
llvm::SDPatternMatch::BasicMatchContext Class Reference

MatchContext can repurpose existing patterns to behave differently under a certain context. More...

#include "llvm/CodeGen/SDPatternMatch.h"

Public Member Functions

 BasicMatchContext (const SelectionDAG *DAG)
 
 BasicMatchContext (const TargetLowering *TLI)
 
const SelectionDAGgetDAG () const
 
const TargetLoweringgetTLI () const
 
bool match (SDValue N, unsigned Opcode) const
 Return true if N effectively has opcode Opcode.
 
unsigned getNumOperands (SDValue N) const
 

Detailed Description

MatchContext can repurpose existing patterns to behave differently under a certain context.

For instance, m_Opc(ISD::ADD) matches plain ADD nodes in normal circumstances, but matches VP_ADD nodes under a custom VPMatchContext. This design is meant to facilitate code / pattern reusing.

Definition at line 29 of file SDPatternMatch.h.

Constructor & Destructor Documentation

◆ BasicMatchContext() [1/2]

llvm::SDPatternMatch::BasicMatchContext::BasicMatchContext ( const SelectionDAG DAG)
inlineexplicit

Definition at line 34 of file SDPatternMatch.h.

◆ BasicMatchContext() [2/2]

llvm::SDPatternMatch::BasicMatchContext::BasicMatchContext ( const TargetLowering TLI)
inlineexplicit

Definition at line 37 of file SDPatternMatch.h.

Member Function Documentation

◆ getDAG()

const SelectionDAG * llvm::SDPatternMatch::BasicMatchContext::getDAG ( ) const
inline

Definition at line 42 of file SDPatternMatch.h.

◆ getNumOperands()

unsigned llvm::SDPatternMatch::BasicMatchContext::getNumOperands ( SDValue  N) const
inline

Definition at line 51 of file SDPatternMatch.h.

References N.

◆ getTLI()

const TargetLowering * llvm::SDPatternMatch::BasicMatchContext::getTLI ( ) const
inline

Definition at line 44 of file SDPatternMatch.h.

◆ match()

bool llvm::SDPatternMatch::BasicMatchContext::match ( SDValue  N,
unsigned  Opcode 
) const
inline

Return true if N effectively has opcode Opcode.

Definition at line 47 of file SDPatternMatch.h.

References N.


The documentation for this class was generated from the following file: