summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitac33a9061dd842f6dc3f80ad69c0d97de86dd5ff (patch)
tree405fa3277048139510b089dcbcea848f2a7d4baf /llvm/lib/CodeGen
parent3bc0a3bf7d60a0e282e04ed6e4a3e8523d1dc8c7 (diff)
downloadbcm5719-llvm-ac33a9061dd842f6dc3f80ad69c0d97de86dd5ff.tar.gz
bcm5719-llvm-ac33a9061dd842f6dc3f80ad69c0d97de86dd5ff.zip
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. llvm-svn: 79439
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 75de2035796..f5de81b9425 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud