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

#include <IntegerOperations.hpp>

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

Public Member Functions

 ~IntegerShlOperation () noexcept override
 
 IntegerShlOperation (const std::size_t numBits)
 
bool operator== (const Operation &other) const noexcept override
 
std::string debug_string () const override
 
std::unique_ptr< Operation > copy () const override
 
rvsdg::binop_reduction_path_t can_reduce_operand_pair (const rvsdg::Output *op1, const rvsdg::Output *op2) const noexcept override
 
rvsdg::Outputreduce_operand_pair (rvsdg::binop_reduction_path_t path, rvsdg::Output *op1, rvsdg::Output *op2) const override
 
enum flags flags () const noexcept override
 
- Public Member Functions inherited from jlm::llvm::IntegerBinaryOperation
 ~IntegerBinaryOperation () noexcept override
 
 IntegerBinaryOperation (const std::size_t numArgumentBits, const std::size_t numResultBits) noexcept
 
const rvsdg::BitTypeType () 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)
 
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 rvsdg::NodecreateNode (const size_t numBits, rvsdg::Output &operand1, rvsdg::Output &operand2)
 
static std::optional< std::vector< rvsdg::Output * > > foldConstants (const IntegerShlOperation &operation, const std::vector< rvsdg::Output * > &operands)
 

Additional Inherited Members

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

Detailed Description

This operation is equivalent to LLVM's 'shl' instruction for integer operands. See LLVM Language Reference Manual for more details.

Definition at line 558 of file IntegerOperations.hpp.

Constructor & Destructor Documentation

◆ ~IntegerShlOperation()

jlm::llvm::IntegerShlOperation::~IntegerShlOperation ( )
overridedefaultnoexcept

◆ IntegerShlOperation()

jlm::llvm::IntegerShlOperation::IntegerShlOperation ( const std::size_t  numBits)
inlineexplicit

Definition at line 563 of file IntegerOperations.hpp.

Member Function Documentation

◆ can_reduce_operand_pair()

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

Implements jlm::rvsdg::BinaryOperation.

Definition at line 583 of file IntegerOperations.cpp.

◆ copy()

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

Implements jlm::rvsdg::Operation.

Definition at line 577 of file IntegerOperations.cpp.

◆ createNode()

static rvsdg::Node & jlm::llvm::IntegerShlOperation::createNode ( const size_t  numBits,
rvsdg::Output operand1,
rvsdg::Output operand2 
)
inlinestatic

Definition at line 588 of file IntegerOperations.hpp.

◆ debug_string()

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

Implements jlm::rvsdg::Operation.

Definition at line 571 of file IntegerOperations.cpp.

◆ flags()

Reimplemented from jlm::rvsdg::BinaryOperation.

Definition at line 599 of file IntegerOperations.cpp.

◆ foldConstants()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::IntegerShlOperation::foldConstants ( const IntegerShlOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
static

Performs constant folding by statically evaluating the two constant operands and replacing the operation's result with the resulting constant.

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

Definition at line 605 of file IntegerOperations.cpp.

◆ operator==()

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

Definition at line 564 of file IntegerOperations.cpp.

◆ reduce_operand_pair()

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

Implements jlm::rvsdg::BinaryOperation.

Definition at line 590 of file IntegerOperations.cpp.


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