aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2012-11-27 00:41:22 +0000
committerMichael Ilseman <milseman@apple.com>2012-11-27 00:41:22 +0000
commit125fc7fefd4a198dd210cb43f5d8f1ba2c1e2dcf (patch)
tree1f2473a8b13a11b359aeca3fe02f1f313e607eb0 /include
parentab4649b25f13af911594631174b9358aab4e89d3 (diff)
downloadexternal_llvm-125fc7fefd4a198dd210cb43f5d8f1ba2c1e2dcf.zip
external_llvm-125fc7fefd4a198dd210cb43f5d8f1ba2c1e2dcf.tar.gz
external_llvm-125fc7fefd4a198dd210cb43f5d8f1ba2c1e2dcf.tar.bz2
Fast-math interfaces for Instructions
Add in getter/setter methods for Instructions, allowing them to be the interface to FPMathOperator similarly to now NUS/NSW is handled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Instruction.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index 0768df1..22c8289 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -21,6 +21,7 @@
namespace llvm {
+struct FastMathFlags;
class LLVMContext;
class MDNode;
@@ -176,6 +177,56 @@ public:
/// getDebugLoc - Return the debug location for this node as a DebugLoc.
const DebugLoc &getDebugLoc() const { return DbgLoc; }
+ /// Set or clear the unsafe-algebra flag on this instruction, which must be an
+ /// operator which supports this flag. See LangRef.html for the meaning of
+ /// this flag.
+ void setHasUnsafeAlgebra(bool B);
+
+ /// Set or clear the no-nans flag on this instruction, which must be an
+ /// operator which supports this flag. See LangRef.html for the meaning of
+ /// this flag.
+ void setHasNoNaNs(bool B);
+
+ /// Set or clear the no-infs flag on this instruction, which must be an
+ /// operator which supports this flag. See LangRef.html for the meaning of
+ /// this flag.
+ void setHasNoInfs(bool B);
+
+ /// Set or clear the no-signed-zeros flag on this instruction, which must be
+ /// an operator which supports this flag. See LangRef.html for the meaning of
+ /// this flag.
+ void setHasNoSignedZeros(bool B);
+
+ /// Set or clear the allow-reciprocal flag on this instruction, which must be
+ /// an operator which supports this flag. See LangRef.html for the meaning of
+ /// this flag.
+ void setHasAllowReciprocal(bool B);
+
+ /// Convenience function for setting all the fast-math flags on this
+ /// instruction, which must be an operator which supports these flags. See
+ /// LangRef.html for the meaning of these flats.
+ void setFastMathFlags(FastMathFlags FMF);
+
+ /// Determine whether the unsafe-algebra flag is set.
+ bool hasUnsafeAlgebra() const;
+
+ /// Determine whether the no-NaNs flag is set.
+ bool hasNoNaNs() const;
+
+ /// Determine whether the no-infs flag is set.
+ bool hasNoInfs() const;
+
+ /// Determine whether the no-signed-zeros flag is set.
+ bool hasNoSignedZeros() const;
+
+ /// Determine whether the allow-reciprocal flag is set.
+ bool hasAllowReciprocal() const;
+
+ /// Convenience function for getting all the fast-math flags, which must be an
+ /// operator which supports these flags. See LangRef.html for the meaning of
+ /// these flats.
+ FastMathFlags getFastMathFlags() const;
+
private:
/// hasMetadataHashEntry - Return true if we have an entry in the on-the-side
/// metadata hash.