aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/SelectionDAG.h
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-10-13 21:04:12 +0000
committerDuncan Sands <baldrick@free.fr>2009-10-13 21:04:12 +0000
commit3a66a68b0cc81193abfc074b1d360a4950151d38 (patch)
treece5aaed17ab826e9245fcbe8bd389b21467b7063 /include/llvm/CodeGen/SelectionDAG.h
parentb408b15fa423d4c3c1d4840ff6378af17f6f293b (diff)
downloadexternal_llvm-3a66a68b0cc81193abfc074b1d360a4950151d38.tar.gz
external_llvm-3a66a68b0cc81193abfc074b1d360a4950151d38.tar.bz2
external_llvm-3a66a68b0cc81193abfc074b1d360a4950151d38.zip
Introduce new convenience methods for sign extending or
truncating an SDValue (depending on whether the target type is bigger or smaller than the value's type); or zero extending or truncating it. Use it in a few places (this seems to be a popular operation, but I only modified cases of it in SelectionDAGBuild). In particular, the eh_selector lowering was doing this wrong due to a repeated rather than inverted test, fixed with this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAG.h')
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index eb2a727155..e0198ef2e3 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -381,6 +381,14 @@ public:
SDValue getVectorShuffle(EVT VT, DebugLoc dl, SDValue N1, SDValue N2,
const int *MaskElts);
+ /// getSExtOrTrunc - Convert Op, which must be of integer type, to the
+ /// integer type VT, by either sign-extending or truncating it.
+ SDValue getSExtOrTrunc(SDValue Op, DebugLoc DL, EVT VT);
+
+ /// getZExtOrTrunc - Convert Op, which must be of integer type, to the
+ /// integer type VT, by either zero-extending or truncating it.
+ SDValue getZExtOrTrunc(SDValue Op, DebugLoc DL, EVT VT);
+
/// getZeroExtendInReg - Return the expression required to zero extend the Op
/// value assuming it was the smaller SrcTy value.
SDValue getZeroExtendInReg(SDValue Op, DebugLoc DL, EVT SrcTy);