aboutsummaryrefslogtreecommitdiff
path: root/llvm/include/llvm/IR/Instructions.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/IR/Instructions.h')
-rw-r--r--llvm/include/llvm/IR/Instructions.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/Instructions.h b/llvm/include/llvm/IR/Instructions.h
index 046e9b5e809e..84ebb461ebef 100644
--- a/llvm/include/llvm/IR/Instructions.h
+++ b/llvm/include/llvm/IR/Instructions.h
@@ -105,6 +105,11 @@ public:
return cast<PointerType>(Instruction::getType());
}
+ /// Return the address space for the allocation.
+ unsigned getAddressSpace() const {
+ return getType()->getAddressSpace();
+ }
+
/// Get allocation size in bits. Returns None if size can't be determined,
/// e.g. in case of a VLA.
Optional<TypeSize> getAllocationSizeInBits(const DataLayout &DL) const;
@@ -1451,6 +1456,10 @@ public:
///
static auto predicates() { return FCmpPredicates(); }
+ /// Return result of `LHS Pred RHS` comparison.
+ static bool compare(const APFloat &LHS, const APFloat &RHS,
+ FCmpInst::Predicate Pred);
+
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof(const Instruction *I) {
return I->getOpcode() == Instruction::FCmp;