Jlm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
jlm::llvm::PtrCmpOperation Class Referencefinal

#include <operators.hpp>

Inheritance diagram for jlm::llvm::PtrCmpOperation:
Inheritance graph
[legend]
Collaboration diagram for jlm::llvm::PtrCmpOperation:
Collaboration graph
[legend]

Public Member Functions

 ~PtrCmpOperation () noexcept override
 
 PtrCmpOperation (const std::shared_ptr< const PointerType > &ptype, ICmpPredicate predicate)
 
bool operator== (const Operation &other) const noexcept override
 
std::string debug_string () const override
 
std::unique_ptr< Operation > copy () const override
 
jlm::rvsdg::binop_reduction_path_t can_reduce_operand_pair (const jlm::rvsdg::Output *op1, const jlm::rvsdg::Output *op2) const noexcept override
 
jlm::rvsdg::Outputreduce_operand_pair (jlm::rvsdg::binop_reduction_path_t path, jlm::rvsdg::Output *op1, jlm::rvsdg::Output *op2) const override
 
ICmpPredicate predicate () const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::BinaryOperation
 ~BinaryOperation () noexcept override
 
 BinaryOperation (const std::vector< std::shared_ptr< const jlm::rvsdg::Type > > operands, std::shared_ptr< const jlm::rvsdg::Type > result)
 
virtual BinaryOperation::flags flags () const noexcept
 
bool is_associative () const noexcept
 
bool is_commutative () const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::SimpleOperation
 ~SimpleOperation () noexcept override
 
 SimpleOperation (std::vector< std::shared_ptr< const jlm::rvsdg::Type > > operands, std::vector< std::shared_ptr< const jlm::rvsdg::Type > > results)
 
size_t narguments () const noexcept
 
const std::shared_ptr< const rvsdg::Type > & argument (size_t index) const noexcept
 
size_t nresults () const noexcept
 
const std::shared_ptr< const rvsdg::Type > & result (size_t index) const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::Operation
virtual ~Operation () noexcept
 
virtual bool operator== (const Operation &other) const noexcept=0
 
bool operator!= (const Operation &other) const noexcept
 

Static Public Member Functions

static std::unique_ptr< llvm::ThreeAddressCodecreate (ICmpPredicate predicateKind, const Variable *op1, const Variable *op2)
 
static rvsdg::SimpleNodecreateNode (const ICmpPredicate kind, rvsdg::Output &operand1, rvsdg::Output &operand2)
 
static std::optional< std::vector< rvsdg::Output * > > normalizeNullPointerComparison (const PtrCmpOperation &ptrCmpOperation, const std::vector< rvsdg::Output * > &operands)
 

Private Attributes

ICmpPredicate predicate_
 

Additional Inherited Members

- Public Types inherited from jlm::rvsdg::BinaryOperation
enum class  flags { none = 0 , associative = 1 , commutative = 2 }
 

Detailed Description

Definition at line 410 of file operators.hpp.

Constructor & Destructor Documentation

◆ ~PtrCmpOperation()

jlm::llvm::PtrCmpOperation::~PtrCmpOperation ( )
overridedefaultnoexcept

◆ PtrCmpOperation()

jlm::llvm::PtrCmpOperation::PtrCmpOperation ( const std::shared_ptr< const PointerType > &  ptype,
ICmpPredicate  predicate 
)
inline

Definition at line 415 of file operators.hpp.

Member Function Documentation

◆ can_reduce_operand_pair()

rvsdg::binop_reduction_path_t jlm::llvm::PtrCmpOperation::can_reduce_operand_pair ( const jlm::rvsdg::Output op1,
const jlm::rvsdg::Output op2 
) const
overridevirtualnoexcept

Implements jlm::rvsdg::BinaryOperation.

Definition at line 261 of file operators.cpp.

◆ copy()

std::unique_ptr< rvsdg::Operation > jlm::llvm::PtrCmpOperation::copy ( ) const
overridevirtual

Implements jlm::rvsdg::Operation.

Definition at line 255 of file operators.cpp.

◆ create()

static std::unique_ptr< llvm::ThreeAddressCode > jlm::llvm::PtrCmpOperation::create ( ICmpPredicate  predicateKind,
const Variable op1,
const Variable op2 
)
inlinestatic

Definition at line 446 of file operators.hpp.

◆ createNode()

static rvsdg::SimpleNode & jlm::llvm::PtrCmpOperation::createNode ( const ICmpPredicate  kind,
rvsdg::Output operand1,
rvsdg::Output operand2 
)
inlinestatic

Definition at line 457 of file operators.hpp.

◆ debug_string()

std::string jlm::llvm::PtrCmpOperation::debug_string ( ) const
overridevirtual

Implements jlm::rvsdg::Operation.

Definition at line 249 of file operators.cpp.

◆ normalizeNullPointerComparison()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::PtrCmpOperation::normalizeNullPointerComparison ( const PtrCmpOperation ptrCmpOperation,
const std::vector< rvsdg::Output * > &  operands 
)
static

Checks if the comparison is between a ConstantPointerNullOperation and an allocation side guaranteed to never return a nullptr, and normalizes the PtrCmpOperation to an IntegerConstantOperation.

Parameters
ptrCmpOperationThe PtrCmpOperation on which the transformation is performed.
operandsThe operands of the PtrCmpOperation node.
Returns
If the normalization could be applied, then the result of the PtrCmpOperation after the transformation. Otherwise, std::nullopt.

Definition at line 318 of file operators.cpp.

◆ operator==()

bool jlm::llvm::PtrCmpOperation::operator== ( const Operation &  other) const
overridenoexcept

Definition at line 242 of file operators.cpp.

◆ predicate()

ICmpPredicate jlm::llvm::PtrCmpOperation::predicate ( ) const
inlinenoexcept

Definition at line 440 of file operators.hpp.

◆ reduce_operand_pair()

rvsdg::Output * jlm::llvm::PtrCmpOperation::reduce_operand_pair ( jlm::rvsdg::binop_reduction_path_t  path,
jlm::rvsdg::Output op1,
jlm::rvsdg::Output op2 
) const
overridevirtual

Implements jlm::rvsdg::BinaryOperation.

Definition at line 268 of file operators.cpp.

Member Data Documentation

◆ predicate_

ICmpPredicate jlm::llvm::PtrCmpOperation::predicate_
private

Definition at line 482 of file operators.hpp.


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