aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-06 09:26:22 +0000
committerChris Lattner <sabre@nondot.org>2006-05-06 09:26:22 +0000
commita0d513ba753e0df43aa36d653502effddeadb34e (patch)
treecc19edfaf3ce598ad3583adbb9e03442cd686d13 /include
parentf0df8824eb2bf8a5fb91ce6fd1db590caf34f994 (diff)
downloadexternal_llvm-a0d513ba753e0df43aa36d653502effddeadb34e.zip
external_llvm-a0d513ba753e0df43aa36d653502effddeadb34e.tar.gz
external_llvm-a0d513ba753e0df43aa36d653502effddeadb34e.tar.bz2
Add some new methods for computing sign bit information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 1b4960e..9f773e3 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -389,6 +389,19 @@ public:
uint64_t &KnownOne,
unsigned Depth = 0) const;
+ /// ComputeNumSignBits - Return the number of times the sign bit of the
+ /// register is replicated into the other bits. We know that at least 1 bit
+ /// is always equal to the sign bit (itself), but other cases can give us
+ /// information. For example, immediately after an "SRA X, 2", we know that
+ /// the top 3 bits are all equal to each other, so we return 3.
+ unsigned ComputeNumSignBits(SDOperand Op, unsigned Depth = 0) const;
+
+ /// ComputeNumSignBitsForTargetNode - This method can be implemented by
+ /// targets that want to expose additional information about sign bits to the
+ /// DAG Combiner.
+ virtual unsigned ComputeNumSignBitsForTargetNode(SDOperand Op,
+ unsigned Depth = 0) const;
+
struct DAGCombinerInfo {
void *DC; // The DAG Combiner object.
bool BeforeLegalize;