aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-12-13 20:52:00 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-12-13 20:52:00 +0000
commit975651ab98c16bbea05fa5357738056aa3c28818 (patch)
tree6a6d67c457d6f443e5926f36027e24d62cf3d2c7 /include/llvm/Target
parent45dc02d6f97447785ee7ffe08c36a34bc8921b0b (diff)
downloadexternal_llvm-975651ab98c16bbea05fa5357738056aa3c28818.zip
external_llvm-975651ab98c16bbea05fa5357738056aa3c28818.tar.gz
external_llvm-975651ab98c16bbea05fa5357738056aa3c28818.tar.bz2
Add getTypeToExpandTo() which recursively walks TransformToType to determine
the intrinsic type to expand to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32558 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r--include/llvm/Target/TargetLowering.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index c46995e..f3f4eda 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -176,6 +176,26 @@ public:
return TransformToType[VT];
}
+ /// getTypeToExpandTo - For types supported by the target, this is an
+ /// identity function. For types that must be expanded (i.e. integer types
+ /// that are larger than the largest integer register or illegal floating
+ /// point types), this returns the largest legal type it will be expanded to.
+ MVT::ValueType getTypeToExpandTo(MVT::ValueType VT) const {
+ while (true) {
+ switch (getTypeAction(VT)) {
+ case Legal:
+ return VT;
+ case Expand:
+ VT = TransformToType[VT];
+ break;
+ default:
+ assert(false && "Type is not legal nor is it to be expanded!");
+ return VT;
+ }
+ }
+ return VT;
+ }
+
/// getPackedTypeBreakdown - Packed types are broken down into some number of
/// legal first class types. For example, <8 x float> maps to 2 MVT::v4f32
/// with Altivec or SSE1, or 8 promoted MVT::f64 values with the X86 FP stack.