summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-30 04:08:18 +0000
committerChris Lattner <sabre@nondot.org>2006-01-30 04:08:18 +0000
commit553d8007ad29ab4ba7be261e91c38556dccdd95e (patch)
tree6b0204d036e988f8b28025b672961e3d02408341 /include
parent9247d0b12b092654680a08289ed740cbd2f94366 (diff)
downloadllvm-553d8007ad29ab4ba7be261e91c38556dccdd95e.tar.gz
llvm-553d8007ad29ab4ba7be261e91c38556dccdd95e.tar.bz2
llvm-553d8007ad29ab4ba7be261e91c38556dccdd95e.tar.xz
Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,
making isMaskedValueZeroForTargetNode simpler, and useable from other parts of the compiler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index d538b4d6c0..0d64271199 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -281,6 +281,17 @@ public:
}
//===--------------------------------------------------------------------===//
+ // TargetLowering Optimization Methods
+ //
+
+ /// MaskedValueIsZero - Return true if 'Op & Mask' is known to be zero. We
+ /// use this predicate to simplify operations downstream. Op and Mask are
+ /// known to be the same type. Targets can implement the
+ /// isMaskedValueZeroForTargetNode method, to allow target nodes to be
+ /// understood.
+ bool MaskedValueIsZero(const SDOperand &Op, uint64_t Mask) const;
+
+ //===--------------------------------------------------------------------===//
// TargetLowering Configuration Methods - These methods should be invoked by
// the derived class constructor to configure this object for the target.
//
@@ -413,12 +424,9 @@ public:
virtual const char *getTargetNodeName(unsigned Opcode) const;
/// isMaskedValueZeroForTargetNode - Return true if 'Op & Mask' is known to
- /// be zero. Op is expected to be a target specific node. Used by DAG
- /// combiner. MVIZ is a function pointer to the main MaskedValueIsZero
- /// function.
- typedef bool (*MVIZFnPtr)(const SDOperand&, uint64_t, const TargetLowering &);
- virtual bool isMaskedValueZeroForTargetNode(const SDOperand &Op,uint64_t Mask,
- MVIZFnPtr MVIZ) const;
+ /// be zero. Op is expected to be a target specific node.
+ virtual bool isMaskedValueZeroForTargetNode(const SDOperand &Op,
+ uint64_t Mask) const;
//===--------------------------------------------------------------------===//
// Inline Asm Support hooks