LLVM API Documentation

Public Member Functions | Static Public Member Functions | Protected Member Functions
llvm::FCmpInst Class Reference

Represents a floating point comparison operator. More...

#include <Instructions.h>

Inheritance diagram for llvm::FCmpInst:
Inheritance graph
[legend]
Collaboration diagram for llvm::FCmpInst:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FCmpInst (Instruction *InsertBefore, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
 Constructor with insert-before-instruction semantics.
 FCmpInst (BasicBlock &InsertAtEnd, Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
 Constructor with insert-at-end semantics.
 FCmpInst (Predicate pred, Value *LHS, Value *RHS, const Twine &NameStr="")
 Constructor with no-insertion semantics.
bool isEquality () const
 Determine if this is an equality predicate.
bool isCommutative () const
 Determine if this is a commutative predicate.
bool isRelational () const
 Determine if this a relational predicate.
void swapOperands ()
 Swap operands and adjust predicate.

Static Public Member Functions

static bool classof (const Instruction *I)
 Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast:

Protected Member Functions

FCmpInstclone_impl () const override
 Clone an identical FCmpInst.

Detailed Description

Represents a floating point comparison operator.

This instruction compares its operands according to the predicate given to the constructor. It only operates on floating point values or packed vectors of floating point values. The operands must be identical types.

Definition at line 1135 of file Instructions.h.


Constructor & Destructor Documentation

llvm::FCmpInst::FCmpInst ( Instruction InsertBefore,
Predicate  pred,
Value LHS,
Value RHS,
const Twine NameStr = "" 
) [inline]

Constructor with insert-before-instruction semantics.

Parameters:
InsertBeforeWhere to insert
predThe predicate to use for the comparison
LHSThe left-hand-side of the expression
RHSThe right-hand-side of the expression
NameStrName of the instruction

Definition at line 1141 of file Instructions.h.

References llvm::User::getOperand(), llvm::Value::getType(), and llvm::CmpInst::LAST_FCMP_PREDICATE.

Referenced by clone_impl().

llvm::FCmpInst::FCmpInst ( BasicBlock InsertAtEnd,
Predicate  pred,
Value LHS,
Value RHS,
const Twine NameStr = "" 
) [inline]

Constructor with insert-at-end semantics.

Parameters:
InsertAtEndBlock to insert into.
predThe predicate to use for the comparison
LHSThe left-hand-side of the expression
RHSThe right-hand-side of the expression
NameStrName of the instruction

Definition at line 1160 of file Instructions.h.

References llvm::User::getOperand(), llvm::Value::getType(), and llvm::CmpInst::LAST_FCMP_PREDICATE.

llvm::FCmpInst::FCmpInst ( Predicate  pred,
Value LHS,
Value RHS,
const Twine NameStr = "" 
) [inline]

Constructor with no-insertion semantics.

Parameters:
predThe predicate to use for the comparison
LHSThe left-hand-side of the expression
RHSThe right-hand-side of the expression
NameStrName of the instruction

Definition at line 1179 of file Instructions.h.

References llvm::User::getOperand(), llvm::Value::getType(), and llvm::CmpInst::LAST_FCMP_PREDICATE.


Member Function Documentation

static bool llvm::FCmpInst::classof ( const Instruction I) [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:

Reimplemented from llvm::CmpInst.

Definition at line 1227 of file Instructions.h.

References llvm::FCmp, and llvm::Instruction::getOpcode().

Referenced by classof().

static bool llvm::FCmpInst::classof ( const Value V) [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:

Reimplemented from llvm::CmpInst.

Definition at line 1230 of file Instructions.h.

References classof().

FCmpInst * FCmpInst::clone_impl ( ) const [override, protected, virtual]

Clone an identical FCmpInst.

Implements llvm::Instruction.

Definition at line 3621 of file Instructions.cpp.

References FCmpInst(), and llvm::CmpInst::getPredicate().

bool llvm::FCmpInst::isCommutative ( ) const [inline]

Determine if this is a commutative predicate.

Returns:
true if the predicate of this instruction is commutative.

Reimplemented from llvm::CmpInst.

Definition at line 1204 of file Instructions.h.

References llvm::CmpInst::FCMP_FALSE, llvm::CmpInst::FCMP_ORD, llvm::CmpInst::FCMP_TRUE, llvm::CmpInst::FCMP_UNO, llvm::CmpInst::getPredicate(), and isEquality().

bool llvm::FCmpInst::isEquality ( ) const [inline]

Determine if this is an equality predicate.

Returns:
true if the predicate of this instruction is EQ or NE.

Reimplemented from llvm::CmpInst.

Definition at line 1197 of file Instructions.h.

References llvm::CmpInst::FCMP_OEQ, llvm::CmpInst::FCMP_ONE, llvm::CmpInst::FCMP_UEQ, llvm::CmpInst::FCMP_UNE, and llvm::CmpInst::getPredicate().

Referenced by isCommutative(), and isRelational().

bool llvm::FCmpInst::isRelational ( ) const [inline]

Determine if this a relational predicate.

Returns:
true if the predicate is relational (not EQ or NE).

Definition at line 1214 of file Instructions.h.

References isEquality().

void llvm::FCmpInst::swapOperands ( ) [inline]

Swap operands and adjust predicate.

Exchange the two operands to this instruction in such a way that it does not modify the semantics of the instruction. The predicate value may be changed to retain the same result if the predicate is order dependent (e.g. ult).

Reimplemented from llvm::CmpInst.

Definition at line 1221 of file Instructions.h.

References llvm::CmpInst::getSwappedPredicate(), llvm::CmpInst::setPredicate(), and std::swap().

Referenced by llvm::InstCombiner::visitFCmpInst().


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