aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/IR/InstrTypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/InstrTypes.h')
-rw-r--r--include/llvm/IR/InstrTypes.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/include/llvm/IR/InstrTypes.h b/include/llvm/IR/InstrTypes.h
index d749077fd34a1..871f702f95f2e 100644
--- a/include/llvm/IR/InstrTypes.h
+++ b/include/llvm/IR/InstrTypes.h
@@ -775,28 +775,21 @@ public:
/// A no-op cast is one that can be effected without changing any bits.
/// It implies that the source and destination types are the same size. The
- /// IntPtrTy argument is used to make accurate determinations for casts
+ /// DataLayout argument is to determine the pointer size when examining casts
/// involving Integer and Pointer types. They are no-op casts if the integer
/// is the same size as the pointer. However, pointer size varies with
- /// platform. Generally, the result of DataLayout::getIntPtrType() should be
- /// passed in. If that's not available, use Type::Int64Ty, which will make
- /// the isNoopCast call conservative.
+ /// platform.
/// @brief Determine if the described cast is a no-op cast.
static bool isNoopCast(
- Instruction::CastOps Opcode, ///< Opcode of cast
- Type *SrcTy, ///< SrcTy of cast
- Type *DstTy, ///< DstTy of cast
- Type *IntPtrTy ///< Integer type corresponding to Ptr types
+ Instruction::CastOps Opcode, ///< Opcode of cast
+ Type *SrcTy, ///< SrcTy of cast
+ Type *DstTy, ///< DstTy of cast
+ const DataLayout &DL ///< DataLayout to get the Int Ptr type from.
);
/// @brief Determine if this cast is a no-op cast.
- bool isNoopCast(
- Type *IntPtrTy ///< Integer type corresponding to pointer
- ) const;
-
- /// @brief Determine if this cast is a no-op cast.
///
- /// \param DL is the DataLayout to get the Int Ptr type from.
+ /// \param DL is the DataLayout to determine pointer size.
bool isNoopCast(const DataLayout &DL) const;
/// Determine how a pair of casts can be eliminated, if they can be at all.
@@ -1487,6 +1480,12 @@ protected:
default:
return false;
+ case Attribute::InaccessibleMemOrArgMemOnly:
+ return hasReadingOperandBundles();
+
+ case Attribute::InaccessibleMemOnly:
+ return hasReadingOperandBundles();
+
case Attribute::ArgMemOnly:
return hasReadingOperandBundles();