aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-19 18:16:17 +0000
committerDan Gohman <gohman@apple.com>2009-08-19 18:16:17 +0000
commit6a402dc952ccad3f8fd0d9e272dbdd261f50854e (patch)
treece5b352f432a1f7886d72ec86ab2d169f36b9b62 /lib/CodeGen
parentb7be0e8afc5378c77c70e3c0fb6a03c74e551688 (diff)
downloadexternal_llvm-6a402dc952ccad3f8fd0d9e272dbdd261f50854e.zip
external_llvm-6a402dc952ccad3f8fd0d9e272dbdd261f50854e.tar.gz
external_llvm-6a402dc952ccad3f8fd0d9e272dbdd261f50854e.tar.bz2
Add an x86 peep that narrows TEST instructions to forms that use
a smaller encoding. These kinds of patterns are very frequent in sqlite3, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 75de203..f5de81b 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -4586,6 +4586,17 @@ SDNode *SelectionDAG::getTargetNode(unsigned Opcode, DebugLoc dl,
return getNode(~Opcode, dl, ResultTys, Ops, NumOps).getNode();
}
+/// getTargetExtractSubreg - A convenience function for creating
+/// TargetInstrInfo::EXTRACT_SUBREG nodes.
+SDValue
+SelectionDAG::getTargetExtractSubreg(int SRIdx, DebugLoc DL, EVT VT,
+ SDValue Operand) {
+ SDValue SRIdxVal = getTargetConstant(SRIdx, MVT::i32);
+ SDNode *Subreg = getTargetNode(TargetInstrInfo::EXTRACT_SUBREG, DL,
+ VT, Operand, SRIdxVal);
+ return SDValue(Subreg, 0);
+}
+
/// getNodeIfExists - Get the specified node if it's already available, or
/// else return NULL.
SDNode *SelectionDAG::getNodeIfExists(unsigned Opcode, SDVTList VTList,