From evan.cheng at apple.com Mon Nov 6 02:14:46 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 6 Nov 2006 02:14:46 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Message-ID: <200611060814.kA68Ek5T027703@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
DAGCombiner.cpp updated: 1.237 -> 1.238
---
Log message:
Add comment.
---
Diffs of the changes: (+10 -4)
DAGCombiner.cpp | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.237 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.238
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.237 Sun Nov 5 13:31:28 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Nov 6 02:14:30 2006
@@ -174,7 +174,13 @@
return true;
}
- bool CombineToIndexedLoadStore(SDNode *N) {
+ /// CombineToPreIndexedLoadStore - Try turning a load / store into a
+ /// pre-indexed load store when the base pointer is a add or subtract
+ /// and it has other uses besides the load / store. When the
+ /// transformation is done, the new indexed load / store effectively
+ /// folded the add / subtract in and all of its other uses are redirected
+ /// to the new load / store.
+ bool CombineToPreIndexedLoadStore(SDNode *N) {
bool isLoad = true;
SDOperand Ptr;
if (LoadSDNode *LD = dyn_cast(N)) {
@@ -811,7 +817,7 @@
return DAG.getNode(ISD::OR, VT, N0, N1);
}
}
-
+
return SDOperand();
}
@@ -2871,7 +2877,7 @@
}
// Try transforming N to an indexed load.
- if (CombineToIndexedLoadStore(N))
+ if (CombineToPreIndexedLoadStore(N))
return SDOperand(N, 0);
return SDOperand();
@@ -2917,7 +2923,7 @@
}
// Try transforming N to an indexed store.
- if (CombineToIndexedLoadStore(N))
+ if (CombineToPreIndexedLoadStore(N))
return SDOperand(N, 0);
return SDOperand();
From jlaskey at apple.com Mon Nov 6 07:20:43 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Mon, 6 Nov 2006 07:20:43 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
Message-ID: <200611061320.kA6DKh9P003580@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
MachineDebugInfo.cpp updated: 1.53 -> 1.54
---
Log message:
D'oh - reversed logic.
---
Diffs of the changes: (+1 -1)
MachineDebugInfo.cpp | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.53 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.54
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.53 Tue Oct 24 06:50:43 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp Mon Nov 6 07:20:29 2006
@@ -1570,7 +1570,7 @@
bool MachineDebugInfo::isLabelValid(unsigned LabelID) {
std::vector::iterator I =
std::lower_bound(DeletedLabelIDs.begin(), DeletedLabelIDs.end(), LabelID);
- return I != DeletedLabelIDs.end() && *I == LabelID;
+ return I == DeletedLabelIDs.end() || *I != LabelID;
}
/// RecordSource - Register a source file with debug info. Returns an source
From jlaskey at apple.com Mon Nov 6 10:24:15 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Mon, 6 Nov 2006 10:24:15 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Message-ID: <200611061624.kA6GOF5B015387@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
DwarfWriter.cpp updated: 1.96 -> 1.97
---
Log message:
Tab interferes with uniqueness.
NOTE: There doesn't seem to be consistency for whether a leading tab
is present in a section heading.
---
Diffs of the changes: (+1 -1)
DwarfWriter.cpp | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.96 llvm/lib/CodeGen/DwarfWriter.cpp:1.97
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.96 Sat Nov 4 04:48:07 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp Mon Nov 6 10:23:59 2006
@@ -2678,7 +2678,7 @@
ConstructSubprogramDIEs();
// Prime section data.
- SectionMap.insert(std::string("\t") + TAI->getTextSection());
+ SectionMap.insert(TAI->getTextSection());
}
}
From reid at x10sys.com Mon Nov 6 12:47:29 2006
From: reid at x10sys.com (Reid Spencer)
Date: Mon, 6 Nov 2006 12:47:29 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Support/PatternMatch.h
Message-ID: <200611061847.kA6IlTHG017022@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Support:
PatternMatch.h updated: 1.11 -> 1.12
---
Log message:
Fix a small bug noticed on code review.
---
Diffs of the changes: (+1 -1)
PatternMatch.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/include/llvm/Support/PatternMatch.h
diff -u llvm/include/llvm/Support/PatternMatch.h:1.11 llvm/include/llvm/Support/PatternMatch.h:1.12
--- llvm/include/llvm/Support/PatternMatch.h:1.11 Wed Nov 1 19:53:58 2006
+++ llvm/include/llvm/Support/PatternMatch.h Mon Nov 6 12:47:14 2006
@@ -310,7 +310,7 @@
return Op.match(I->getOperand(0));
} else if (ConstantExpr *CE = dyn_cast(V)) {
if (CE->getOpcode() == Instruction::Cast) {
- if (DestTy) *DestTy = I->getType();
+ if (DestTy) *DestTy = CE->getType();
return Op.match(CE->getOperand(0));
}
}
From sabre at nondot.org Mon Nov 6 15:27:10 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 15:27:10 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/README.txt
Message-ID: <200611062127.kA6LRAF9018867@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target:
README.txt updated: 1.45 -> 1.46
---
Log message:
add a note
---
Diffs of the changes: (+16 -0)
README.txt | 16 ++++++++++++++++
1 files changed, 16 insertions(+)
Index: llvm/lib/Target/README.txt
diff -u llvm/lib/Target/README.txt:1.45 llvm/lib/Target/README.txt:1.46
--- llvm/lib/Target/README.txt:1.45 Fri Nov 3 16:27:39 2006
+++ llvm/lib/Target/README.txt Mon Nov 6 15:26:49 2006
@@ -287,6 +287,22 @@
return v;
}
+Nor is this:
+
+ushort %bad(ushort %a) {
+entry:
+ %tmp = cast ushort %a to uint ; [#uses=1]
+ %tmp2 = shr uint %tmp, ubyte 8 ; [#uses=1]
+ %tmp2 = cast uint %tmp2 to ushort ; [#uses=1]
+ %tmp5 = shl ushort %a, ubyte 8 ; [#uses=1]
+ %tmp6 = or ushort %tmp2, %tmp5 ; [#uses=1]
+ ret ushort %tmp6
+}
+
+unsigned short bad(unsigned short a) {
+ return ((a & 0xff00) >> 8 | (a & 0x00ff) << 8);
+}
+
//===---------------------------------------------------------------------===//
These should turn into single 16-bit (unaligned?) loads on little/big endian
From evan.cheng at apple.com Mon Nov 6 15:34:08 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 6 Nov 2006 15:34:08 -0600
Subject: [llvm-commits] CVS:
llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
Message-ID: <200611062134.kA6LY8Hr009838@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
ScheduleDAGRRList.cpp updated: 1.20 -> 1.21
---
Log message:
Remove dead code; added a missing null ptr check.
---
Diffs of the changes: (+1 -32)
ScheduleDAGRRList.cpp | 33 +--------------------------------
1 files changed, 1 insertion(+), 32 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.20 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.21
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.20 Sat Nov 4 03:44:31 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Mon Nov 6 15:33:46 2006
@@ -685,7 +685,6 @@
/// first (lower in the schedule).
template
void BURegReductionPriorityQueue::AddPseudoTwoAddrDeps() {
-#if 1
for (unsigned i = 0, e = SUnits->size(); i != e; ++i) {
SUnit *SU = (SUnit *)&((*SUnits)[i]);
if (!SU->isTwoAddress)
@@ -703,6 +702,7 @@
TargetInstrInfo::TIED_TO) != -1) {
SDNode *DU = SU->Node->getOperand(j).Val;
SUnit *DUSU = (*SUnitMap)[DU];
+ if (!DUSU) continue;
for (SUnit::succ_iterator I = DUSU->Succs.begin(),E = DUSU->Succs.end();
I != E; ++I) {
if (I->second) continue;
@@ -723,37 +723,6 @@
}
}
}
-#else
- for (unsigned i = 0, e = SUnits->size(); i != e; ++i) {
- SUnit *SU = (SUnit *)&((*SUnits)[i]);
- SDNode *Node = SU->Node;
- if (!Node->isTargetOpcode())
- continue;
-
- if (SU->isTwoAddress) {
- SUnit *DUSU = getDefUsePredecessor(SU, TII);
- if (!DUSU) continue;
-
- for (SUnit::succ_iterator I = DUSU->Succs.begin(), E = DUSU->Succs.end();
- I != E; ++I) {
- if (I->second) continue;
- SUnit *SuccSU = I->first;
- if (SuccSU != SU &&
- (!canClobber(SuccSU, DUSU, TII) ||
- (!SU->isCommutable && SuccSU->isCommutable))){
- if (SuccSU->Depth == SU->Depth && !isReachable(SuccSU, SU)) {
- DEBUG(std::cerr << "Adding an edge from SU # " << SU->NodeNum
- << " to SU #" << SuccSU->NodeNum << "\n");
- if (SU->addPred(SuccSU, true))
- SU->NumChainPredsLeft++;
- if (SuccSU->addSucc(SU, true))
- SuccSU->NumChainSuccsLeft++;
- }
- }
- }
- }
- }
-#endif
}
/// CalcNodePriority - Priority is the Sethi Ullman number.
From sabre at nondot.org Mon Nov 6 15:45:26 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 15:45:26 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h
Message-ID: <200611062145.kA6LjQNd010152@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Target:
TargetInstrInfo.h updated: 1.102 -> 1.103
---
Log message:
add a flag so that predicated instructions can be recognized by branch
folding
---
Diffs of the changes: (+8 -0)
TargetInstrInfo.h | 8 ++++++++
1 files changed, 8 insertions(+)
Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.102 llvm/include/llvm/Target/TargetInstrInfo.h:1.103
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.102 Wed Nov 1 17:14:00 2006
+++ llvm/include/llvm/Target/TargetInstrInfo.h Mon Nov 6 15:44:17 2006
@@ -80,6 +80,11 @@
// operands in addition to the minimum number operands specified.
const unsigned M_VARIABLE_OPS = 1 << 12;
+// M_PREDICATED - Set if this instruction has a predicate that controls its
+// execution.
+const unsigned M_PREDICATED = 1 << 13;
+
+
// Machine operand flags
// M_LOOK_UP_PTR_REG_CLASS - Set if this operand is a pointer value and it
// requires a callback to look up its register class.
@@ -177,6 +182,9 @@
bool isTwoAddrInstr(MachineOpCode Opcode) const {
return get(Opcode).Flags & M_2_ADDR_FLAG;
}
+ bool isPredicated(MachineOpCode Opcode) const {
+ return get(Opcode).Flags & M_PREDICATED;
+ }
bool isCommutableInstr(MachineOpCode Opcode) const {
return get(Opcode).Flags & M_COMMUTABLE;
}
From sabre at nondot.org Mon Nov 6 15:45:56 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 15:45:56 -0600
Subject: [llvm-commits] CVS: llvm/utils/TableGen/CodeGenInstruction.h
CodeGenTarget.cpp InstrInfoEmitter.cpp
Message-ID: <200611062145.kA6Ljuuc010174@zion.cs.uiuc.edu>
Changes in directory llvm/utils/TableGen:
CodeGenInstruction.h updated: 1.21 -> 1.22
CodeGenTarget.cpp updated: 1.73 -> 1.74
InstrInfoEmitter.cpp updated: 1.47 -> 1.48
---
Log message:
recognize ppc's blr instruction as predicated
---
Diffs of the changes: (+4 -0)
CodeGenInstruction.h | 1 +
CodeGenTarget.cpp | 2 ++
InstrInfoEmitter.cpp | 1 +
3 files changed, 4 insertions(+)
Index: llvm/utils/TableGen/CodeGenInstruction.h
diff -u llvm/utils/TableGen/CodeGenInstruction.h:1.21 llvm/utils/TableGen/CodeGenInstruction.h:1.22
--- llvm/utils/TableGen/CodeGenInstruction.h:1.21 Sun Nov 5 13:31:28 2006
+++ llvm/utils/TableGen/CodeGenInstruction.h Mon Nov 6 15:44:53 2006
@@ -87,6 +87,7 @@
bool isLoad;
bool isStore;
bool isTwoAddress;
+ bool isPredicated;
bool isConvertibleToThreeAddress;
bool isCommutable;
bool isTerminator;
Index: llvm/utils/TableGen/CodeGenTarget.cpp
diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.73 llvm/utils/TableGen/CodeGenTarget.cpp:1.74
--- llvm/utils/TableGen/CodeGenTarget.cpp:1.73 Sat Nov 4 03:40:23 2006
+++ llvm/utils/TableGen/CodeGenTarget.cpp Mon Nov 6 15:44:54 2006
@@ -335,6 +335,7 @@
isLoad = R->getValueAsBit("isLoad");
isStore = R->getValueAsBit("isStore");
isTwoAddress = R->getValueAsBit("isTwoAddress");
+ isPredicated = false; // set below.
isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress");
isCommutable = R->getValueAsBit("isCommutable");
isTerminator = R->getValueAsBit("isTerminator");
@@ -381,6 +382,7 @@
if (unsigned NumArgs = MIOpInfo->getNumArgs())
NumOps = NumArgs;
+ isPredicated |= Rec->isSubClassOf("PredicateOperand");
} else if (Rec->getName() == "variable_ops") {
hasVariableNumberOfOperands = true;
continue;
Index: llvm/utils/TableGen/InstrInfoEmitter.cpp
diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.47 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.48
--- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.47 Sat Nov 4 03:40:23 2006
+++ llvm/utils/TableGen/InstrInfoEmitter.cpp Mon Nov 6 15:44:54 2006
@@ -225,6 +225,7 @@
if (Inst.isLoad) OS << "|M_LOAD_FLAG";
if (Inst.isStore || isStore) OS << "|M_STORE_FLAG";
if (Inst.isTwoAddress) OS << "|M_2_ADDR_FLAG";
+ if (Inst.isPredicated) OS << "|M_PREDICATED";
if (Inst.isConvertibleToThreeAddress) OS << "|M_CONVERTIBLE_TO_3_ADDR";
if (Inst.isCommutable) OS << "|M_COMMUTABLE";
if (Inst.isTerminator) OS << "|M_TERMINATOR_FLAG";
From sabre at nondot.org Mon Nov 6 17:50:14 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 17:50:14 -0600
Subject: [llvm-commits] CVS: llvm/utils/TableGen/CodeGenInstruction.h
CodeGenTarget.cpp InstrInfoEmitter.cpp InstrInfoEmitter.h
Message-ID: <200611062350.kA6NoEiW021412@zion.cs.uiuc.edu>
Changes in directory llvm/utils/TableGen:
CodeGenInstruction.h updated: 1.22 -> 1.23
CodeGenTarget.cpp updated: 1.74 -> 1.75
InstrInfoEmitter.cpp updated: 1.48 -> 1.49
InstrInfoEmitter.h updated: 1.14 -> 1.15
---
Log message:
simplify the way operand flags and constraints are handled, making it easier
to extend.
---
Diffs of the changes: (+79 -70)
CodeGenInstruction.h | 11 +-----
CodeGenTarget.cpp | 51 ++++++++++++++++++------------
InstrInfoEmitter.cpp | 84 ++++++++++++++++++++++++++-------------------------
InstrInfoEmitter.h | 3 +
4 files changed, 79 insertions(+), 70 deletions(-)
Index: llvm/utils/TableGen/CodeGenInstruction.h
diff -u llvm/utils/TableGen/CodeGenInstruction.h:1.22 llvm/utils/TableGen/CodeGenInstruction.h:1.23
--- llvm/utils/TableGen/CodeGenInstruction.h:1.22 Mon Nov 6 15:44:53 2006
+++ llvm/utils/TableGen/CodeGenInstruction.h Mon Nov 6 17:49:51 2006
@@ -60,6 +60,9 @@
/// MIOperandInfo - Default MI operand type. Note an operand may be made
/// up of multiple MI operands.
DagInit *MIOperandInfo;
+
+ /// Constraint info for this operand.
+ std::string Constraint;
OperandInfo(Record *R, const std::string &N, const std::string &PMN,
unsigned MION, unsigned MINO, DagInit *MIOI)
@@ -71,14 +74,6 @@
/// type (which is a record).
std::vector OperandList;
- /// ConstraintStr - The operand constraints string.
- ///
- std::string ConstraintStr;
-
- /// ConstraintsList - List of constraints, encoded into one unsigned int per
- /// operand.
- std::vector ConstraintsList;
-
// Various boolean values we track for the instruction.
bool isReturn;
bool isBranch;
Index: llvm/utils/TableGen/CodeGenTarget.cpp
diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.74 llvm/utils/TableGen/CodeGenTarget.cpp:1.75
--- llvm/utils/TableGen/CodeGenTarget.cpp:1.74 Mon Nov 6 15:44:54 2006
+++ llvm/utils/TableGen/CodeGenTarget.cpp Mon Nov 6 17:49:51 2006
@@ -19,7 +19,6 @@
#include "Record.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Target/TargetInstrInfo.h"
#include
#include
using namespace llvm;
@@ -274,8 +273,8 @@
return getInstructionSet()->getValueAsBit("isLittleEndianEncoding");
}
-static std::pair parseConstraint(const std::string &CStr,
- CodeGenInstruction *I) {
+static std::string ParseConstraint(const std::string &CStr,
+ CodeGenInstruction *I, unsigned &DestOp) {
const std::string ops("="); // FIXME: Only supports TIED_TO for now.
std::string::size_type pos = CStr.find_first_of(ops);
assert(pos != std::string::npos && "Unrecognized constraint");
@@ -286,26 +285,24 @@
std::string::size_type wpos = Name.find_first_of(delims);
if (wpos != std::string::npos)
Name = Name.substr(0, wpos);
- unsigned FIdx = I->getOperandNamed(Name);
+ DestOp = I->getOperandNamed(Name);
Name = CStr.substr(pos+1);
wpos = Name.find_first_not_of(delims);
if (wpos != std::string::npos)
Name = Name.substr(wpos+1);
+
unsigned TIdx = I->getOperandNamed(Name);
- if (TIdx >= FIdx)
+ if (TIdx >= DestOp)
throw "Illegal tied-to operand constraint '" + CStr + "'";
- return std::make_pair(FIdx, (TIdx << 16) |
- (1 << (unsigned)TargetInstrInfo::TIED_TO));
+
+ // Build the string.
+ return "((" + utostr(TIdx) + " << 16) | TargetInstrInfo::TIED_TO)";
}
-static std::vector parseConstraints(const std::string &CStr,
- CodeGenInstruction *I) {
- unsigned NumOps = I->OperandList.size();
- std::vector Res(NumOps, 0);
- if (CStr == "")
- return Res;
-
+static void ParseConstraints(const std::string &CStr, CodeGenInstruction *I) {
+ if (CStr.empty()) return;
+
const std::string delims(",");
std::string::size_type bidx, eidx;
@@ -314,13 +311,16 @@
eidx = CStr.find_first_of(delims, bidx);
if (eidx == std::string::npos)
eidx = CStr.length();
- std::pair C =
- parseConstraint(CStr.substr(bidx, eidx), I);
- Res[C.first] = C.second;
+
+ unsigned OpNo;
+ std::string Constr = ParseConstraint(CStr.substr(bidx, eidx), I, OpNo);
+ assert(OpNo < I->OperandList.size() && "Invalid operand no?");
+
+ if (!I->OperandList[OpNo].Constraint.empty())
+ throw "Operand #" + utostr(OpNo) + " cannot have multiple constraints!";
+ I->OperandList[OpNo].Constraint = Constr;
bidx = CStr.find_first_not_of(delims, eidx);
}
-
- return Res;
}
CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
@@ -403,8 +403,17 @@
MIOperandNo += NumOps;
}
- ConstraintStr = R->getValueAsString("Constraints");
- ConstraintsList = parseConstraints(ConstraintStr, this);
+ ParseConstraints(R->getValueAsString("Constraints"), this);
+
+ // For backward compatibility: isTwoAddress means operand 1 is tied to
+ // operand 0.
+ if (isTwoAddress && OperandList[1].Constraint.empty())
+ OperandList[1].Constraint = "((0 << 16) | TargetInstrInfo::TIED_TO)";
+
+ // Any operands with unset constraints get 0 as their constraint.
+ for (unsigned op = 0, e = OperandList.size(); op != e; ++op)
+ if (OperandList[op].Constraint.empty())
+ OperandList[op].Constraint = "0";
}
Index: llvm/utils/TableGen/InstrInfoEmitter.cpp
diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.48 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.49
--- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.48 Mon Nov 6 15:44:54 2006
+++ llvm/utils/TableGen/InstrInfoEmitter.cpp Mon Nov 6 17:49:51 2006
@@ -63,35 +63,52 @@
OS << "0 };\n";
}
-static std::vector >
-GetOperandInfo(const CodeGenInstruction &Inst) {
- std::vector > Result;
+std::vector
+InstrInfoEmitter::GetOperandInfo(const CodeGenInstruction &Inst) {
+ std::vector Result;
for (unsigned i = 0, e = Inst.OperandList.size(); i != e; ++i) {
if (Inst.OperandList[i].Rec->isSubClassOf("RegisterClass")) {
- Result.push_back(std::make_pair(Inst.OperandList[i].Rec,
- Inst.ConstraintsList[i]));
+ std::string OpStr = getQualifiedName(Inst.OperandList[i].Rec);
+ OpStr += "RegClassID, 0, ";
+ OpStr += Inst.OperandList[i].Constraint;
+
+ Result.push_back(OpStr);
} else {
- // This might be a multiple operand thing.
- // Targets like X86 have registers in their multi-operand operands.
+ // This might be a multiple operand thing. Targets like X86 have
+ // registers in their multi-operand operands. It may also be an anonymous
+ // operand, which has a single operand, but no declared class for the
+ // operand.
DagInit *MIOI = Inst.OperandList[i].MIOperandInfo;
- unsigned NumDefs = MIOI->getNumArgs();
+
for (unsigned j = 0, e = Inst.OperandList[i].MINumOperands; j != e; ++j) {
- if (NumDefs <= j) {
- Result.push_back(std::make_pair((Record*)0, Inst.ConstraintsList[i]));
- } else {
- DefInit *Def = dynamic_cast(MIOI->getArg(j));
- Result.push_back(std::make_pair(Def ? Def->getDef() : 0,
- Inst.ConstraintsList[i]));
- }
+ Record *OpR = 0;
+ if (MIOI && j < MIOI->getNumArgs())
+ if (DefInit *Def = dynamic_cast(MIOI->getArg(j)))
+ OpR = Def->getDef();
+
+
+ std::string Res;
+
+ if (OpR && OpR->isSubClassOf("RegisterClass"))
+ Res += getQualifiedName(OpR) + "RegClassID, ";
+ else
+ Res += "0, ";
+
+ // Fill in applicable flags.
+ Res += "0";
+
+ // Ptr value whose register class is resolved via callback.
+ if (OpR && OpR->getName() == "ptr_rc")
+ Res += "|M_LOOK_UP_PTR_REG_CLASS";
+
+ // fill in constraint info.
+ Res += ", " + Inst.OperandList[i].Constraint;
+
+ Result.push_back(Res);
}
}
}
- // For backward compatibility: isTwoAddress means operand 1 is tied to
- // operand 0.
- if (Inst.isTwoAddress)
- Result[1].second |= (0 << 16) | (1 << (unsigned)TargetInstrInfo::TIED_TO);
-
return Result;
}
@@ -127,34 +144,21 @@
}
}
- std::map >, unsigned>
- OperandInfosEmitted;
+ std::map, unsigned> OperandInfosEmitted;
unsigned OperandListNum = 0;
- OperandInfosEmitted[std::vector >()] =
- ++OperandListNum;
+ OperandInfosEmitted[std::vector()] = ++OperandListNum;
// Emit all of the operand info records.
OS << "\n";
for (CodeGenTarget::inst_iterator II = Target.inst_begin(),
E = Target.inst_end(); II != E; ++II) {
- std::vector > OperandInfo =
- GetOperandInfo(II->second);
+ std::vector OperandInfo = GetOperandInfo(II->second);
unsigned &N = OperandInfosEmitted[OperandInfo];
if (N == 0) {
N = ++OperandListNum;
OS << "static const TargetOperandInfo OperandInfo" << N << "[] = { ";
- for (unsigned i = 0, e = OperandInfo.size(); i != e; ++i) {
- Record *RC = OperandInfo[i].first;
- // FIXME: We only care about register operands for now.
- if (RC && RC->isSubClassOf("RegisterClass"))
- OS << "{ " << getQualifiedName(RC) << "RegClassID, 0, ";
- else if (RC && RC->getName() == "ptr_rc")
- // Ptr value whose register class is resolved via callback.
- OS << "{ 0, 1, ";
- else
- OS << "{ 0, 0, ";
- OS << OperandInfo[i].second << " }, ";
- }
+ for (unsigned i = 0, e = OperandInfo.size(); i != e; ++i)
+ OS << "{ " << OperandInfo[i] << " }, ";
OS << "};\n";
}
}
@@ -176,7 +180,7 @@
void InstrInfoEmitter::emitRecord(const CodeGenInstruction &Inst, unsigned Num,
Record *InstrInfo,
std::map, unsigned> &EmittedLists,
- std::map >, unsigned> &OpInfo,
+ std::map, unsigned> &OpInfo,
std::ostream &OS) {
int MinOperands;
if (!Inst.OperandList.empty())
@@ -262,7 +266,7 @@
OS << "ImplicitList" << EmittedLists[DefList] << ", ";
// Emit the operand info.
- std::vector > OperandInfo = GetOperandInfo(Inst);
+ std::vector OperandInfo = GetOperandInfo(Inst);
if (OperandInfo.empty())
OS << "0";
else
Index: llvm/utils/TableGen/InstrInfoEmitter.h
diff -u llvm/utils/TableGen/InstrInfoEmitter.h:1.14 llvm/utils/TableGen/InstrInfoEmitter.h:1.15
--- llvm/utils/TableGen/InstrInfoEmitter.h:1.14 Sun Nov 5 13:31:28 2006
+++ llvm/utils/TableGen/InstrInfoEmitter.h Mon Nov 6 17:49:51 2006
@@ -45,12 +45,13 @@
void emitRecord(const CodeGenInstruction &Inst, unsigned Num,
Record *InstrInfo,
std::map, unsigned> &EL,
- std::map >, unsigned> &OpInfo,
+ std::map, unsigned> &OpInfo,
std::ostream &OS);
void GatherItinClasses();
unsigned ItinClassNumber(std::string ItinName);
void emitShiftedValue(Record *R, StringInit *Val, IntInit *Shift,
std::ostream &OS);
+ std::vector GetOperandInfo(const CodeGenInstruction &Inst);
};
} // End llvm namespace
From sabre at nondot.org Mon Nov 6 17:53:46 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 17:53:46 -0600
Subject: [llvm-commits] CVS: llvm/utils/TableGen/InstrInfoEmitter.cpp
Message-ID: <200611062353.kA6Nrklx021554@zion.cs.uiuc.edu>
Changes in directory llvm/utils/TableGen:
InstrInfoEmitter.cpp updated: 1.49 -> 1.50
---
Log message:
Mark predicate operands as such in operand info.
---
Diffs of the changes: (+4 -0)
InstrInfoEmitter.cpp | 4 ++++
1 files changed, 4 insertions(+)
Index: llvm/utils/TableGen/InstrInfoEmitter.cpp
diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.49 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.50
--- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.49 Mon Nov 6 17:49:51 2006
+++ llvm/utils/TableGen/InstrInfoEmitter.cpp Mon Nov 6 17:53:31 2006
@@ -100,6 +100,10 @@
// Ptr value whose register class is resolved via callback.
if (OpR && OpR->getName() == "ptr_rc")
Res += "|M_LOOK_UP_PTR_REG_CLASS";
+
+ // Predicate operands.
+ if (j == 0 && Inst.OperandList[i].Rec->isSubClassOf("PredicateOperand"))
+ Res += "|M_PREDICATE_OPERAND";
// fill in constraint info.
Res += ", " + Inst.OperandList[i].Constraint;
From sabre at nondot.org Mon Nov 6 17:53:23 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 17:53:23 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h
Message-ID: <200611062353.kA6NrNkH021521@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Target:
TargetInstrInfo.h updated: 1.103 -> 1.104
---
Log message:
Add a new operand flag to mark which operand is the first predicate operand
of an M_PREDICATED instruction.
---
Diffs of the changes: (+5 -0)
TargetInstrInfo.h | 5 +++++
1 files changed, 5 insertions(+)
Index: llvm/include/llvm/Target/TargetInstrInfo.h
diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.103 llvm/include/llvm/Target/TargetInstrInfo.h:1.104
--- llvm/include/llvm/Target/TargetInstrInfo.h:1.103 Mon Nov 6 15:44:17 2006
+++ llvm/include/llvm/Target/TargetInstrInfo.h Mon Nov 6 17:53:08 2006
@@ -90,6 +90,11 @@
// requires a callback to look up its register class.
const unsigned M_LOOK_UP_PTR_REG_CLASS = 1 << 0;
+/// M_PREDICATE_OPERAND - Set if this is the first operand of a predicate
+/// operand that controls an M_PREDICATED instruction.
+const unsigned M_PREDICATE_OPERAND = 1 << 1;
+
+
/// TargetOperandInfo - This holds information about one operand of a machine
/// instruction, indicating the register class for register operands, etc.
///
From sabre at nondot.org Mon Nov 6 19:28:09 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 19:28:09 -0600
Subject: [llvm-commits] CVS: llvm/utils/TableGen/CodeGenTarget.cpp
Message-ID: <200611070128.kA71S9G6022975@zion.cs.uiuc.edu>
Changes in directory llvm/utils/TableGen:
CodeGenTarget.cpp updated: 1.75 -> 1.76
---
Log message:
emit TIED_TO correctly
---
Diffs of the changes: (+2 -2)
CodeGenTarget.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/utils/TableGen/CodeGenTarget.cpp
diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.75 llvm/utils/TableGen/CodeGenTarget.cpp:1.76
--- llvm/utils/TableGen/CodeGenTarget.cpp:1.75 Mon Nov 6 17:49:51 2006
+++ llvm/utils/TableGen/CodeGenTarget.cpp Mon Nov 6 19:27:55 2006
@@ -297,7 +297,7 @@
throw "Illegal tied-to operand constraint '" + CStr + "'";
// Build the string.
- return "((" + utostr(TIdx) + " << 16) | TargetInstrInfo::TIED_TO)";
+ return "((" + utostr(TIdx) + " << 16) | (1 << TargetInstrInfo::TIED_TO))";
}
static void ParseConstraints(const std::string &CStr, CodeGenInstruction *I) {
@@ -408,7 +408,7 @@
// For backward compatibility: isTwoAddress means operand 1 is tied to
// operand 0.
if (isTwoAddress && OperandList[1].Constraint.empty())
- OperandList[1].Constraint = "((0 << 16) | TargetInstrInfo::TIED_TO)";
+ OperandList[1].Constraint = "((0 << 16) | (1 << TargetInstrInfo::TIED_TO))";
// Any operands with unset constraints get 0 as their constraint.
for (unsigned op = 0, e = OperandList.size(); op != e; ++op)
From sabre at nondot.org Mon Nov 6 19:52:04 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 19:52:04 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCInstrFormats.td
Message-ID: <200611070152.kA71q4qR023474@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCInstrFormats.td updated: 1.80 -> 1.81
---
Log message:
fix encoding of BLR
---
Diffs of the changes: (+2 -2)
PPCInstrFormats.td | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCInstrFormats.td
diff -u llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.80 llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.81
--- llvm/lib/Target/PowerPC/PPCInstrFormats.td:1.80 Fri Nov 3 23:42:48 2006
+++ llvm/lib/Target/PowerPC/PPCInstrFormats.td Mon Nov 6 19:51:50 2006
@@ -405,8 +405,8 @@
bits<7> BIBO; // 2 bits of BI and 5 bits of BO.
bits<3> CR;
- let BO = BIBO{0-4};
- let BI{0-1} = BIBO{5-6};
+ let BO = BIBO{2-6};
+ let BI{0-1} = BIBO{0-1};
let BI{2-4} = CR;
let BH = 0;
}
From sabre at nondot.org Mon Nov 6 22:11:36 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 22:11:36 -0600
Subject: [llvm-commits] CVS:
llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll
Message-ID: <200611070411.kA74Bafe025950@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/Generic:
2006-11-06-MemIntrinsicExpand.ll added (r1.1)
---
Log message:
new testcase
---
Diffs of the changes: (+12 -0)
2006-11-06-MemIntrinsicExpand.ll | 12 ++++++++++++
1 files changed, 12 insertions(+)
Index: llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll
diff -c /dev/null llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll:1.1
*** /dev/null Mon Nov 6 22:11:24 2006
--- llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll Mon Nov 6 22:11:14 2006
***************
*** 0 ****
--- 1,12 ----
+ ; RUN: llvm-as < %s | llc -march=x86 &&
+ ; RUN: llvm-as < %s | llc -march=x86 | not grep adc
+
+ ; PR988
+
+ declare void %llvm.memcpy.i64(sbyte*, sbyte*, ulong, uint)
+
+ void %foo(ulong %a) {
+ %b = add ulong %a, 1
+ call void %llvm.memcpy.i64( sbyte* null, sbyte* null, ulong %b, uint 1 )
+ ret void
+ }
From sabre at nondot.org Mon Nov 6 22:11:59 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 22:11:59 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Message-ID: <200611070411.kA74BxGk025968@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.416 -> 1.417
---
Log message:
Fix PR988: http://llvm.org/PR988 and CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll.
The low part goes in the first operand of expandop, not the second one.
---
Diffs of the changes: (+1 -1)
LegalizeDAG.cpp | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.416 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.417
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.416 Thu Nov 2 14:25:49 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov 6 22:11:44 2006
@@ -2039,7 +2039,7 @@
case Expand: {
// Length is too big, just take the lo-part of the length.
SDOperand HiPart;
- ExpandOp(Node->getOperand(3), HiPart, Tmp4);
+ ExpandOp(Node->getOperand(3), Tmp4, HiPart);
break;
}
case Legal:
From sabre at nondot.org Mon Nov 6 22:12:17 2006
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 6 Nov 2006 22:12:17 -0600
Subject: [llvm-commits] CVS:
llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll
Message-ID: <200611070412.kA74CH4U026000@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/Generic:
2006-11-06-MemIntrinsicExpand.ll updated: 1.1 -> 1.2
---
Log message:
wrong bug #
---
Diffs of the changes: (+1 -1)
2006-11-06-MemIntrinsicExpand.ll | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll
diff -u llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll:1.1 llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll:1.2
--- llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll:1.1 Mon Nov 6 22:11:14 2006
+++ llvm/test/Regression/CodeGen/Generic/2006-11-06-MemIntrinsicExpand.ll Mon Nov 6 22:12:03 2006
@@ -1,7 +1,7 @@
; RUN: llvm-as < %s | llc -march=x86 &&
; RUN: llvm-as < %s | llc -march=x86 | not grep adc
-; PR988
+; PR987
declare void %llvm.memcpy.i64(sbyte*, sbyte*, ulong, uint)
From tonic at nondot.org Mon Nov 6 23:25:34 2006
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 6 Nov 2006 23:25:34 -0600
Subject: [llvm-commits] [release_19] CVS: llvm/autoconf/configure.ac
Message-ID: <200611070525.kA75PYeU027393@zion.cs.uiuc.edu>
Changes in directory llvm/autoconf:
configure.ac updated: 1.249 -> 1.249.2.1
---
Log message:
This is the 1.9 release
---
Diffs of the changes: (+1 -1)
configure.ac | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.249 llvm/autoconf/configure.ac:1.249.2.1
--- llvm/autoconf/configure.ac:1.249 Sun Nov 5 11:08:18 2006
+++ llvm/autoconf/configure.ac Mon Nov 6 23:25:12 2006
@@ -31,7 +31,7 @@
dnl===-----------------------------------------------------------------------===
dnl Initialize autoconf and define the package name, version number and
dnl email address for reporting bugs.
-AC_INIT([[llvm]],[[1.9cvs]],[llvmbugs at cs.uiuc.edu])
+AC_INIT([[llvm]],[[1.9]],[llvmbugs at cs.uiuc.edu])
dnl Provide a copyright substitution and ensure the copyright notice is included
dnl in the output of --version option of the generated configure script.
From tonic at nondot.org Mon Nov 6 23:31:12 2006
From: tonic at nondot.org (Tanya Lattner)
Date: Mon, 6 Nov 2006 23:31:12 -0600
Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac
Message-ID: <200611070531.kA75VCNl027513@zion.cs.uiuc.edu>
Changes in directory llvm/autoconf:
configure.ac updated: 1.249 -> 1.250
---
Log message:
Bumping version number
---
Diffs of the changes: (+1 -1)
configure.ac | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/autoconf/configure.ac
diff -u llvm/autoconf/configure.ac:1.249 llvm/autoconf/configure.ac:1.250
--- llvm/autoconf/configure.ac:1.249 Sun Nov 5 11:08:18 2006
+++ llvm/autoconf/configure.ac Mon Nov 6 23:31:00 2006
@@ -31,7 +31,7 @@
dnl===-----------------------------------------------------------------------===
dnl Initialize autoconf and define the package name, version number and
dnl email address for reporting bugs.
-AC_INIT([[llvm]],[[1.9cvs]],[llvmbugs at cs.uiuc.edu])
+AC_INIT([[llvm]],[[2.0cvs]],[llvmbugs at cs.uiuc.edu])
dnl Provide a copyright substitution and ensure the copyright notice is included
dnl in the output of --version option of the generated configure script.
From reid at x10sys.com Tue Nov 7 00:37:10 2006
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 7 Nov 2006 00:37:10 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Message-ID: <200611070637.kA76bATg028556@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
DwarfWriter.cpp updated: 1.97 -> 1.98
---
Log message:
Unbreak X86/ELF Debugging. Somehow this line got lost in Jim's cleanup.
---
Diffs of the changes: (+2 -0)
DwarfWriter.cpp | 2 ++
1 files changed, 2 insertions(+)
Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.97 llvm/lib/CodeGen/DwarfWriter.cpp:1.98
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.97 Mon Nov 6 10:23:59 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp Tue Nov 7 00:36:36 2006
@@ -2418,6 +2418,8 @@
/// EmitFunctionDebugFrame - Emit per function frame info into a debug frame
/// section.
void EmitFunctionDebugFrame() {
+ if (!TAI->getDwarfRequiresFrameSection())
+ return;
// Start the dwarf frame section.
Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
From llvm at cs.uiuc.edu Tue Nov 7 00:56:45 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Tue, 7 Nov 2006 00:56:45 -0600
Subject: [llvm-commits] CVS: llvm/test/Regression/DebugInfo/
Message-ID: <200611070656.kA76ujnM028890@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/DebugInfo:
---
Log message:
Directory /var/cvs/llvm/llvm/test/Regression/DebugInfo added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From sabre at nondot.org Tue Nov 7 01:19:01 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 01:19:01 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
Message-ID: <200611070719.kA77J1i4029292@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
LiveIntervalAnalysis.cpp updated: 1.189 -> 1.190
---
Log message:
Add a new llcbeta option. This speeds up viterbi from 12.34 to 8.76s on
X86. If happy, I'll enable this by default.
---
Diffs of the changes: (+19 -4)
LiveIntervalAnalysis.cpp | 23 +++++++++++++++++++----
1 files changed, 19 insertions(+), 4 deletions(-)
Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.189 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.189 Thu Nov 2 21:04:46 2006
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Nov 7 01:18:40 2006
@@ -59,6 +59,9 @@
EnableJoining("join-liveintervals",
cl::desc("Coallesce copies (default=true)"),
cl::init(true));
+ static cl::opt
+ EnableReweight("enable-majik-f00");
+
}
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
@@ -208,14 +211,26 @@
}
}
+
for (iterator I = begin(), E = end(); I != E; ++I) {
- LiveInterval &li = I->second;
- if (MRegisterInfo::isVirtualRegister(li.reg)) {
+ LiveInterval &LI = I->second;
+ if (MRegisterInfo::isVirtualRegister(LI.reg)) {
// If the live interval length is essentially zero, i.e. in every live
// range the use follows def immediately, it doesn't make sense to spill
// it and hope it will be easier to allocate for this li.
- if (isZeroLengthInterval(&li))
- li.weight = float(HUGE_VAL);
+ if (isZeroLengthInterval(&LI))
+ LI.weight = float(HUGE_VAL);
+
+ if (EnableReweight) {
+ // Divide the weight of the interval by its size. This encourages
+ // spilling of intervals that are large and have few uses, and
+ // discourages spilling of small intervals with many uses.
+ unsigned Size = 0;
+ for (LiveInterval::iterator II = LI.begin(), E = LI.end(); II != E;++II)
+ Size += II->end - II->start;
+
+ LI.weight /= Size;
+ }
}
}
From sabre at nondot.org Tue Nov 7 01:19:17 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 01:19:17 -0600
Subject: [llvm-commits] CVS: llvm-test/Makefile.programs
Message-ID: <200611070719.kA77JH63029306@zion.cs.uiuc.edu>
Changes in directory llvm-test:
Makefile.programs updated: 1.235 -> 1.236
---
Log message:
regalloc hack = llc-beta tonight.
---
Diffs of the changes: (+4 -2)
Makefile.programs | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.235 llvm-test/Makefile.programs:1.236
--- llvm-test/Makefile.programs:1.235 Tue Oct 31 19:36:08 2006
+++ llvm-test/Makefile.programs Tue Nov 7 01:19:03 2006
@@ -193,7 +193,8 @@
endif#DISABLE_DIFFS
ifeq ($(ARCH),PowerPC)
-LLCBETAOPTION := --enable-tail-merge
+LLCBETAOPTION := -enable-majik-f00
+#--enable-tail-merge
#-regalloc=local -fast
endif
ifeq ($(ARCH),Alpha)
@@ -204,7 +205,8 @@
LLCBETAOPTION := -sched=simple
endif
ifeq ($(ARCH),x86)
-LLCBETAOPTION := --enable-tail-merge
+LLCBETAOPTION := -enable-majik-f00
+#--enable-tail-merge
#-regalloc=local -fast
endif
ifeq ($(ARCH),Sparc)
From reid at x10sys.com Tue Nov 7 01:31:58 2006
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 7 Nov 2006 01:31:58 -0600
Subject: [llvm-commits] CVS:
llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp dg.exp
Message-ID: <200611070731.kA77VwwK029618@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/DebugInfo:
2006-11-06-StackTrace.cpp added (r1.1)
dg.exp added (r1.1)
---
Log message:
Add a test case for making sure gdb can get a stack trace with our debug
information.
---
Diffs of the changes: (+32 -0)
2006-11-06-StackTrace.cpp | 29 +++++++++++++++++++++++++++++
dg.exp | 3 +++
2 files changed, 32 insertions(+)
Index: llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp
diff -c /dev/null llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp:1.1
*** /dev/null Tue Nov 7 01:31:48 2006
--- llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp Tue Nov 7 01:31:37 2006
***************
*** 0 ****
--- 1,29 ----
+ // This is a regression test on debug info to make sure that we can get a
+ // meaningful stack trace from a C++ program.
+ // RUN: %llvmgcc -S -O0 -g %s -o Output/%s.ll
+ // RUN: llvm-as < Output/%s.ll | llc -o Output/%s.s
+ // RUN: gcc -g Output/%s.s -o Output/%s.exe
+ // RUN: ( echo "break DeepStack::deepest"; echo "run 17" ; echo "where" ) | gdb Output/%s.exe | grep '#0 DeepStack::deepest (this=.*,x=33)'
+
+ #include
+
+ class DeepStack {
+ int seedVal;
+ public:
+ DeepStack(int seed) : seedVal(seed) {}
+
+ int shallowest( int x ) { return shallower(x + 1); }
+ int shallower ( int x ) { return shallow(x + 2); }
+ int shallow ( int x ) { return deep(x + 3); }
+ int deep ( int x ) { return deeper(x + 4); }
+ int deeper ( int x ) { return deepest(x + 6); }
+ int deepest ( int x ) { return x + 7; }
+
+ int runit() { return shallowest(seedVal); }
+ };
+
+ int main ( int argc, char** argv) {
+
+ DeepStack DS9( (argc > 1 ? atoi(argv[1]) : 0) );
+ return DS9.runit();
+ }
Index: llvm/test/Regression/DebugInfo/dg.exp
diff -c /dev/null llvm/test/Regression/DebugInfo/dg.exp:1.1
*** /dev/null Tue Nov 7 01:31:58 2006
--- llvm/test/Regression/DebugInfo/dg.exp Tue Nov 7 01:31:37 2006
***************
*** 0 ****
--- 1,3 ----
+ load_lib llvm-dg.exp
+
+ llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] $objdir $srcdir $subdir $target_triplet $llvmgcc $llvmgxx $prcontext $llvmgcc_version
From reid at x10sys.com Tue Nov 7 01:35:11 2006
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 7 Nov 2006 01:35:11 -0600
Subject: [llvm-commits] CVS: llvm/test/Regression/DebugInfo/.cvsignore
Message-ID: <200611070735.kA77ZBMu029684@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/DebugInfo:
.cvsignore added (r1.1)
---
Log message:
Ignore the Output dir.
---
Diffs of the changes: (+1 -0)
.cvsignore | 1 +
1 files changed, 1 insertion(+)
Index: llvm/test/Regression/DebugInfo/.cvsignore
diff -c /dev/null llvm/test/Regression/DebugInfo/.cvsignore:1.1
*** /dev/null Tue Nov 7 01:35:06 2006
--- llvm/test/Regression/DebugInfo/.cvsignore Tue Nov 7 01:34:56 2006
***************
*** 0 ****
--- 1 ----
+ Output
From reid at x10sys.com Tue Nov 7 01:58:28 2006
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 7 Nov 2006 01:58:28 -0600
Subject: [llvm-commits] CVS:
llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp
Message-ID: <200611070758.kA77wSWT030021@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/DebugInfo:
2006-11-06-StackTrace.cpp updated: 1.1 -> 1.2
---
Log message:
Make some corrections to this test case.
---
Diffs of the changes: (+6 -4)
2006-11-06-StackTrace.cpp | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Index: llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp
diff -u llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp:1.1 llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp:1.2
--- llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp:1.1 Tue Nov 7 01:31:37 2006
+++ llvm/test/Regression/DebugInfo/2006-11-06-StackTrace.cpp Tue Nov 7 01:58:02 2006
@@ -1,9 +1,11 @@
// This is a regression test on debug info to make sure that we can get a
// meaningful stack trace from a C++ program.
-// RUN: %llvmgcc -S -O0 -g %s -o Output/%s.ll
-// RUN: llvm-as < Output/%s.ll | llc -o Output/%s.s
-// RUN: gcc -g Output/%s.s -o Output/%s.exe
-// RUN: ( echo "break DeepStack::deepest"; echo "run 17" ; echo "where" ) | gdb Output/%s.exe | grep '#0 DeepStack::deepest (this=.*,x=33)'
+// RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc -o Output/StackTrace.s -f
+// RUN: gcc -g Output/StackTrace.s -o Output/StackTrace.exe -lstdc++
+// RUN: ( echo "break DeepStack::deepest"; echo "run 17" ; echo "where" ) > Output/StackTrace.gdbin
+// RUN: gdb -q -batch -n -x Output/StackTrace.gdbin Output/StackTrace.exe | tee Output/StackTrace.out | grep '#0 DeepStack::deepest (this=.*,x=33)'
+// RUN: gdb -q -batch -n -x Output/StackTrace.gdbin Output/StackTrace.exe | grep '#7 0x.* in main(argc=1, argv=.*)'
+
#include
From evan.cheng at apple.com Tue Nov 7 03:03:30 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 7 Nov 2006 03:03:30 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Message-ID: <200611070903.kA793UoN007164@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
DAGCombiner.cpp updated: 1.238 -> 1.239
---
Log message:
Add post-indexed load / store transformations.
---
Diffs of the changes: (+199 -50)
DAGCombiner.cpp | 249 ++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 199 insertions(+), 50 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.238 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.239
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.238 Mon Nov 6 02:14:30 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Nov 7 03:03:05 2006
@@ -47,6 +47,11 @@
static Statistic<> NodesCombined ("dagcombiner",
"Number of dag nodes combined");
+ static Statistic<> PreIndexedNodes ("pre_indexed_ops",
+ "Number of pre-indexed nodes created");
+ static Statistic<> PostIndexedNodes ("post_indexed_ops",
+ "Number of post-indexed nodes created");
+
static cl::opt
CombinerAA("combiner-alias-analysis", cl::Hidden,
cl::desc("Turn on alias analysis during testing"));
@@ -174,13 +179,16 @@
return true;
}
- /// CombineToPreIndexedLoadStore - Try turning a load / store into a
- /// pre-indexed load store when the base pointer is a add or subtract
- /// and it has other uses besides the load / store. When the
- /// transformation is done, the new indexed load / store effectively
- /// folded the add / subtract in and all of its other uses are redirected
- /// to the new load / store.
+ /// CombineToPreIndexedLoadStore - Try turning a load / store and a
+ /// pre-indexed load / store when the base pointer is a add or subtract
+ /// and it has other uses besides the load / store. After the
+ /// transformation, the new indexed load / store has effectively folded
+ /// the add / subtract in and all of its other uses are redirected to the
+ /// new load / store.
bool CombineToPreIndexedLoadStore(SDNode *N) {
+ if (!AfterLegalize)
+ return false;
+
bool isLoad = true;
SDOperand Ptr;
if (LoadSDNode *LD = dyn_cast(N)) {
@@ -191,8 +199,7 @@
} else
return false;
- if (AfterLegalize &&
- (Ptr.getOpcode() == ISD::ADD || Ptr.getOpcode() == ISD::SUB) &&
+ if ((Ptr.getOpcode() == ISD::ADD || Ptr.getOpcode() == ISD::SUB) &&
Ptr.Val->use_size() > 1) {
SDOperand BasePtr;
SDOperand Offset;
@@ -203,57 +210,56 @@
// that would create a cycle.
// 2) All uses are load / store ops that use it as base ptr and offset
// is just an addressing mode immediate.
- // 3) If the would-be new base may not to be dead at N. FIXME: The
- // proper check is too expensive (in turns of compile time) to
- // check. Just make sure other uses of the new base are not also
- // themselves use of loads / stores.
-
- bool OffIsAMImm = Offset.getOpcode() == ISD::Constant &&
- TLI.isLegalAddressImmediate(
- cast(Offset)->getValue());
+ // 3) If the would-be new base may not to be dead at N.
+
+ bool OffIsAMImm = Offset.getOpcode() == ISD::Constant && TLI.
+ isLegalAddressImmediate(cast(Offset)->getValue());
// Check for #3.
- if (OffIsAMImm && BasePtr.Val->use_size() > 1) {
- for (SDNode::use_iterator I = BasePtr.Val->use_begin(),
- E = BasePtr.Val->use_end(); I != E; ++I) {
- SDNode *Use = *I;
- if (Use == Ptr.Val)
- continue;
- if (Use->getOpcode() == ISD::ADD || Use->getOpcode() == ISD::SUB){
- for (SDNode::use_iterator II = Use->use_begin(),
- EE = Use->use_end(); II != EE; ++II) {
- SDNode *UseUse = *II;
- if (UseUse->getOpcode() == ISD::LOAD &&
- cast(UseUse)->getBasePtr().Val == Use)
- return false;
- else if (UseUse->getOpcode() == ISD::STORE &&
- cast(UseUse)->getBasePtr().Val == Use)
- return false;
- }
+ for (SDNode::use_iterator I = BasePtr.Val->use_begin(),
+ E = BasePtr.Val->use_end(); I != E; ++I) {
+ SDNode *Use = *I;
+ if (Use == Ptr.Val)
+ continue;
+ if (Use->getOpcode() == ISD::CopyToReg)
+ return false;
+ if (OffIsAMImm && (Use->getOpcode() == ISD::ADD ||
+ Use->getOpcode() == ISD::SUB)) {
+ for (SDNode::use_iterator II = Use->use_begin(),
+ EE = Use->use_end(); II != EE; ++II) {
+ SDNode *UseUse = *II;
+ if (UseUse->getOpcode() == ISD::LOAD &&
+ cast(UseUse)->getBasePtr().Val == Use)
+ return false;
+ else if (UseUse->getOpcode() == ISD::STORE &&
+ cast(UseUse)->getBasePtr().Val == Use)
+ return false;
}
}
}
// Now check for #1 and #2.
unsigned NumRealUses = 0;
- for (SDNode::use_iterator I = Ptr.Val->use_begin(),
- E = Ptr.Val->use_end(); I != E; ++I) {
- SDNode *Use = *I;
- if (Use == N)
- continue;
- if (Use->isPredecessor(N))
- return false;
+ if (OffIsAMImm) {
+ for (SDNode::use_iterator I = Ptr.Val->use_begin(),
+ E = Ptr.Val->use_end(); I != E; ++I) {
+ SDNode *Use = *I;
+ if (Use == N)
+ continue;
+ if (Use->isPredecessor(N))
+ return false;
- if (!OffIsAMImm) {
- NumRealUses++;
- } else if (Use->getOpcode() == ISD::LOAD) {
- if (cast(Use)->getBasePtr().Val != Ptr.Val)
+ if (!OffIsAMImm) {
NumRealUses++;
- } else if (Use->getOpcode() == ISD::STORE) {
- if (cast(Use)->getBasePtr().Val != Ptr.Val)
+ } else if (Use->getOpcode() == ISD::LOAD) {
+ if (cast(Use)->getBasePtr().Val != Ptr.Val)
+ NumRealUses++;
+ } else if (Use->getOpcode() == ISD::STORE) {
+ if (cast(Use)->getBasePtr().Val != Ptr.Val)
+ NumRealUses++;
+ } else
NumRealUses++;
- } else
- NumRealUses++;
+ }
}
if (NumRealUses == 0)
return false;
@@ -261,6 +267,7 @@
SDOperand Result = isLoad
? DAG.getIndexedLoad(SDOperand(N,0), BasePtr, Offset, AM)
: DAG.getIndexedStore(SDOperand(N,0), BasePtr, Offset, AM);
+ ++PreIndexedNodes;
++NodesCombined;
DEBUG(std::cerr << "\nReplacing.4 "; N->dump();
std::cerr << "\nWith: "; Result.Val->dump(&DAG);
@@ -294,7 +301,149 @@
return true;
}
}
+ return false;
+ }
+
+ /// CombineToPostIndexedLoadStore - Try combine a load / store with a
+ /// add / sub of the base pointer node into a post-indexed load / store.
+ /// The transformation folded the add / subtract into the new indexed
+ /// load / store effectively and all of its uses are redirected to the
+ /// new load / store.
+ bool CombineToPostIndexedLoadStore(SDNode *N) {
+ if (!AfterLegalize)
+ return false;
+
+ bool isLoad = true;
+ SDOperand Ptr;
+ MVT::ValueType VT;
+ if (LoadSDNode *LD = dyn_cast(N)) {
+ Ptr = LD->getBasePtr();
+ VT = LD->getLoadedVT();
+ } else if (StoreSDNode *ST = dyn_cast(N)) {
+ Ptr = ST->getBasePtr();
+ VT = ST->getStoredVT();
+ isLoad = false;
+ } else
+ return false;
+
+ if (Ptr.Val->use_size() > 1) {
+ for (SDNode::use_iterator I = Ptr.Val->use_begin(),
+ E = Ptr.Val->use_end(); I != E; ++I) {
+ SDNode *Op = *I;
+ if (Op == N ||
+ (Op->getOpcode() != ISD::ADD && Op->getOpcode() != ISD::SUB))
+ continue;
+
+ SDOperand BasePtr;
+ SDOperand Offset;
+ ISD::MemOpAddrMode AM = ISD::UNINDEXED;
+ if (TLI.getPostIndexedAddressParts(Op, VT, BasePtr, Offset, AM,DAG) &&
+ BasePtr.Val == Ptr.Val) {
+ // Try turning it into a post-indexed load / store except when
+ // 1) Op must be independent of N, i.e. Op is neither a predecessor
+ // nor a successor of N. Otherwise, if Op is folded that would
+ // create a cycle.
+ // 2) All uses are load / store ops that use it as base ptr and offset
+ // is just an addressing mode immediate.
+ // 3) If the would-be new base may not to be dead at N.
+
+ bool OffIsAMImm = Offset.getOpcode() == ISD::Constant && TLI.
+ isLegalAddressImmediate(cast(Offset)->getValue());
+
+ // Check for #3.
+ bool TryNext = false;
+ for (SDNode::use_iterator II = BasePtr.Val->use_begin(),
+ EE = BasePtr.Val->use_end(); II != EE; ++II) {
+ SDNode *Use = *II;
+ if (Use == Ptr.Val)
+ continue;
+ if (Use->getOpcode() == ISD::CopyToReg) {
+ TryNext = true;
+ break;
+ }
+
+ if (OffIsAMImm && (Use->getOpcode() == ISD::ADD ||
+ Use->getOpcode() == ISD::SUB)) {
+ for (SDNode::use_iterator III = Use->use_begin(),
+ EEE = Use->use_end(); III != EEE; ++III) {
+ SDNode *UseUse = *III;
+ if (UseUse->getOpcode() == ISD::LOAD &&
+ cast(UseUse)->getBasePtr().Val == Use) {
+ TryNext = true;
+ break;
+ } else if (UseUse->getOpcode() == ISD::STORE &&
+ cast(UseUse)->getBasePtr().Val == Use) {
+
+ TryNext = true;
+ break;
+ }
+ }
+ }
+ }
+ if (TryNext)
+ continue;
+ if (OffIsAMImm) {
+ // Check for #2.
+ unsigned NumRealUses = 0;
+ for (SDNode::use_iterator II = Op->use_begin(), EE = Op->use_end();
+ II != EE; ++II) {
+ SDNode *Use = *II;
+ if (Use->getOpcode() == ISD::LOAD) {
+ if (cast(Use)->getBasePtr().Val != Op)
+ NumRealUses++;
+ } else if (Use->getOpcode() == ISD::STORE) {
+ if (cast(Use)->getBasePtr().Val != Op)
+ NumRealUses++;
+ } else
+ NumRealUses++;
+ }
+ if (NumRealUses == 0)
+ continue;
+ }
+
+ // Check for #1
+ if (!Op->isPredecessor(N) && !N->isPredecessor(Op)) {
+ SDOperand Result = isLoad
+ ? DAG.getIndexedLoad(SDOperand(N,0), BasePtr, Offset, AM)
+ : DAG.getIndexedStore(SDOperand(N,0), BasePtr, Offset, AM);
+ ++PostIndexedNodes;
+ ++NodesCombined;
+ DEBUG(std::cerr << "\nReplacing.5 "; N->dump();
+ std::cerr << "\nWith: "; Result.Val->dump(&DAG);
+ std::cerr << '\n');
+ std::vector NowDead;
+ if (isLoad) {
+ DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(0),
+ NowDead);
+ DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 1), Result.getValue(2),
+ NowDead);
+ } else {
+ DAG.ReplaceAllUsesOfValueWith(SDOperand(N, 0), Result.getValue(1),
+ NowDead);
+ }
+
+ // Nodes can end up on the worklist more than once. Make sure we do
+ // not process a node that has been replaced.
+ for (unsigned i = 0, e = NowDead.size(); i != e; ++i)
+ removeFromWorkList(NowDead[i]);
+ // Finally, since the node is now dead, remove it from the graph.
+ DAG.DeleteNode(N);
+
+ // Replace the uses of Use with uses of the updated base value.
+ DAG.ReplaceAllUsesOfValueWith(SDOperand(Op, 0),
+ Result.getValue(isLoad ? 1 : 0),
+ NowDead);
+ removeFromWorkList(Op);
+ for (unsigned i = 0, e = NowDead.size(); i != e; ++i)
+ removeFromWorkList(NowDead[i]);
+ DAG.DeleteNode(Op);
+
+ return true;
+ }
+ }
+ }
+ }
return false;
}
@@ -2877,7 +3026,7 @@
}
// Try transforming N to an indexed load.
- if (CombineToPreIndexedLoadStore(N))
+ if (CombineToPreIndexedLoadStore(N) || CombineToPostIndexedLoadStore(N))
return SDOperand(N, 0);
return SDOperand();
@@ -2923,7 +3072,7 @@
}
// Try transforming N to an indexed store.
- if (CombineToPreIndexedLoadStore(N))
+ if (CombineToPreIndexedLoadStore(N) || CombineToPostIndexedLoadStore(N))
return SDOperand(N, 0);
return SDOperand();
From evan.cheng at apple.com Tue Nov 7 03:04:30 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 7 Nov 2006 03:04:30 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h
Message-ID: <200611070904.kA794Ubq007198@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Target:
TargetLowering.h updated: 1.86 -> 1.87
---
Log message:
Added target hook for post-indexed memory ops transformation.
---
Diffs of the changes: (+10 -0)
TargetLowering.h | 10 ++++++++++
1 files changed, 10 insertions(+)
Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.86 llvm/include/llvm/Target/TargetLowering.h:1.87
--- llvm/include/llvm/Target/TargetLowering.h:1.86 Fri Nov 3 01:19:02 2006
+++ llvm/include/llvm/Target/TargetLowering.h Tue Nov 7 03:04:16 2006
@@ -382,6 +382,16 @@
return false;
}
+ /// getPostIndexedAddressParts - returns true by value, base pointer and
+ /// offset pointer and addressing mode by reference if this node can be
+ /// combined with a load / store to form a post-indexed load / store.
+ virtual bool getPostIndexedAddressParts(SDNode *N, MVT::ValueType VT,
+ SDOperand &Base, SDOperand &Offset,
+ ISD::MemOpAddrMode &AM,
+ SelectionDAG &DAG) {
+ return false;
+ }
+
//===--------------------------------------------------------------------===//
// TargetLowering Optimization Methods
//
From jlaskey at apple.com Tue Nov 7 06:26:05 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 7 Nov 2006 06:26:05 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
RegAllocLinearScan.cpp
Message-ID: <200611071226.kA7CQ5v8011213@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
LiveIntervalAnalysis.cpp updated: 1.190 -> 1.191
RegAllocLinearScan.cpp updated: 1.129 -> 1.130
---
Log message:
Use correct value for float HUGH_VAL.
---
Diffs of the changes: (+6 -6)
LiveIntervalAnalysis.cpp | 8 ++++----
RegAllocLinearScan.cpp | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.191
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.190 Tue Nov 7 01:18:40 2006
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Nov 7 06:25:45 2006
@@ -219,7 +219,7 @@
// range the use follows def immediately, it doesn't make sense to spill
// it and hope it will be easier to allocate for this li.
if (isZeroLengthInterval(&LI))
- LI.weight = float(HUGE_VAL);
+ LI.weight = HUGE_VALF;
if (EnableReweight) {
// Divide the weight of the interval by its size. This encourages
@@ -265,7 +265,7 @@
std::vector added;
- assert(li.weight != HUGE_VAL &&
+ assert(li.weight != HUGE_VALF &&
"attempt to spill already spilled interval!");
DEBUG(std::cerr << "\t\t\t\tadding intervals for spills for interval: ";
@@ -340,7 +340,7 @@
// the spill weight is now infinity as it
// cannot be spilled again
- nI.weight = float(HUGE_VAL);
+ nI.weight = HUGE_VALF;
if (HasUse) {
LiveRange LR(getLoadIndex(index), getUseIndex(index),
@@ -1362,6 +1362,6 @@
LiveInterval LiveIntervals::createInterval(unsigned reg) {
float Weight = MRegisterInfo::isPhysicalRegister(reg) ?
- (float)HUGE_VAL : 0.0F;
+ HUGE_VALF : 0.0F;
return LiveInterval(reg, Weight);
}
Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.129 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.130
--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.129 Tue Oct 24 09:35:25 2006
+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Tue Nov 7 06:25:45 2006
@@ -545,7 +545,7 @@
DEBUG(std::cerr << "\tassigning stack slot at interval "<< *cur << ":\n");
// Find a register to spill.
- float minWeight = float(HUGE_VAL);
+ float minWeight = HUGE_VALF;
unsigned minReg = 0;
for (TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_),
e = RC->allocation_order_end(*mf_); i != e; ++i) {
@@ -582,7 +582,7 @@
// if the current has the minimum weight, we need to spill it and
// add any added intervals back to unhandled, and restart
// linearscan.
- if (cur->weight != float(HUGE_VAL) && cur->weight <= minWeight) {
+ if (cur->weight != HUGE_VALF && cur->weight <= minWeight) {
DEBUG(std::cerr << "\t\t\tspilling(c): " << *cur << '\n';);
int slot = vrm_->assignVirt2StackSlot(cur->reg);
std::vector added =
From alenhar2 at cs.uiuc.edu Tue Nov 7 10:33:24 2006
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Tue, 7 Nov 2006 10:33:24 -0600
Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/Alpha/add.ll
Message-ID: <200611071633.kA7GXOuo031655@apoc.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/Alpha:
add.ll updated: 1.1 -> 1.2
---
Log message:
Fix this test
---
Diffs of the changes: (+14 -14)
add.ll | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
Index: llvm/test/Regression/CodeGen/Alpha/add.ll
diff -u llvm/test/Regression/CodeGen/Alpha/add.ll:1.1 llvm/test/Regression/CodeGen/Alpha/add.ll:1.2
--- llvm/test/Regression/CodeGen/Alpha/add.ll:1.1 Tue Oct 31 13:50:55 2006
+++ llvm/test/Regression/CodeGen/Alpha/add.ll Tue Nov 7 10:32:55 2006
@@ -1,19 +1,19 @@
;test all the shifted and signextending adds and subs with and without consts
-; RUN: llvm-as < %s | llc -march=alpha | grep ' addl' |wc -l |grep 2
-; RUN: llvm-as < %s | llc -march=alpha | grep ' addq' |wc -l |grep 2
-; RUN: llvm-as < %s | llc -march=alpha | grep ' subl' |wc -l |grep 2
-; RUN: llvm-as < %s | llc -march=alpha | grep ' subq' |wc -l |grep 1
-; RUN: llvm-as < %s | llc -march=alpha | grep 'lda $0,-100($16)' |wc -l |grep 1
-
-; RUN: llvm-as < %s | llc -march=alpha | grep 's4addl' |wc -l |grep 2
-; RUN: llvm-as < %s | llc -march=alpha | grep 's8addl' |wc -l |grep 2
-; RUN: llvm-as < %s | llc -march=alpha | grep 's4addq' |wc -l |grep 2
-; RUN: llvm-as < %s | llc -march=alpha | grep 's8addq' |wc -l |grep 2
-
-; RUN: llvm-as < %s | llc -march=alpha | grep 's4subl' |wc -l |grep 2
-; RUN: llvm-as < %s | llc -march=alpha | grep 's8subl' |wc -l |grep 2
-; RUN: llvm-as < %s | llc -march=alpha | grep 's4subq' |wc -l |grep 2
+; RUN: llvm-as < %s | llc -march=alpha | grep ' addl' |wc -l |grep 2 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep ' addq' |wc -l |grep 2 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep ' subl' |wc -l |grep 2 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep ' subq' |wc -l |grep 1 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep 'lda $0,-100($16)' |wc -l |grep 1 &&
+
+; RUN: llvm-as < %s | llc -march=alpha | grep 's4addl' |wc -l |grep 2 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep 's8addl' |wc -l |grep 2 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep 's4addq' |wc -l |grep 2 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep 's8addq' |wc -l |grep 2 &&
+
+; RUN: llvm-as < %s | llc -march=alpha | grep 's4subl' |wc -l |grep 2 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep 's8subl' |wc -l |grep 2 &&
+; RUN: llvm-as < %s | llc -march=alpha | grep 's4subq' |wc -l |grep 2 &&
; RUN: llvm-as < %s | llc -march=alpha | grep 's8subq' |wc -l |grep 2
implementation ; Functions:
From alenhar2 at cs.uiuc.edu Tue Nov 7 10:40:47 2006
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Tue, 7 Nov 2006 10:40:47 -0600
Subject: [llvm-commits] CVS:
llvm/test/Regression/Transforms/InstCombine/2006-11-03-Memmove64.ll
2007-11-03-Memmove64.ll
Message-ID: <200611071640.kA7Gelq8031778@apoc.cs.uiuc.edu>
Changes in directory llvm/test/Regression/Transforms/InstCombine:
2006-11-03-Memmove64.ll added (r1.1)
2007-11-03-Memmove64.ll (r1.1) removed
---
Log message:
Got a little ahead of myself here
---
Diffs of the changes: (+18 -0)
2006-11-03-Memmove64.ll | 18 ++++++++++++++++++
1 files changed, 18 insertions(+)
Index: llvm/test/Regression/Transforms/InstCombine/2006-11-03-Memmove64.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2006-11-03-Memmove64.ll:1.1
*** /dev/null Tue Nov 7 10:40:30 2006
--- llvm/test/Regression/Transforms/InstCombine/2006-11-03-Memmove64.ll Tue Nov 7 10:40:19 2006
***************
*** 0 ****
--- 1,18 ----
+ ;RUN: llvm-as < %s | opt -instcombine | llvm-dis |not grep memmove.i32
+ ; Instcombine was trying to turn this into a memmove.i32
+
+ target datalayout = "e-p:64:64"
+ target endian = little
+ target pointersize = 64
+ target triple = "alphaev67-unknown-linux-gnu"
+ %str10 = internal constant [1 x sbyte] zeroinitializer ; <[1 x sbyte]*> [#uses=1]
+
+ implementation ; Functions:
+
+ void %do_join(sbyte* %b) {
+ entry:
+ call void %llvm.memmove.i64( sbyte* %b, sbyte* getelementptr ([1 x sbyte]* %str10, int 0, ulong 0), ulong 1, uint 1 )
+ ret void
+ }
+
+ declare void %llvm.memmove.i64(sbyte*, sbyte*, ulong, uint)
From sabre at nondot.org Tue Nov 7 11:58:09 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 11:58:09 -0600
Subject: [llvm-commits] CVS: llvm-test/Makefile.programs
Message-ID: <200611071758.kA7Hw9x6017109@zion.cs.uiuc.edu>
Changes in directory llvm-test:
Makefile.programs updated: 1.236 -> 1.237
---
Log message:
disable majik-f00
---
Diffs of the changes: (+2 -4)
Makefile.programs | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.236 llvm-test/Makefile.programs:1.237
--- llvm-test/Makefile.programs:1.236 Tue Nov 7 01:19:03 2006
+++ llvm-test/Makefile.programs Tue Nov 7 11:57:53 2006
@@ -193,8 +193,7 @@
endif#DISABLE_DIFFS
ifeq ($(ARCH),PowerPC)
-LLCBETAOPTION := -enable-majik-f00
-#--enable-tail-merge
+LLCBETAOPTION := --enable-tail-merge
#-regalloc=local -fast
endif
ifeq ($(ARCH),Alpha)
@@ -205,8 +204,7 @@
LLCBETAOPTION := -sched=simple
endif
ifeq ($(ARCH),x86)
-LLCBETAOPTION := -enable-majik-f00
-#--enable-tail-merge
+LLCBETAOPTION := --enable-tail-merge
#-regalloc=local -fast
endif
ifeq ($(ARCH),Sparc)
From sabre at nondot.org Tue Nov 7 12:05:13 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 12:05:13 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
Message-ID: <200611071805.kA7I5DUv017363@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
LiveIntervalAnalysis.cpp updated: 1.191 -> 1.192
---
Log message:
Enable improved spilling costs by default. This speeds up viterbi on x86
by 40%, FreeBench/fourinarow by 20%, and many other programs 10-25%.
On PPC, this speeds up fourinarow by 18%, and probably other things as well.
---
Diffs of the changes: (+7 -12)
LiveIntervalAnalysis.cpp | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.191 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.192
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.191 Tue Nov 7 06:25:45 2006
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Nov 7 12:04:58 2006
@@ -59,9 +59,6 @@
EnableJoining("join-liveintervals",
cl::desc("Coallesce copies (default=true)"),
cl::init(true));
- static cl::opt
- EnableReweight("enable-majik-f00");
-
}
void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const {
@@ -221,16 +218,14 @@
if (isZeroLengthInterval(&LI))
LI.weight = HUGE_VALF;
- if (EnableReweight) {
- // Divide the weight of the interval by its size. This encourages
- // spilling of intervals that are large and have few uses, and
- // discourages spilling of small intervals with many uses.
- unsigned Size = 0;
- for (LiveInterval::iterator II = LI.begin(), E = LI.end(); II != E;++II)
- Size += II->end - II->start;
+ // Divide the weight of the interval by its size. This encourages
+ // spilling of intervals that are large and have few uses, and
+ // discourages spilling of small intervals with many uses.
+ unsigned Size = 0;
+ for (LiveInterval::iterator II = LI.begin(), E = LI.end(); II != E;++II)
+ Size += II->end - II->start;
- LI.weight /= Size;
- }
+ LI.weight /= Size;
}
}
From sabre at nondot.org Tue Nov 7 12:13:15 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 12:13:15 -0600
Subject: [llvm-commits] CVS:
llvm-test/MultiSource/Applications/viterbi/dec_viterbi_F.c
Message-ID: <200611071813.kA7IDFMU017560@zion.cs.uiuc.edu>
Changes in directory llvm-test/MultiSource/Applications/viterbi:
dec_viterbi_F.c updated: 1.2 -> 1.3
---
Log message:
patch by Anton, which 'fixes viterbi algorithm on coderates other than 1/2'.
This shouldn't affect performance.
---
Diffs of the changes: (+4 -4)
dec_viterbi_F.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: llvm-test/MultiSource/Applications/viterbi/dec_viterbi_F.c
diff -u llvm-test/MultiSource/Applications/viterbi/dec_viterbi_F.c:1.2 llvm-test/MultiSource/Applications/viterbi/dec_viterbi_F.c:1.3
--- llvm-test/MultiSource/Applications/viterbi/dec_viterbi_F.c:1.2 Tue Oct 3 18:31:21 2006
+++ llvm-test/MultiSource/Applications/viterbi/dec_viterbi_F.c Tue Nov 7 12:13:00 2006
@@ -55,10 +55,6 @@
fflush(stdout);
}
#endif /* 0 */
- if (i_punct == param->n_in) {
- i_punct = 0;
- }
-
memcpy(Metr0, Metr, Metr_mem->length*sizeof(double));
memcpy(Metr1, Metr, Metr_mem->length*sizeof(double));
@@ -129,6 +125,10 @@
history[i][j] = history_new[i][j];
}
}
+
+ if (++i_punct == param->n_in) {
+ i_punct = 0;
+ }
}
bit_stream->data = (unsigned char*)realloc(bit_stream->data, bv*sizeof(unsigned char));
From sabre at nondot.org Tue Nov 7 12:30:35 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 12:30:35 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/README.txt
Message-ID: <200611071830.kA7IUZ3x017936@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
README.txt updated: 1.103 -> 1.104
---
Log message:
add a note from viterbi
---
Diffs of the changes: (+29 -0)
README.txt | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+)
Index: llvm/lib/Target/PowerPC/README.txt
diff -u llvm/lib/Target/PowerPC/README.txt:1.103 llvm/lib/Target/PowerPC/README.txt:1.104
--- llvm/lib/Target/PowerPC/README.txt:1.103 Fri Oct 27 17:02:19 2006
+++ llvm/lib/Target/PowerPC/README.txt Tue Nov 7 12:30:21 2006
@@ -11,6 +11,35 @@
===-------------------------------------------------------------------------===
+We compile the hottest inner loop of viterbi to:
+
+ li r6, 0
+ b LBB1_84 ;bb432.i
+LBB1_83: ;bb420.i
+ lbzx r8, r5, r7
+ addi r6, r7, 1
+ stbx r8, r4, r7
+LBB1_84: ;bb432.i
+ mr r7, r6
+ cmplwi cr0, r7, 143
+ bne cr0, LBB1_83 ;bb420.i
+
+The CBE manages to produce:
+
+ li r0, 143
+ mtctr r0
+loop:
+ lbzx r2, r2, r11
+ stbx r0, r2, r9
+ addi r2, r2, 1
+ bdz later
+ b loop
+
+This could be much better (bdnz instead of bdz) but it still beats us. If we
+produced this with bdnz, the loop would be a single dispatch group.
+
+===-------------------------------------------------------------------------===
+
Compile:
void foo(int *P) {
From jlaskey at apple.com Tue Nov 7 13:34:03 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 7 Nov 2006 13:34:03 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineDebugInfo.h
Passes.h
Message-ID: <200611071934.kA7JY3EJ004731@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
MachineDebugInfo.h updated: 1.44 -> 1.45
Passes.h updated: 1.21 -> 1.22
---
Log message:
1. Add a pass to fold debug label instructions so a debug info client can detect
empty ranges.
2. Reorg how MachineDebugInfo maintains changes to debug labels.
3. Have dwarf writer use debug label info to simplify scopes and source line
coorespondence.
4. Revert the merging of compile units until I can get the bugs ironed out.
---
Diffs of the changes: (+30 -11)
MachineDebugInfo.h | 36 +++++++++++++++++++++++++-----------
Passes.h | 5 +++++
2 files changed, 30 insertions(+), 11 deletions(-)
Index: llvm/include/llvm/CodeGen/MachineDebugInfo.h
diff -u llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.44 llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.45
--- llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.44 Tue Oct 24 06:50:43 2006
+++ llvm/include/llvm/CodeGen/MachineDebugInfo.h Tue Nov 7 13:33:46 2006
@@ -969,8 +969,11 @@
// Lines - List of of source line correspondence.
std::vector Lines;
- // LabelID - Current number assigned to unique label numbers.
- unsigned LabelID;
+ // LabelIDList - One entry per assigned label. Normally the entry is equal to
+ // the list index(+1). If the entry is zero then the label has been deleted.
+ // Any other value indicates the label has been deleted by is mapped to
+ // another label.
+ std::vector LabelIDList;
// ScopeMap - Tracks the scopes in the current function.
std::map ScopeMap;
@@ -979,10 +982,6 @@
//
DebugScope *RootScope;
- // DeletedLabelIDs - Sorted list of label IDs that have been removed from the
- // module.
- std::vector DeletedLabelIDs;
-
// FrameMoves - List of moves done by a function's prolog. Used to construct
// frame maps by debug consumers.
std::vector FrameMoves;
@@ -1026,7 +1025,11 @@
/// NextLabelID - Return the next unique label id.
///
- unsigned NextLabelID() { return ++LabelID; }
+ unsigned NextLabelID() {
+ unsigned ID = LabelIDList.size() + 1;
+ LabelIDList.push_back(ID);
+ return ID;
+ }
/// RecordLabel - Records location information and associates it with a
/// debug label. Returns a unique label ID used to generate a label and
@@ -1035,11 +1038,22 @@
/// InvalidateLabel - Inhibit use of the specified label # from
/// MachineDebugInfo, for example because the code was deleted.
- void InvalidateLabel(unsigned LabelID);
+ void InvalidateLabel(unsigned LabelID) {
+ // Remap to zero to indicate deletion.
+ RemapLabel(LabelID, 0);
+ }
+
+ /// RemapLabel - Indicate that a label has been merged into another.
+ ///
+ void RemapLabel(unsigned OldLabelID, unsigned NewLabelID) {
+ LabelIDList[OldLabelID - 1] = NewLabelID;
+ }
- /// isLabelValid - Check to make sure the label is still valid before
- /// attempting to use.
- bool isLabelValid(unsigned LabelID);
+ /// MappedLabel - Find out the label's final ID. Zero indicates deletion.
+ /// ID != Mapped ID indicates that the label was folded into another label.
+ unsigned MappedLabel(unsigned LabelID) const {
+ return LabelIDList[LabelID - 1];
+ }
/// RecordSource - Register a source file with debug info. Returns an source
/// ID.
Index: llvm/include/llvm/CodeGen/Passes.h
diff -u llvm/include/llvm/CodeGen/Passes.h:1.21 llvm/include/llvm/CodeGen/Passes.h:1.22
--- llvm/include/llvm/CodeGen/Passes.h:1.21 Sun Oct 23 23:13:21 2005
+++ llvm/include/llvm/CodeGen/Passes.h Tue Nov 7 13:33:46 2006
@@ -81,6 +81,11 @@
/// branches.
FunctionPass *createBranchFoldingPass();
+ /// DebugLabelFoldingPass - This pass prunes out redundant debug labels. This
+ /// allows a debug emitter to determine if the range of two labels is empty,
+ /// by seeing if the labels map to the same reduced label.
+ FunctionPass *createDebugLabelFoldingPass();
+
/// MachineCodeDeletion Pass - This pass deletes all of the machine code for
/// the current function, which should happen after the function has been
/// emitted to a .s file or to memory.
From jlaskey at apple.com Tue Nov 7 14:00:22 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 7 Nov 2006 14:00:22 -0600
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200611072000.kA7K0MOT017764@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.100 -> 1.101
---
Log message:
Fix heading selector.
---
Diffs of the changes: (+1 -1)
ProgramResults.php | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.100 nightlytest-serverside/ProgramResults.php:1.101
--- nightlytest-serverside/ProgramResults.php:1.100 Fri Nov 3 13:52:02 2006
+++ nightlytest-serverside/ProgramResults.php Tue Nov 7 14:00:07 2006
@@ -36,7 +36,7 @@
$category_array=array("GCCAS","Bytecode","LLC compile","LLC\-BETA compile",
"JIT codegen","GCC","CBE","LLC",
"LLC\-BETA","JIT","GCC\/\s*CBE", "GCC\/\s*LLC",
- "GCC\/\s*LLC\-BETA","LLC\/ LLC\-BETA");
+ "GCC\/\s*LLC\-BETA","LLC\/\s*LLC\-BETA");
$category_print_array=array("GCCAS","Bytecode","LLC compile","LLC-BETA compile",
"JIT codegen","GCC","CBE","LLC",
"LLC-BETA","JIT","GCC/ CBE", "GCC/ LLC",
From jlaskey at apple.com Tue Nov 7 13:34:03 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 7 Nov 2006 13:34:03 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
LLVMTargetMachine.cpp DwarfWriter.cpp
Message-ID: <200611071934.kA7JY3S9004740@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
MachineDebugInfo.cpp updated: 1.54 -> 1.55
LLVMTargetMachine.cpp updated: 1.4 -> 1.5
DwarfWriter.cpp updated: 1.98 -> 1.99
---
Log message:
1. Add a pass to fold debug label instructions so a debug info client can detect
empty ranges.
2. Reorg how MachineDebugInfo maintains changes to debug labels.
3. Have dwarf writer use debug label info to simplify scopes and source line
coorespondence.
4. Revert the merging of compile units until I can get the bugs ironed out.
---
Diffs of the changes: (+94 -48)
DwarfWriter.cpp | 37 +++++++++---------
LLVMTargetMachine.cpp | 3 +
MachineDebugInfo.cpp | 102 ++++++++++++++++++++++++++++++++++----------------
3 files changed, 94 insertions(+), 48 deletions(-)
Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.54 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.55
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.54 Mon Nov 6 07:20:29 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp Tue Nov 7 13:33:46 2006
@@ -10,7 +10,11 @@
#include "llvm/CodeGen/MachineDebugInfo.h"
#include "llvm/Constants.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineLocation.h"
+#include "llvm/Target/TargetInstrInfo.h"
+#include "llvm/Target/TargetMachine.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalVariable.h"
#include "llvm/Intrinsics.h"
@@ -1448,10 +1452,9 @@
, Directories()
, SourceFiles()
, Lines()
-, LabelID(0)
+, LabelIDList()
, ScopeMap()
, RootScope(NULL)
-, DeletedLabelIDs()
, FrameMoves()
{}
MachineDebugInfo::~MachineDebugInfo() {
@@ -1544,35 +1547,6 @@
return ID;
}
-static bool LabelUIDComparison(const SourceLineInfo &LI, unsigned UID) {
- return LI.getLabelID() < UID;
-}
-
-/// InvalidateLabel - Inhibit use of the specified label # from
-/// MachineDebugInfo, for example because the code was deleted.
-void MachineDebugInfo::InvalidateLabel(unsigned LabelID) {
- // Check source line list first. SourceLineInfo is sorted by LabelID.
- std::vector::iterator I =
- std::lower_bound(Lines.begin(), Lines.end(), LabelID, LabelUIDComparison);
- if (I != Lines.end() && I->getLabelID() == LabelID) {
- Lines.erase(I);
- return;
- }
-
- // Otherwise add for use by isLabelValid.
- std::vector::iterator J =
- std::lower_bound(DeletedLabelIDs.begin(), DeletedLabelIDs.end(), LabelID);
- DeletedLabelIDs.insert(J, LabelID);
-}
-
-/// isLabelValid - Check to make sure the label is still valid before
-/// attempting to use.
-bool MachineDebugInfo::isLabelValid(unsigned LabelID) {
- std::vector::iterator I =
- std::lower_bound(DeletedLabelIDs.begin(), DeletedLabelIDs.end(), LabelID);
- return I == DeletedLabelIDs.end() || *I != LabelID;
-}
-
/// RecordSource - Register a source file with debug info. Returns an source
/// ID.
unsigned MachineDebugInfo::RecordSource(const std::string &Directory,
@@ -1642,4 +1616,70 @@
return Slot;
}
+//===----------------------------------------------------------------------===//
+/// DebugLabelFolding pass - This pass prunes out redundant debug labels. This
+/// allows a debug emitter to determine if the range of two labels is empty,
+/// by seeing if the labels map to the same reduced label.
+
+namespace llvm {
+
+struct DebugLabelFolder : public MachineFunctionPass {
+ virtual bool runOnMachineFunction(MachineFunction &MF);
+ virtual const char *getPassName() const { return "Debug Label Folder"; }
+};
+
+bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
+ // Get machine debug info.
+ MachineDebugInfo *MDI = getAnalysisToUpdate();
+ if (!MDI) return false;
+ // Get target instruction info.
+ const TargetInstrInfo *TII = MF.getTarget().getInstrInfo();
+ if (!TII) return false;
+ // Get target version of the debug label opcode.
+ unsigned DWARF_LABELOpc = TII->getDWARF_LABELOpcode();
+ if (!DWARF_LABELOpc) return false;
+
+ // Track if change is made.
+ bool MadeChange = false;
+ // No prior label to begin.
+ unsigned PriorLabel = 0;
+
+ // Iterate through basic blocks.
+ for (MachineFunction::iterator BB = MF.begin(), E = MF.end();
+ BB != E; ++BB) {
+ // Iterate through instructions.
+ for (MachineBasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
+ // Is it a debug label.
+ if ((unsigned)I->getOpcode() == DWARF_LABELOpc) {
+ // The label ID # is always operand #0, an immediate.
+ unsigned NextLabel = I->getOperand(0).getImm();
+
+ // If there was an immediate prior label.
+ if (PriorLabel) {
+ // Remap the current label to prior label.
+ MDI->RemapLabel(NextLabel, PriorLabel);
+ // Delete the current label.
+ I = BB->erase(I);
+ // Indicate a change has been made.
+ MadeChange = true;
+ continue;
+ } else {
+ // Start a new round.
+ PriorLabel = NextLabel;
+ }
+ } else {
+ // No consecutive labels.
+ PriorLabel = 0;
+ }
+
+ ++I;
+ }
+ }
+
+ return MadeChange;
+}
+
+FunctionPass *createDebugLabelFoldingPass() { return new DebugLabelFolder(); }
+
+}
Index: llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff -u llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.4 llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.5
--- llvm/lib/CodeGen/LLVMTargetMachine.cpp:1.4 Tue Oct 24 11:11:49 2006
+++ llvm/lib/CodeGen/LLVMTargetMachine.cpp Tue Nov 7 13:33:46 2006
@@ -66,6 +66,9 @@
// Branch folding must be run after regalloc and prolog/epilog insertion.
if (!Fast)
PM.add(createBranchFoldingPass());
+
+ // Fold redundant debug labels.
+ PM.add(createDebugLabelFoldingPass());
if (PrintMachineCode) // Print the register-allocated code
PM.add(createMachineFunctionPrinterPass(&std::cerr));
Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.98 llvm/lib/CodeGen/DwarfWriter.cpp:1.99
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.98 Tue Nov 7 00:36:36 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp Tue Nov 7 13:33:46 2006
@@ -1695,15 +1695,18 @@
return Unit;
}
+ /// GetBaseCompileUnit - Get the main compile unit.
+ ///
+ CompileUnit *GetBaseCompileUnit() const {
+ CompileUnit *Unit = CompileUnits[0];
+ assert(Unit && "Missing compile unit.");
+ return Unit;
+ }
+
/// FindCompileUnit - Get the compile unit for the given descriptor.
///
CompileUnit *FindCompileUnit(CompileUnitDesc *UnitDesc) {
-#if 1
- // FIXME - Using only one compile unit. Needs to me fixed at the FE.
- CompileUnit *Unit = CompileUnits[0];
-#else
CompileUnit *Unit = DescToUnitMap[UnitDesc];
-#endif
assert(Unit && "Missing compile unit.");
return Unit;
}
@@ -1859,13 +1862,12 @@
// FIXME - Ignore inlined functions for the time being.
if (!Scope->getParent()) continue;
- unsigned StartID = Scope->getStartLabelID();
- unsigned EndID = Scope->getEndLabelID();
+ unsigned StartID = DebugInfo->MappedLabel(Scope->getStartLabelID());
+ unsigned EndID = DebugInfo->MappedLabel(Scope->getEndLabelID());
- // Widen scope if label is discarded.
- // FIXME - really need to find a GOOD label if a block is dead.
- if (StartID && !DebugInfo->isLabelValid(StartID)) StartID = 0;
- if (EndID && !DebugInfo->isLabelValid(EndID)) EndID = 0;
+ // Ignore empty scopes.
+ if (StartID == EndID && StartID != 0) continue;
+ if (Scope->getScopes().empty() && Scope->getVariables().empty()) continue;
DIE *ScopeDie = new DIE(DW_TAG_lexical_block);
@@ -2084,10 +2086,10 @@
std::vector &Moves) {
for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
MachineMove *Move = Moves[i];
- unsigned LabelID = Move->getLabelID();
+ unsigned LabelID = DebugInfo->MappedLabel(Move->getLabelID());
// Throw out move if the label is invalid.
- if (LabelID && !DebugInfo->isLabelValid(LabelID)) continue;
+ if (!LabelID) continue;
const MachineLocation &Dst = Move->getDestination();
const MachineLocation &Src = Move->getSource();
@@ -2307,9 +2309,8 @@
// Construct rows of the address, source, line, column matrix.
for (unsigned i = 0, N = LineInfos.size(); i < N; ++i) {
const SourceLineInfo &LineInfo = LineInfos[i];
- unsigned LabelID = LineInfo.getLabelID();
-
- // Source line labels are validated at the MachineDebugInfo level.
+ unsigned LabelID = DebugInfo->MappedLabel(LineInfo.getLabelID());
+ if (!LabelID) continue;
if (DwarfVerbose) {
unsigned SourceID = LineInfo.getSourceID();
@@ -2420,6 +2421,7 @@
void EmitFunctionDebugFrame() {
if (!TAI->getDwarfRequiresFrameSection())
return;
+
// Start the dwarf frame section.
Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
@@ -2588,7 +2590,8 @@
const UniqueVector CUW = DebugInfo->getCompileUnits();
for (unsigned i = 1, N = CUW.size(); i <= N; ++i) {
- CompileUnit *Unit = NewCompileUnit(CUW[i], i);
+ unsigned ID = DebugInfo->RecordSource(CUW[i]);
+ CompileUnit *Unit = NewCompileUnit(CUW[i], ID);
CompileUnits.push_back(Unit);
}
}
From alenhar2 at cs.uiuc.edu Tue Nov 7 14:35:41 2006
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Tue, 7 Nov 2006 14:35:41 -0600
Subject: [llvm-commits] CVS:
llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
Message-ID: <200611072035.kA7KZfBH002428@apoc.cs.uiuc.edu>
Changes in directory llvm/lib/Analysis/DataStructure:
TopDownClosure.cpp updated: 1.92 -> 1.93
---
Log message:
debug type for DSA TD
---
Diffs of the changes: (+1 -1)
TopDownClosure.cpp | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.92 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.93
--- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.92 Fri Oct 13 12:38:22 2006
+++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Tue Nov 7 14:35:11 2006
@@ -13,7 +13,7 @@
// like pointer analysis.
//
//===----------------------------------------------------------------------===//
-
+#define DEBUG_TYPE "td_dsa"
#include "llvm/Analysis/DataStructure/DataStructure.h"
#include "llvm/Module.h"
#include "llvm/DerivedTypes.h"
From alenhar2 at cs.uiuc.edu Tue Nov 7 14:36:22 2006
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Tue, 7 Nov 2006 14:36:22 -0600
Subject: [llvm-commits] CVS:
llvm/lib/Analysis/DataStructure/DataStructure.cpp
Message-ID: <200611072036.kA7KaMrM002452@apoc.cs.uiuc.edu>
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructure.cpp updated: 1.248 -> 1.249
---
Log message:
Allow loop detection during debug in forwarding nodes, and revert auxcall patch as it make 176.gcc untenable
---
Diffs of the changes: (+20 -8)
DataStructure.cpp | 28 ++++++++++++++++++++--------
1 files changed, 20 insertions(+), 8 deletions(-)
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.248 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.249
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.248 Thu Nov 2 14:25:49 2006
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Nov 7 14:36:02 2006
@@ -62,7 +62,17 @@
DSNode *DSNodeHandle::HandleForwarding() const {
assert(N->isForwarding() && "Can only be invoked if forwarding!");
-
+ DEBUG(
+ { //assert not looping
+ DSNode* NH = N;
+ std::set seen;
+ while(NH && NH->isForwarding()) {
+ assert(seen.find(NH) == seen.end() && "Loop detected");
+ seen.insert(NH);
+ NH = NH->ForwardNH.N;
+ }
+ }
+ );
// Handle node forwarding here!
DSNode *Next = N->ForwardNH.getNode(); // Cause recursive shrinkage
Offset += N->ForwardNH.getOffset();
@@ -421,6 +431,8 @@
///
bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
bool FoldIfIncompatible) {
+ DEBUG(std::cerr << "merging " << *NewTy << " at " << Offset
+ << " with " << *Ty << "\n");
const TargetData &TD = getTargetData();
// Check to make sure the Size member is up-to-date. Size can be one of the
// following:
@@ -1595,13 +1607,13 @@
for (afc_iterator I = Graph.afc_begin(), E = Graph.afc_end(); I!=E; ++I)
if (SCCFinder.PathExistsToClonedNode(*I))
AuxCallToCopy.push_back(&*I);
- else if (I->isIndirectCall()){
- //If the call node doesn't have any callees, clone it
- std::vector< Function *> List;
- I->getCalleeNode()->addFullFunctionList(List);
- if (!List.size())
- AuxCallToCopy.push_back(&*I);
- }
+// else if (I->isIndirectCall()){
+// //If the call node doesn't have any callees, clone it
+// std::vector< Function *> List;
+// I->getCalleeNode()->addFullFunctionList(List);
+// if (!List.size())
+// AuxCallToCopy.push_back(&*I);
+// }
const DSScalarMap &GSM = Graph.getScalarMap();
for (DSScalarMap::global_iterator GI = GSM.global_begin(),
From alenhar2 at cs.uiuc.edu Tue Nov 7 14:39:32 2006
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Tue, 7 Nov 2006 14:39:32 -0600
Subject: [llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp
Message-ID: <200611072039.kA7KdW6f002513@apoc.cs.uiuc.edu>
Changes in directory llvm/lib/Analysis/DataStructure:
Local.cpp updated: 1.158 -> 1.159
---
Log message:
Optionally allow comparison operations from affect DSGraphs
---
Diffs of the changes: (+6 -1)
Local.cpp | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.158 llvm/lib/Analysis/DataStructure/Local.cpp:1.159
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.158 Fri Nov 3 11:43:19 2006
+++ llvm/lib/Analysis/DataStructure/Local.cpp Tue Nov 7 14:39:05 2006
@@ -40,6 +40,10 @@
TrackIntegersAsPointers("dsa-track-integers", cl::Hidden,
cl::desc("If this is set, track integers as potential pointers"));
+static cl::opt
+IgnoreSetCC("dsa-ignore-setcc", cl::Hidden,
+ cl::desc("If this is set, do nothing at pointer comparisons"));
+
static cl::list
AllocList("dsa-alloc-list",
cl::value_desc("list"),
@@ -336,7 +340,8 @@
void GraphBuilder::visitSetCondInst(SetCondInst &SCI) {
if (!isPointerType(SCI.getOperand(0)->getType()) ||
isa(SCI.getOperand(1))) return; // Only pointers
- ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1)));
+ if(!IgnoreSetCC)
+ ScalarMap[SCI.getOperand(0)].mergeWith(getValueDest(*SCI.getOperand(1)));
}
From jlaskey at apple.com Tue Nov 7 14:53:20 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 7 Nov 2006 14:53:20 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
Message-ID: <200611072053.kA7KrKhE017214@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
MachineDebugInfo.cpp updated: 1.55 -> 1.56
---
Log message:
Missed a label map, reverting till covered.
---
Diffs of the changes: (+3 -0)
MachineDebugInfo.cpp | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.55 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.56
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.55 Tue Nov 7 13:33:46 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp Tue Nov 7 14:53:05 2006
@@ -1629,6 +1629,9 @@
};
bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
+ // FIXME - Missing label mapping.
+ return false;
+
// Get machine debug info.
MachineDebugInfo *MDI = getAnalysisToUpdate();
if (!MDI) return false;
From dpatel at apple.com Tue Nov 7 15:32:15 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 15:32:15 -0600
Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Message-ID: <200611072132.kA7LWFqm017881@zion.cs.uiuc.edu>
Changes in directory llvm/lib/VMCore:
PassManager.cpp added (r1.1)
---
Log message:
Add BasicBlockPassManager_New.
---
Diffs of the changes: (+56 -0)
PassManager.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+)
Index: llvm/lib/VMCore/PassManager.cpp
diff -c /dev/null llvm/lib/VMCore/PassManager.cpp:1.1
*** /dev/null Tue Nov 7 15:32:07 2006
--- llvm/lib/VMCore/PassManager.cpp Tue Nov 7 15:31:57 2006
***************
*** 0 ****
--- 1,56 ----
+ //===- PassManager.cpp - LLVM Pass Infrastructure Implementation ----------===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by the LLVM research group and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ //===----------------------------------------------------------------------===//
+ //
+ // This file implements the LLVM Pass Manager infrastructure.
+ //
+ //===----------------------------------------------------------------------===//
+
+
+ #include "llvm/PassManager.h"
+ #include "llvm/Function.h"
+ #include "llvm/Module.h"
+
+ using namespace llvm;
+
+ /// BasicBlockPassManager implementation
+
+ /// Add pass P into PassVector and return TRUE. If this pass is not
+ /// manageable by this manager then return FALSE.
+ bool
+ BasicBlockPassManager_New::addPass (Pass *P) {
+
+ BasicBlockPass *BP = dynamic_cast(P);
+ if (!BP)
+ return false;
+
+ // TODO: Check if it suitable to manage P using this BasicBlockPassManager
+ // or we need another instance of BasicBlockPassManager
+
+ // Add pass
+ PassVector.push_back(BP);
+ return true;
+ }
+
+ /// Execute all of the passes scheduled for execution by invoking
+ /// runOnBasicBlock method. Keep track of whether any of the passes modifies
+ /// the function, and if so, return true.
+ bool
+ BasicBlockPassManager_New::runOnFunction(Function &F) {
+
+ bool Changed = false;
+ for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
+ for (std::vector::iterator itr = PassVector.begin(),
+ e = PassVector.end(); itr != e; ++itr) {
+ Pass *P = *itr;
+ BasicBlockPass *BP = dynamic_cast(P);
+ Changed |= BP->runOnBasicBlock(*I);
+ }
+ return Changed;
+ }
+
From dpatel at apple.com Tue Nov 7 15:32:15 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 15:32:15 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/PassManager.h
Message-ID: <200611072132.kA7LWFqU017879@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
PassManager.h updated: 1.15 -> 1.16
---
Log message:
Add BasicBlockPassManager_New.
---
Diffs of the changes: (+23 -0)
PassManager.h | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+)
Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.15 llvm/include/llvm/PassManager.h:1.16
--- llvm/include/llvm/PassManager.h:1.15 Sun Sep 3 23:07:39 2006
+++ llvm/include/llvm/PassManager.h Tue Nov 7 15:31:57 2006
@@ -17,6 +17,9 @@
#ifndef LLVM_PASSMANAGER_H
#define LLVM_PASSMANAGER_H
+#include "llvm/Pass.h"
+#include
+
namespace llvm {
class Pass;
@@ -85,6 +88,26 @@
bool doFinalization();
};
+/// BasicBlockpassManager_New manages BasicBlockPass. It batches all the
+/// pass together and sequence them to process one basic block before
+/// processing next basic block.
+class BasicBlockPassManager_New: public Pass {
+
+public:
+ BasicBlockPassManager_New() { }
+
+ /// Add a pass into a passmanager queue.
+ bool addPass(Pass *p);
+
+ /// Execute all of the passes scheduled for execution. Keep track of
+ /// whether any of the passes modifies the function, and if so, return true.
+ bool runOnFunction(Function &F);
+
+private:
+ // Collection of pass that are not yet scheduled
+ std::vector PassVector;
+};
+
} // End llvm namespace
#endif
From jlaskey at apple.com Tue Nov 7 15:37:45 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 7 Nov 2006 15:37:45 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
Message-ID: <200611072137.kA7Lbj0d017974@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
MachineDebugInfo.cpp updated: 1.56 -> 1.57
---
Log message:
Missed a label map, reverting till covered.
---
Diffs of the changes: (+0 -3)
MachineDebugInfo.cpp | 3 ---
1 files changed, 3 deletions(-)
Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.56 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.57
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.56 Tue Nov 7 14:53:05 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp Tue Nov 7 15:37:31 2006
@@ -1629,9 +1629,6 @@
};
bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
- // FIXME - Missing label mapping.
- return false;
-
// Get machine debug info.
MachineDebugInfo *MDI = getAnalysisToUpdate();
if (!MDI) return false;
From dpatel at apple.com Tue Nov 7 15:50:06 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 15:50:06 -0600
Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Message-ID: <200611072150.kA7Lo6dG018195@zion.cs.uiuc.edu>
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.1 -> 1.2
---
Log message:
Add FunctionPassManager_New.
---
Diffs of the changes: (+56 -0)
PassManager.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.1 llvm/lib/VMCore/PassManager.cpp:1.2
--- llvm/lib/VMCore/PassManager.cpp:1.1 Tue Nov 7 15:31:57 2006
+++ llvm/lib/VMCore/PassManager.cpp Tue Nov 7 15:49:50 2006
@@ -54,3 +54,59 @@
return Changed;
}
+// FunctionPassManager_New implementation
+
+///////////////////////////////////////////////////////////////////////////////
+// FunctionPassManager
+
+/// Add pass P into the pass manager queue. If P is a BasicBlockPass then
+/// either use it into active basic block pass manager or create new basic
+/// block pass manager to handle pass P.
+bool
+FunctionPassManager_New::addPass (Pass *P) {
+
+ // If P is a BasicBlockPass then use BasicBlockPassManager_New.
+ if (BasicBlockPass *BP = dynamic_cast(P)) {
+
+ if (!activeBBPassManager
+ || !activeBBPassManager->addPass(BP)) {
+
+ activeBBPassManager = new BasicBlockPassManager_New();
+
+ PassVector.push_back(activeBBPassManager);
+ assert (!activeBBPassManager->addPass(BP) &&
+ "Unable to add Pass");
+ }
+ return true;
+ }
+
+ FunctionPass *FP = dynamic_cast(P);
+ if (!FP)
+ return false;
+
+ // TODO: Check if it suitable to manage P using this FunctionPassManager
+ // or we need another instance of BasicBlockPassManager
+
+ PassVector.push_back(FP);
+ activeBBPassManager = NULL;
+ return true;
+}
+
+/// Execute all of the passes scheduled for execution by invoking
+/// runOnFunction method. Keep track of whether any of the passes modifies
+/// the function, and if so, return true.
+bool
+FunctionPassManager_New::runOnModule(Module &M) {
+
+ bool Changed = false;
+ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
+ for (std::vector::iterator itr = PassVector.begin(),
+ e = PassVector.end(); itr != e; ++itr) {
+ Pass *P = *itr;
+ FunctionPass *FP = dynamic_cast(P);
+ Changed |= FP->runOnFunction(*I);
+ }
+ return Changed;
+}
+
+
From dpatel at apple.com Tue Nov 7 15:50:05 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 15:50:05 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/PassManager.h
Message-ID: <200611072150.kA7Lo5Gs018190@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
PassManager.h updated: 1.16 -> 1.17
---
Log message:
Add FunctionPassManager_New.
---
Diffs of the changes: (+35 -0)
PassManager.h | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+)
Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.16 llvm/include/llvm/PassManager.h:1.17
--- llvm/include/llvm/PassManager.h:1.16 Tue Nov 7 15:31:57 2006
+++ llvm/include/llvm/PassManager.h Tue Nov 7 15:49:50 2006
@@ -108,6 +108,41 @@
std::vector PassVector;
};
+/// FunctionPassManager_New manages FunctionPasses and BasicBlockPassManagers.
+/// It batches all function passes and basic block pass managers together and
+/// sequence them to process one function at a time before processing next
+/// function.
+class FunctionPassManager_New:public Pass {
+public:
+ FunctionPassManager_New(ModuleProvider *P) { /* TODO */ }
+ FunctionPassManager_New() {
+ activeBBPassManager = NULL;
+ }
+ ~FunctionPassManager_New() { /* TODO */ };
+
+ /// add - Add a pass to the queue of passes to run. This passes
+ /// ownership of the Pass to the PassManager. When the
+ /// PassManager_X is destroyed, the pass will be destroyed as well, so
+ /// there is no need to delete the pass. (TODO delete passes.)
+ /// This implies that all passes MUST be allocated with 'new'.
+ void add(Pass *P) { /* TODO*/ }
+
+ /// Add pass into the pass manager queue.
+ bool addPass(Pass *P);
+
+ /// Execute all of the passes scheduled for execution. Keep
+ /// track of whether any of the passes modifies the function, and if
+ /// so, return true.
+ bool runOnModule(Module &M);
+
+private:
+ // Collection of pass that are not yet scheduled
+ std::vector PassVector;
+
+ // Active Pass Managers
+ BasicBlockPassManager_New *activeBBPassManager;
+};
+
} // End llvm namespace
#endif
From jlaskey at apple.com Tue Nov 7 15:59:30 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 7 Nov 2006 15:59:30 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachineDebugInfo.cpp
Message-ID: <200611072159.kA7LxUvA018335@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
MachineDebugInfo.cpp updated: 1.57 -> 1.58
---
Log message:
Accidently reran commit.
---
Diffs of the changes: (+3 -0)
MachineDebugInfo.cpp | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.57 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.58
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.57 Tue Nov 7 15:37:31 2006
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp Tue Nov 7 15:58:55 2006
@@ -1629,6 +1629,9 @@
};
bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) {
+ // FIXME - Missing label mapping.
+ return false;
+
// Get machine debug info.
MachineDebugInfo *MDI = getAnalysisToUpdate();
if (!MDI) return false;
From dpatel at apple.com Tue Nov 7 16:03:30 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:03:30 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/PassManager.h
Message-ID: <200611072203.kA7M3UXt018420@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
PassManager.h updated: 1.17 -> 1.18
---
Log message:
Add ModulePassManager_New.
---
Diffs of the changes: (+23 -0)
PassManager.h | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+)
Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.17 llvm/include/llvm/PassManager.h:1.18
--- llvm/include/llvm/PassManager.h:1.17 Tue Nov 7 15:49:50 2006
+++ llvm/include/llvm/PassManager.h Tue Nov 7 16:03:15 2006
@@ -143,6 +143,29 @@
BasicBlockPassManager_New *activeBBPassManager;
};
+/// FunctionPassManager_New manages FunctionPasses.
+/// It batches all Module passes passes and function pass managers together and
+/// sequence them to process one module.
+class ModulePassManager_New: public Pass {
+
+public:
+ ModulePassManager_New() { activeFunctionPassManager = NULL; }
+
+ /// Add a pass into a passmanager queue.
+ bool addPass(Pass *p);
+
+ /// run - Execute all of the passes scheduled for execution. Keep track of
+ /// whether any of the passes modifies the module, and if so, return true.
+ bool runOnModule(Module &M);
+
+private:
+ // Collection of pass that are not yet scheduled
+ std::vector PassVector;
+
+ // Active Pass Manager
+ FunctionPassManager_New *activeFunctionPassManager;
+};
+
} // End llvm namespace
#endif
From dpatel at apple.com Tue Nov 7 16:03:31 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:03:31 -0600
Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Message-ID: <200611072203.kA7M3Var018426@zion.cs.uiuc.edu>
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.2 -> 1.3
---
Log message:
Add ModulePassManager_New.
---
Diffs of the changes: (+54 -1)
PassManager.cpp | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 54 insertions(+), 1 deletion(-)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.2 llvm/lib/VMCore/PassManager.cpp:1.3
--- llvm/lib/VMCore/PassManager.cpp:1.2 Tue Nov 7 15:49:50 2006
+++ llvm/lib/VMCore/PassManager.cpp Tue Nov 7 16:03:15 2006
@@ -85,7 +85,7 @@
return false;
// TODO: Check if it suitable to manage P using this FunctionPassManager
- // or we need another instance of BasicBlockPassManager
+ // or we need another instance of FunctionPassManager
PassVector.push_back(FP);
activeBBPassManager = NULL;
@@ -110,3 +110,56 @@
}
+// ModulePassManager implementation
+
+/// Add P into pass vector if it is manageble. If P is a FunctionPass
+/// then use FunctionPassManager_New to manage it. Return FALSE if P
+/// is not manageable by this manager.
+bool
+ModulePassManager_New::addPass (Pass *P) {
+
+ // If P is FunctionPass then use function pass maanager.
+ if (FunctionPass *FP = dynamic_cast(P)) {
+
+ activeFunctionPassManager = NULL;
+
+ if (!activeFunctionPassManager
+ || !activeFunctionPassManager->addPass(P)) {
+
+ activeFunctionPassManager = new FunctionPassManager_New();
+
+ PassVector.push_back(activeFunctionPassManager);
+ assert (!activeFunctionPassManager->addPass(FP) &&
+ "Unable to add Pass");
+ }
+ return true;
+ }
+
+ ModulePass *MP = dynamic_cast(P);
+ if (!MP)
+ return false;
+
+ // TODO: Check if it suitable to manage P using this ModulePassManager
+ // or we need another instance of ModulePassManager
+
+ PassVector.push_back(MP);
+ activeFunctionPassManager = NULL;
+ return true;
+}
+
+
+/// Execute all of the passes scheduled for execution by invoking
+/// runOnModule method. Keep track of whether any of the passes modifies
+/// the module, and if so, return true.
+bool
+ModulePassManager_New::runOnModule(Module &M) {
+ bool Changed = false;
+ for (std::vector::iterator itr = PassVector.begin(),
+ e = PassVector.end(); itr != e; ++itr) {
+ Pass *P = *itr;
+ ModulePass *MP = dynamic_cast(P);
+ Changed |= MP->runOnModule(M);
+ }
+ return Changed;
+}
+
From evan.cheng at apple.com Tue Nov 7 16:14:44 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 7 Nov 2006 16:14:44 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp
X86ISelLowering.h X86InstrSSE.td
Message-ID: <200611072214.kA7MEic1018613@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ISelLowering.cpp updated: 1.287 -> 1.288
X86ISelLowering.h updated: 1.78 -> 1.79
X86InstrSSE.td updated: 1.169 -> 1.170
---
Log message:
Fixed a bug which causes x86 be to incorrectly match
shuffle v, undef, <2, ?, 3, ?>
to movhlps
It should match to unpckhps instead.
Added proper matching code for
shuffle v, undef, <2, 3, 2, 3>
---
Diffs of the changes: (+30 -5)
X86ISelLowering.cpp | 18 +++++++++++++++++-
X86ISelLowering.h | 5 +++++
X86InstrSSE.td | 12 ++++++++----
3 files changed, 30 insertions(+), 5 deletions(-)
Index: llvm/lib/Target/X86/X86ISelLowering.cpp
diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.287 llvm/lib/Target/X86/X86ISelLowering.cpp:1.288
--- llvm/lib/Target/X86/X86ISelLowering.cpp:1.287 Thu Nov 2 14:25:49 2006
+++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Nov 7 16:14:24 2006
@@ -2582,6 +2582,22 @@
isUndefOrEqual(N->getOperand(3), 3);
}
+/// isMOVHLPS_v_undef_Mask - Special case of isMOVHLPSMask for canonical form
+/// of vector_shuffle v, v, <2, 3, 2, 3>, i.e. vector_shuffle v, undef,
+/// <2, 3, 2, 3>
+bool X86::isMOVHLPS_v_undef_Mask(SDNode *N) {
+ assert(N->getOpcode() == ISD::BUILD_VECTOR);
+
+ if (N->getNumOperands() != 4)
+ return false;
+
+ // Expect bit0 == 2, bit1 == 3, bit2 == 2, bit3 == 3
+ return isUndefOrEqual(N->getOperand(0), 2) &&
+ isUndefOrEqual(N->getOperand(1), 3) &&
+ isUndefOrEqual(N->getOperand(2), 2) &&
+ isUndefOrEqual(N->getOperand(3), 3);
+}
+
/// isMOVLPMask - Return true if the specified VECTOR_SHUFFLE operand
/// specifies a shuffle of elements that is suitable for input to MOVLP{S|D}.
bool X86::isMOVLPMask(SDNode *N) {
@@ -3724,7 +3740,7 @@
SDOperand Mask = DAG.getNode(ISD::BUILD_VECTOR, MaskVT,
&IdxVec[0], IdxVec.size());
Vec = DAG.getNode(ISD::VECTOR_SHUFFLE, Vec.getValueType(),
- Vec, Vec, Mask);
+ Vec, DAG.getNode(ISD::UNDEF, Vec.getValueType()), Mask);
return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, VT, Vec,
DAG.getConstant(0, getPointerTy()));
} else if (MVT::getSizeInBits(VT) == 64) {
Index: llvm/lib/Target/X86/X86ISelLowering.h
diff -u llvm/lib/Target/X86/X86ISelLowering.h:1.78 llvm/lib/Target/X86/X86ISelLowering.h:1.79
--- llvm/lib/Target/X86/X86ISelLowering.h:1.78 Tue Oct 31 14:13:11 2006
+++ llvm/lib/Target/X86/X86ISelLowering.h Tue Nov 7 16:14:24 2006
@@ -186,6 +186,11 @@
/// specifies a shuffle of elements that is suitable for input to MOVHLPS.
bool isMOVHLPSMask(SDNode *N);
+ /// isMOVHLPS_v_undef_Mask - Special case of isMOVHLPSMask for canonical form
+ /// of vector_shuffle v, v, <2, 3, 2, 3>, i.e. vector_shuffle v, undef,
+ /// <2, 3, 2, 3>
+ bool isMOVHLPS_v_undef_Mask(SDNode *N);
+
/// isMOVLPMask - Return true if the specified VECTOR_SHUFFLE operand
/// specifies a shuffle of elements that is suitable for input to MOVLP{S|D}.
bool isMOVLPMask(SDNode *N);
Index: llvm/lib/Target/X86/X86InstrSSE.td
diff -u llvm/lib/Target/X86/X86InstrSSE.td:1.169 llvm/lib/Target/X86/X86InstrSSE.td:1.170
--- llvm/lib/Target/X86/X86InstrSSE.td:1.169 Fri Nov 3 17:48:56 2006
+++ llvm/lib/Target/X86/X86InstrSSE.td Tue Nov 7 16:14:24 2006
@@ -110,6 +110,10 @@
return X86::isMOVHLPSMask(N);
}]>;
+def MOVHLPS_v_undef_shuffle_mask : PatLeaf<(build_vector), [{
+ return X86::isMOVHLPS_v_undef_Mask(N);
+}]>;
+
def MOVHP_shuffle_mask : PatLeaf<(build_vector), [{
return X86::isMOVHPMask(N);
}]>;
@@ -1987,16 +1991,16 @@
MOVHLPS_shuffle_mask)),
(MOVHLPSrr VR128:$src1, VR128:$src2)>;
-// vector_shuffle v1, undef <2, 3, ?, ?> using MOVHLPS
+// vector_shuffle v1, undef <2, ?, ?, ?> using MOVHLPS
def : Pat<(v4f32 (vector_shuffle VR128:$src1, (undef),
- UNPCKH_shuffle_mask)),
+ MOVHLPS_v_undef_shuffle_mask)),
(MOVHLPSrr VR128:$src1, VR128:$src1)>;
def : Pat<(v4i32 (vector_shuffle VR128:$src1, (undef),
- UNPCKH_shuffle_mask)),
+ MOVHLPS_v_undef_shuffle_mask)),
(MOVHLPSrr VR128:$src1, VR128:$src1)>;
}
- let AddedComplexity = 20 in {
+let AddedComplexity = 20 in {
// vector_shuffle v1, (load v2) <4, 5, 2, 3> using MOVLPS
// vector_shuffle v1, (load v2) <0, 1, 4, 5> using MOVHPS
def : Pat<(v4f32 (vector_shuffle VR128:$src1, (loadv4f32 addr:$src2),
From dpatel at apple.com Tue Nov 7 16:23:57 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:23:57 -0600
Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Message-ID: <200611072223.kA7MNvtH018870@zion.cs.uiuc.edu>
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.3 -> 1.4
---
Log message:
Add PassManager_New.
---
Diffs of the changes: (+41 -0)
PassManager.cpp | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.3 llvm/lib/VMCore/PassManager.cpp:1.4
--- llvm/lib/VMCore/PassManager.cpp:1.3 Tue Nov 7 16:03:15 2006
+++ llvm/lib/VMCore/PassManager.cpp Tue Nov 7 16:23:34 2006
@@ -163,3 +163,44 @@
return Changed;
}
+/// Schedule all passes from the queue by adding them in their
+/// respective manager's queue.
+void
+PassManager_New::schedulePasses() {
+ /* TODO */
+}
+
+/// Add pass P to the queue of passes to run.
+void
+PassManager_New::add(Pass *P) {
+ /* TODO */
+}
+
+// PassManager_New implementation
+/// Add P into active pass manager or use new module pass manager to
+/// manage it.
+bool
+PassManager_New::addPass (Pass *P) {
+
+ if (!activeManager) {
+ activeManager = new ModulePassManager_New();
+ PassManagers.push_back(activeManager);
+ }
+
+ return activeManager->addPass(P);
+}
+
+/// run - Execute all of the passes scheduled for execution. Keep track of
+/// whether any of the passes modifies the module, and if so, return true.
+bool
+PassManager_New::run(Module &M) {
+
+ schedulePasses();
+ bool Changed = false;
+ for (std::vector::iterator itr = PassManagers.begin(),
+ e = PassManagers.end(); itr != e; ++itr) {
+ ModulePassManager_New *pm = *itr;
+ Changed |= pm->runOnModule(M);
+ }
+ return Changed;
+}
From dpatel at apple.com Tue Nov 7 16:23:57 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:23:57 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/PassManager.h
Message-ID: <200611072223.kA7MNvuA018871@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
PassManager.h updated: 1.19 -> 1.20
---
Log message:
Add PassManager_New.
---
Diffs of the changes: (+34 -0)
PassManager.h | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+)
Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.19 llvm/include/llvm/PassManager.h:1.20
--- llvm/include/llvm/PassManager.h:1.19 Tue Nov 7 16:04:53 2006
+++ llvm/include/llvm/PassManager.h Tue Nov 7 16:23:34 2006
@@ -166,6 +166,40 @@
FunctionPassManager_New *activeFunctionPassManager;
};
+/// PassManager_New manages ModulePassManagers
+class PassManager_New: public Pass {
+
+public:
+
+ /// add - Add a pass to the queue of passes to run. This passes ownership of
+ /// the Pass to the PassManager. When the PassManager is destroyed, the pass
+ /// will be destroyed as well, so there is no need to delete the pass. This
+ /// implies that all passes MUST be allocated with 'new'.
+ void add(Pass *P);
+
+ /// run - Execute all of the passes scheduled for execution. Keep track of
+ /// whether any of the passes modifies the module, and if so, return true.
+ bool run(Module &M);
+
+private:
+
+ /// Add a pass into a passmanager queue. This is used by schedulePasses
+ bool addPass(Pass *p);
+
+ /// Schedule all passes collected in pass queue using add(). Add all the
+ /// schedule passes into various manager's queue using addPass().
+ void schedulePasses();
+
+ // Collection of pass managers
+ std::vector PassManagers;
+
+ // Collection of pass that are not yet scheduled
+ std::vector PassVector;
+
+ // Active Pass Manager
+ ModulePassManager_New *activeManager;
+};
+
} // End llvm namespace
#endif
From dpatel at apple.com Tue Nov 7 16:35:45 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:35:45 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/PassManager.h
Message-ID: <200611072235.kA7MZjCi019148@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
PassManager.h updated: 1.20 -> 1.21
---
Log message:
Introduce PassManagerAnalysisHelper.
---
Diffs of the changes: (+30 -0)
PassManager.h | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+)
Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.20 llvm/include/llvm/PassManager.h:1.21
--- llvm/include/llvm/PassManager.h:1.20 Tue Nov 7 16:23:34 2006
+++ llvm/include/llvm/PassManager.h Tue Nov 7 16:35:17 2006
@@ -88,6 +88,36 @@
bool doFinalization();
};
+/// PassManagerAnalysisHelper helpes pass manager analysis required by
+/// the managed passes.
+class PassManagerAnalysisHelper {
+
+public:
+
+ /// Return TRUE IFF pass P's required analysis set does not required new
+ /// manager.
+ bool manageablePass(Pass *P);
+
+ /// Return TRUE iff AnalysisID AID is currently available.
+ bool analysisCurrentlyAvailable(AnalysisID AID);
+
+ /// Augment RequiredSet by adding analysis required by pass P.
+ void noteDownRequiredAnalysis(Pass *P);
+
+ /// Remove AnalysisID from the RequiredSet
+ void removeAnalysis(AnalysisID AID);
+
+ /// Remove Analysis that is not preserved by the pass
+ void removeNotPreservedAnalysis(Pass *P);
+
+ /// Remove dead passes
+ void removeDeadPasses() { /* TODO : Implement */ }
+
+private:
+ // Required set of analysis for the passes managed by this manager
+ std::vector RequiredSet;
+};
+
/// BasicBlockpassManager_New manages BasicBlockPass. It batches all the
/// pass together and sequence them to process one basic block before
/// processing next basic block.
From dpatel at apple.com Tue Nov 7 16:35:45 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:35:45 -0600
Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Message-ID: <200611072235.kA7MZjED019149@zion.cs.uiuc.edu>
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.4 -> 1.5
---
Log message:
Introduce PassManagerAnalysisHelper.
---
Diffs of the changes: (+40 -0)
PassManager.cpp | 40 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 40 insertions(+)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.4 llvm/lib/VMCore/PassManager.cpp:1.5
--- llvm/lib/VMCore/PassManager.cpp:1.4 Tue Nov 7 16:23:34 2006
+++ llvm/lib/VMCore/PassManager.cpp Tue Nov 7 16:35:17 2006
@@ -18,6 +18,46 @@
using namespace llvm;
+// PassManagerAnalysisHelper implementation
+
+/// Return TRUE IFF pass P's required analysis set does not required new
+/// manager.
+bool PassManagerAnalysisHelper::manageablePass(Pass *P) {
+
+ AnalysisUsage AnUsage;
+ P->getAnalysisUsage(AnUsage);
+
+ // If this pass is not preserving information that is required by the other passes
+ // managed by this manager then use new manager
+ // TODO
+ return true;
+}
+
+/// Return TRUE iff AnalysisID AID is currently available.
+bool PassManagerAnalysisHelper::analysisCurrentlyAvailable(AnalysisID AID) {
+
+ // TODO
+ return false;
+}
+
+/// Augment RequiredSet by adding analysis required by pass P.
+void PassManagerAnalysisHelper::noteDownRequiredAnalysis(Pass *P) {
+
+ // TODO
+}
+
+/// Remove AnalysisID from the RequiredSet
+void PassManagerAnalysisHelper::removeAnalysis(AnalysisID AID) {
+
+ // TODO
+}
+
+/// Remove Analyss not preserved by Pass P
+void PassManagerAnalysisHelper::removeNotPreservedAnalysis(Pass *P) {
+
+ // TODO
+}
+
/// BasicBlockPassManager implementation
/// Add pass P into PassVector and return TRUE. If this pass is not
From sabre at nondot.org Tue Nov 7 16:43:02 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 16:43:02 -0600
Subject: [llvm-commits] CVS:
llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
Message-ID: <200611072243.kA7Mh2s5019363@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Transforms/Scalar:
ScalarReplAggregates.cpp updated: 1.47 -> 1.48
---
Log message:
scalarrepl should not split the two elements of the vsiidx array:
int func(vFloat v0, vFloat v1) {
int ii;
vSInt32 vsiidx[2];
vsiidx[0] = _mm_cvttps_epi32(v0);
vsiidx[1] = _mm_cvttps_epi32(v1);
ii = ((int *) vsiidx)[4];
return ii;
}
This fixes Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll
---
Diffs of the changes: (+7 -3)
ScalarReplAggregates.cpp | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.47 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.48
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.47 Thu Nov 2 14:25:50 2006
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Nov 7 16:42:47 2006
@@ -316,9 +316,13 @@
//
// Scalar replacing *just* the outer index of the array is probably not
// going to be a win anyway, so just give up.
- for (++I; I != E && isa(*I); ++I) {
- const ArrayType *SubArrayTy = cast(*I);
- uint64_t NumElements = SubArrayTy->getNumElements();
+ for (++I; I != E && (isa(*I) || isa(*I)); ++I) {
+ uint64_t NumElements;
+ if (const ArrayType *SubArrayTy = dyn_cast(*I))
+ NumElements = SubArrayTy->getNumElements();
+ else
+ NumElements = cast(*I)->getNumElements();
+
if (!isa(I.getOperand())) return 0;
if (cast(I.getOperand())->getZExtValue() >= NumElements)
return 0;
From dpatel at apple.com Tue Nov 7 16:45:10 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:45:10 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/PassManager.h
Message-ID: <200611072245.kA7MjADG019400@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
PassManager.h updated: 1.21 -> 1.22
---
Log message:
Derive new pass managers from PassManagerAnalysisHelper.
---
Diffs of the changes: (+8 -4)
PassManager.h | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.21 llvm/include/llvm/PassManager.h:1.22
--- llvm/include/llvm/PassManager.h:1.21 Tue Nov 7 16:35:17 2006
+++ llvm/include/llvm/PassManager.h Tue Nov 7 16:44:55 2006
@@ -121,7 +121,8 @@
/// BasicBlockpassManager_New manages BasicBlockPass. It batches all the
/// pass together and sequence them to process one basic block before
/// processing next basic block.
-class BasicBlockPassManager_New: public Pass {
+class BasicBlockPassManager_New: public Pass,
+ public PassManagerAnalysisHelper {
public:
BasicBlockPassManager_New() { }
@@ -142,7 +143,8 @@
/// It batches all function passes and basic block pass managers together and
/// sequence them to process one function at a time before processing next
/// function.
-class FunctionPassManager_New:public Pass {
+class FunctionPassManager_New: public Pass,
+ public PassManagerAnalysisHelper {
public:
FunctionPassManager_New(ModuleProvider *P) { /* TODO */ }
FunctionPassManager_New() {
@@ -176,7 +178,8 @@
/// ModulePassManager_New manages ModulePasses and function pass managers.
/// It batches all Module passes passes and function pass managers together and
/// sequence them to process one module.
-class ModulePassManager_New: public Pass {
+class ModulePassManager_New: public Pass,
+ public PassManagerAnalysisHelper {
public:
ModulePassManager_New() { activeFunctionPassManager = NULL; }
@@ -197,7 +200,8 @@
};
/// PassManager_New manages ModulePassManagers
-class PassManager_New: public Pass {
+class PassManager_New: public Pass,
+ public PassManagerAnalysisHelper {
public:
From dpatel at apple.com Tue Nov 7 16:05:08 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:05:08 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/PassManager.h
Message-ID: <200611072205.kA7M58mg018464@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
PassManager.h updated: 1.18 -> 1.19
---
Log message:
Fix comment.
---
Diffs of the changes: (+1 -1)
PassManager.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.18 llvm/include/llvm/PassManager.h:1.19
--- llvm/include/llvm/PassManager.h:1.18 Tue Nov 7 16:03:15 2006
+++ llvm/include/llvm/PassManager.h Tue Nov 7 16:04:53 2006
@@ -143,7 +143,7 @@
BasicBlockPassManager_New *activeBBPassManager;
};
-/// FunctionPassManager_New manages FunctionPasses.
+/// ModulePassManager_New manages ModulePasses and function pass managers.
/// It batches all Module passes passes and function pass managers together and
/// sequence them to process one module.
class ModulePassManager_New: public Pass {
From dpatel at apple.com Tue Nov 7 16:57:19 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 16:57:19 -0600
Subject: [llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Message-ID: <200611072257.kA7MvJjp019600@zion.cs.uiuc.edu>
Changes in directory llvm/lib/VMCore:
PassManager.cpp updated: 1.5 -> 1.6
---
Log message:
Update new pass managers to use PassManagerAnalysisHelper API.
---
Diffs of the changes: (+21 -6)
PassManager.cpp | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
Index: llvm/lib/VMCore/PassManager.cpp
diff -u llvm/lib/VMCore/PassManager.cpp:1.5 llvm/lib/VMCore/PassManager.cpp:1.6
--- llvm/lib/VMCore/PassManager.cpp:1.5 Tue Nov 7 16:35:17 2006
+++ llvm/lib/VMCore/PassManager.cpp Tue Nov 7 16:56:50 2006
@@ -69,8 +69,13 @@
if (!BP)
return false;
- // TODO: Check if it suitable to manage P using this BasicBlockPassManager
- // or we need another instance of BasicBlockPassManager
+ // If this pass does not preserve anlysis that is used by other passes
+ // managed by this manager than it is not a suiable pass for this manager.
+ if (!manageablePass (P))
+ return false;
+
+ // Take a note of analysis required by this pass.
+ noteDownRequiredAnalysis(P);
// Add pass
PassVector.push_back(BP);
@@ -124,8 +129,13 @@
if (!FP)
return false;
- // TODO: Check if it suitable to manage P using this FunctionPassManager
- // or we need another instance of FunctionPassManager
+ // If this pass does not preserve anlysis that is used by other passes
+ // managed by this manager than it is not a suiable pass for this manager.
+ if (!manageablePass (P))
+ return false;
+
+ // Take a note of analysis required by this pass.
+ noteDownRequiredAnalysis(P);
PassVector.push_back(FP);
activeBBPassManager = NULL;
@@ -179,8 +189,13 @@
if (!MP)
return false;
- // TODO: Check if it suitable to manage P using this ModulePassManager
- // or we need another instance of ModulePassManager
+ // If this pass does not preserve anlysis that is used by other passes
+ // managed by this manager than it is not a suiable pass for this manager.
+ if (!manageablePass (P))
+ return false;
+
+ // Take a note of analysis required by this pass.
+ noteDownRequiredAnalysis(P);
PassVector.push_back(MP);
activeFunctionPassManager = NULL;
From evan.cheng at apple.com Tue Nov 7 16:18:32 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 7 Nov 2006 16:18:32 -0600
Subject: [llvm-commits] CVS:
llvm/test/Regression/CodeGen/X86/vec_shuffle-10.ll unpcklps.ll
Message-ID: <200611072218.kA7MIWU9018776@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/X86:
vec_shuffle-10.ll added (r1.1)
unpcklps.ll (r1.1) removed
---
Log message:
New test case.
---
Diffs of the changes: (+25 -0)
vec_shuffle-10.ll | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+)
Index: llvm/test/Regression/CodeGen/X86/vec_shuffle-10.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/vec_shuffle-10.ll:1.1
*** /dev/null Tue Nov 7 16:18:24 2006
--- llvm/test/Regression/CodeGen/X86/vec_shuffle-10.ll Tue Nov 7 16:18:14 2006
***************
*** 0 ****
--- 1,25 ----
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 &&
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep unpcklps | wc -l | grep 1 &&
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep unpckhps | wc -l | grep 1 &&
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not grep 'sub.*esp'
+
+ void %test(<4 x float>* %res, <4 x float>* %A, <4 x float>* %B) {
+ %tmp = load <4 x float>* %B ; <<4 x float>> [#uses=2]
+ %tmp3 = load <4 x float>* %A ; <<4 x float>> [#uses=2]
+ %tmp = extractelement <4 x float> %tmp3, uint 0 ; [#uses=1]
+ %tmp7 = extractelement <4 x float> %tmp, uint 0 ; [#uses=1]
+ %tmp8 = extractelement <4 x float> %tmp3, uint 1 ; [#uses=1]
+ %tmp9 = extractelement <4 x float> %tmp, uint 1 ; [#uses=1]
+ %tmp10 = insertelement <4 x float> undef, float %tmp, uint 0 ; <<4 x float>> [#uses=1]
+ %tmp11 = insertelement <4 x float> %tmp10, float %tmp7, uint 1 ; <<4 x float>> [#uses=1]
+ %tmp12 = insertelement <4 x float> %tmp11, float %tmp8, uint 2 ; <<4 x float>> [#uses=1]
+ %tmp13 = insertelement <4 x float> %tmp12, float %tmp9, uint 3 ; <<4 x float>> [#uses=1]
+ store <4 x float> %tmp13, <4 x float>* %res
+ ret void
+ }
+
+ void %test2(<4 x float> %X, <4 x float>* %res) {
+ %tmp5 = shufflevector <4 x float> %X, <4 x float> undef, <4 x uint> < uint 2, uint 6, uint 3, uint 7 >
+ store <4 x float> %tmp5, <4 x float>* %res
+ ret void
+ }
From alenhar2 at cs.uiuc.edu Tue Nov 7 17:17:51 2006
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Tue, 7 Nov 2006 17:17:51 -0600
Subject: [llvm-commits] CVS: llvm-test/Makefile.rules
Message-ID: <200611072317.kA7NHpYt019978@zion.cs.uiuc.edu>
Changes in directory llvm-test:
Makefile.rules updated: 1.17 -> 1.18
---
Log message:
analyze went away
---
Diffs of the changes: (+0 -1)
Makefile.rules | 1 -
1 files changed, 1 deletion(-)
Index: llvm-test/Makefile.rules
diff -u llvm-test/Makefile.rules:1.17 llvm-test/Makefile.rules:1.18
--- llvm-test/Makefile.rules:1.17 Tue Sep 19 11:59:51 2006
+++ llvm-test/Makefile.rules Tue Nov 7 17:17:30 2006
@@ -279,7 +279,6 @@
LOPT = $(LLVMTOOLCURRENT)/opt$(EXEEXT)
LLINK = $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT)
LPROF = $(LLVMTOOLCURRENT)/llvm-prof$(EXEEXT)
-LANALYZE = $(LLVMTOOLCURRENT)/analyze$(EXEEXT)
LBUGPOINT = $(LLVMTOOLCURRENT)/bugpoint$(EXEEXT)
LLVMC = $(LLVMTOOLCURRENT)/llvmc$(EXEEXT)
From alenhar2 at cs.uiuc.edu Tue Nov 7 17:23:44 2006
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Tue, 7 Nov 2006 17:23:44 -0600
Subject: [llvm-commits] CVS: llvm-test/TEST.dsgraph.Makefile
TEST.dsgraph.report
Message-ID: <200611072323.kA7NNipt020093@zion.cs.uiuc.edu>
Changes in directory llvm-test:
TEST.dsgraph.Makefile updated: 1.17 -> 1.18
TEST.dsgraph.report updated: 1.14 -> 1.15
---
Log message:
analyze is gone
---
Diffs of the changes: (+5 -5)
TEST.dsgraph.Makefile | 8 ++++----
TEST.dsgraph.report | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
Index: llvm-test/TEST.dsgraph.Makefile
diff -u llvm-test/TEST.dsgraph.Makefile:1.17 llvm-test/TEST.dsgraph.Makefile:1.18
--- llvm-test/TEST.dsgraph.Makefile:1.17 Fri Mar 25 20:04:44 2005
+++ llvm-test/TEST.dsgraph.Makefile Tue Nov 7 17:23:25 2006
@@ -18,10 +18,10 @@
MEM := -track-memory -time-passes
$(PROGRAMS_TO_TEST:%=Output/%.$(TEST).report.txt): \
-Output/%.$(TEST).report.txt: Output/%.lib.bc Output/%.LOC.txt $(LANALYZE) $(LOPT)
+Output/%.$(TEST).report.txt: Output/%.lib.bc Output/%.LOC.txt $(LOPT)
@# Gather data
- -($(LANALYZE) -$(PASS)datastructure $(ANALYZE_OPTS) $<)> $@.time.1 2>&1
- -($(LANALYZE) $(MEM) -$(PASS)datastructure -disable-verify $<)> $@.mem.1 2>&1
+ -($(LOPT) -analyze -$(PASS)datastructure $(ANALYZE_OPTS) $<)> $@.time.1 2>&1
+ -($(LOPT) -analyze $(MEM) -$(PASS)datastructure -disable-verify $<)> $@.mem.1 2>&1
-($(LOPT) -steens-aa -time-passes -disable-output $<) > $@.time.2 2>&1
-($(LOPT) -steens-aa $(MEM) -disable-output $<) > $@.mem.2 2>&1
@# Emit data.
@@ -74,5 +74,5 @@
# Define REPORT_DEPENDENCIES so that the report is regenerated if analyze or
# dummylib is updated.
#
-REPORT_DEPENDENCIES := $(DUMMYLIB) $(LANALYZE) $(LOPT)
+REPORT_DEPENDENCIES := $(DUMMYLIB) $(LOPT)
Index: llvm-test/TEST.dsgraph.report
diff -u llvm-test/TEST.dsgraph.report:1.14 llvm-test/TEST.dsgraph.report:1.15
--- llvm-test/TEST.dsgraph.report:1.14 Fri Mar 25 20:04:44 2005
+++ llvm-test/TEST.dsgraph.report Tue Nov 7 17:23:25 2006
@@ -28,7 +28,7 @@
$TS = 0 if ($TS eq "*");
$NTS = 0 if ($NTS eq "*");
- if ($TS + NTS != 0) {
+ if ($TS + $NTS != 0) {
return sprintf("%4.1f%%", 100*$TS/($TS+$NTS+0.0));
} else {
return "n/a";
From sabre at nondot.org Tue Nov 7 16:42:50 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 16:42:50 -0600
Subject: [llvm-commits] CVS:
llvm/test/Regression/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll
Message-ID: <200611072242.kA7MgopT019352@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/Transforms/ScalarRepl:
2006-11-07-InvalidArrayPromote.ll added (r1.1)
---
Log message:
scalarrepl should not split the two elements of the vsiidx array:
int func(vFloat v0, vFloat v1) {
int ii;
vSInt32 vsiidx[2];
vsiidx[0] = _mm_cvttps_epi32(v0);
vsiidx[1] = _mm_cvttps_epi32(v1);
ii = ((int *) vsiidx)[4];
return ii;
}
---
Diffs of the changes: (+19 -0)
2006-11-07-InvalidArrayPromote.ll | 19 +++++++++++++++++++
1 files changed, 19 insertions(+)
Index: llvm/test/Regression/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll
diff -c /dev/null llvm/test/Regression/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll:1.1
*** /dev/null Tue Nov 7 16:42:39 2006
--- llvm/test/Regression/Transforms/ScalarRepl/2006-11-07-InvalidArrayPromote.ll Tue Nov 7 16:42:29 2006
***************
*** 0 ****
--- 1,19 ----
+ ; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis &&
+ ; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep -F 'alloca [2 x <4 x int>]'
+
+ int %func(<4 x float> %v0, <4 x float> %v1) {
+ %vsiidx = alloca [2 x <4 x int>], align 16 ; <[2 x <4 x int>]*> [#uses=3]
+ %tmp = call <4 x int> %llvm.x86.sse2.cvttps2dq( <4 x float> %v0 ) ; <<4 x int>> [#uses=2]
+ %tmp = cast <4 x int> %tmp to <2 x long> ; <<2 x long>> [#uses=0]
+ %tmp = getelementptr [2 x <4 x int>]* %vsiidx, int 0, int 0 ; <<4 x int>*> [#uses=1]
+ store <4 x int> %tmp, <4 x int>* %tmp
+ %tmp10 = call <4 x int> %llvm.x86.sse2.cvttps2dq( <4 x float> %v1 ) ; <<4 x int>> [#uses=2]
+ %tmp10 = cast <4 x int> %tmp10 to <2 x long> ; <<2 x long>> [#uses=0]
+ %tmp14 = getelementptr [2 x <4 x int>]* %vsiidx, int 0, int 1 ; <<4 x int>*> [#uses=1]
+ store <4 x int> %tmp10, <4 x int>* %tmp14
+ %tmp15 = getelementptr [2 x <4 x int>]* %vsiidx, int 0, int 0, int 4 ; [#uses=1]
+ %tmp = load int* %tmp15 ; [#uses=1]
+ ret int %tmp
+ }
+
+ declare <4 x int> %llvm.x86.sse2.cvttps2dq(<4 x float>)
From dpatel at apple.com Tue Nov 7 18:19:55 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 7 Nov 2006 18:19:55 -0600
Subject: [llvm-commits] CVS: llvm/include/llvm/PassManager.h
Message-ID: <200611080019.kA80Jtho020938@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
PassManager.h updated: 1.22 -> 1.23
---
Log message:
Beautify.
Clarify comments.
---
Diffs of the changes: (+17 -16)
PassManager.h | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
Index: llvm/include/llvm/PassManager.h
diff -u llvm/include/llvm/PassManager.h:1.22 llvm/include/llvm/PassManager.h:1.23
--- llvm/include/llvm/PassManager.h:1.22 Tue Nov 7 16:44:55 2006
+++ llvm/include/llvm/PassManager.h Tue Nov 7 18:19:31 2006
@@ -88,17 +88,18 @@
bool doFinalization();
};
-/// PassManagerAnalysisHelper helpes pass manager analysis required by
-/// the managed passes.
+/// PassManagerAnalysisHelper helps pass manager analysis required by
+/// the managed passes. It provides methods to add/remove analysis
+/// available and query if certain analysis is available or not.
class PassManagerAnalysisHelper {
public:
- /// Return TRUE IFF pass P's required analysis set does not required new
+ /// Return true IFF pass P's required analysis set does not required new
/// manager.
bool manageablePass(Pass *P);
- /// Return TRUE iff AnalysisID AID is currently available.
+ /// Return true IFF AnalysisID AID is currently available.
bool analysisCurrentlyAvailable(AnalysisID AID);
/// Augment RequiredSet by adding analysis required by pass P.
@@ -118,11 +119,11 @@
std::vector RequiredSet;
};
-/// BasicBlockpassManager_New manages BasicBlockPass. It batches all the
+/// BasicBlockPassManager_New manages BasicBlockPass. It batches all the
/// pass together and sequence them to process one basic block before
/// processing next basic block.
-class BasicBlockPassManager_New: public Pass,
- public PassManagerAnalysisHelper {
+class BasicBlockPassManager_New : public Pass,
+ public PassManagerAnalysisHelper {
public:
BasicBlockPassManager_New() { }
@@ -135,7 +136,7 @@
bool runOnFunction(Function &F);
private:
- // Collection of pass that are not yet scheduled
+ // Collection of pass that are managed by this manager
std::vector PassVector;
};
@@ -143,8 +144,8 @@
/// It batches all function passes and basic block pass managers together and
/// sequence them to process one function at a time before processing next
/// function.
-class FunctionPassManager_New: public Pass,
- public PassManagerAnalysisHelper {
+class FunctionPassManager_New : public Pass,
+ public PassManagerAnalysisHelper {
public:
FunctionPassManager_New(ModuleProvider *P) { /* TODO */ }
FunctionPassManager_New() {
@@ -168,7 +169,7 @@
bool runOnModule(Module &M);
private:
- // Collection of pass that are not yet scheduled
+ // Collection of pass that are manged by this manager
std::vector PassVector;
// Active Pass Managers
@@ -178,8 +179,8 @@
/// ModulePassManager_New manages ModulePasses and function pass managers.
/// It batches all Module passes passes and function pass managers together and
/// sequence them to process one module.
-class ModulePassManager_New: public Pass,
- public PassManagerAnalysisHelper {
+class ModulePassManager_New : public Pass,
+ public PassManagerAnalysisHelper {
public:
ModulePassManager_New() { activeFunctionPassManager = NULL; }
@@ -192,7 +193,7 @@
bool runOnModule(Module &M);
private:
- // Collection of pass that are not yet scheduled
+ // Collection of pass that are managed by this manager
std::vector PassVector;
// Active Pass Manager
@@ -200,8 +201,8 @@
};
/// PassManager_New manages ModulePassManagers
-class PassManager_New: public Pass,
- public PassManagerAnalysisHelper {
+class PassManager_New : public Pass,
+ public PassManagerAnalysisHelper {
public:
From rspencer at reidspencer.com Tue Nov 7 18:45:10 2006
From: rspencer at reidspencer.com (Reid Spencer)
Date: Tue, 07 Nov 2006 16:45:10 -0800
Subject: [llvm-commits] CAST Patch (Review Only)
Message-ID: <1162946710.30912.147.camel@bashful.x10sys.com>
Attached is the patch to convert CAST into 10 distinct conversion
instructions. This patch still exhibits two test failures so it is not
ready to be committed. However, due to its size (its 4 times longer than
the others in this series), I thought some early review access would be
useful. This passes everything except:
MultiSource/Benchmarks/McCat/18-imp
MultiSource/Applications/hbd
Unfortunately, bugpoint has not be helpful in reducing these tests to
something useful. I will continue working to find these problems, but
there's no reason a review couldn't be started. Indeed, a review might
discover these problems. I have reviewed it twice and can't see what's
wrong. The nature of the problem is a code gen issue (its not a
misoptimization).
NOTE: Please don't commit any of this (yet) !
Reid.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CAST.patch
Type: text/x-patch
Size: 627721 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20061107/87ee33e1/attachment.bin
From sabre at nondot.org Tue Nov 7 19:03:42 2006
From: sabre at nondot.org (Chris Lattner)
Date: Tue, 7 Nov 2006 19:03:42 -0600
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/BranchFolding.cpp
Message-ID: <200611080103.kA813g4m019591@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
BranchFolding.cpp updated: 1.32 -> 1.33
---
Log message:
optimize single MBB loops better. In particular, produce:
LBB1_57: #bb207.i
movl 72(%esp), %ecx
movb (%ecx,%eax), %cl
movl 80(%esp), %edx
movb %cl, 1(%edx,%eax)
incl %eax
cmpl $143, %eax
jne LBB1_57 #bb207.i
jmp LBB1_64 #cond_next255.i
intead of:
LBB1_57: #bb207.i
movl 72(%esp), %ecx
movb (%ecx,%eax), %cl
movl 80(%esp), %edx
movb %cl, 1(%edx,%eax)
incl %eax
cmpl $143, %eax
je LBB1_64 #cond_next255.i
jmp LBB1_57 #bb207.i
This eliminates a branch per iteration of the loop. This hurted PPC
particularly, because the extra branch meant another dispatch group for each
iteration of the loop.
---
Diffs of the changes: (+17 -0)
BranchFolding.cpp | 17 +++++++++++++++++
1 files changed, 17 insertions(+)
Index: llvm/lib/CodeGen/BranchFolding.cpp
diff -u llvm/lib/CodeGen/BranchFolding.cpp:1.32 llvm/lib/CodeGen/BranchFolding.cpp:1.33
--- llvm/lib/CodeGen/BranchFolding.cpp:1.32 Sun Nov 5 13:31:28 2006
+++ llvm/lib/CodeGen/BranchFolding.cpp Tue Nov 7 19:03:21 2006
@@ -687,6 +687,23 @@
!CurCond.empty(),
++MachineFunction::iterator(MBB));
+ // If this is a two-way branch, and the FBB branches to this block, reverse
+ // the condition so the single-basic-block loop is faster. Instead of:
+ // Loop: xxx; jcc Out; jmp Loop
+ // we want:
+ // Loop: xxx; jncc Loop; jmp Out
+ if (CurTBB && CurFBB && CurFBB == MBB && CurTBB != MBB) {
+ std::vector NewCond(CurCond);
+ if (!TII->ReverseBranchCondition(NewCond)) {
+ TII->RemoveBranch(*MBB);
+ TII->InsertBranch(*MBB, CurFBB, CurTBB, NewCond);
+ MadeChange = true;
+ ++NumBranchOpts;
+ return OptimizeBlock(MBB);
+ }
+ }
+
+
// If this branch is the only thing in its block, see if we can forward
// other blocks across it.
if (CurTBB && CurCond.empty() && CurFBB == 0 &&
From reid at x10sys.com Tue Nov 7 19:11:46 2006
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 7 Nov 2006 19:11:46 -0600
Subject: [llvm-commits] CVS: llvm/docs/LangRef.html
Message-ID: <200611080111.kA81Bk4O019770@zion.cs.uiuc.edu>
Changes in directory llvm/docs:
LangRef.html updated: 1.160 -> 1.161
---
Log message:
For PR950: http://llvm.org/PR950 :
Early commit of the documentation for new conversion instructions for
easier review.
---
Diffs of the changes: (+405 -33)
LangRef.html | 438 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 405 insertions(+), 33 deletions(-)
Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.160 llvm/docs/LangRef.html:1.161
--- llvm/docs/LangRef.html:1.160 Wed Nov 1 19:53:58 2006
+++ llvm/docs/LangRef.html Tue Nov 7 19:11:31 2006
@@ -115,10 +115,22 @@
'getelementptr' Instruction
+ Cast Operations
+
+ - 'trunc .. to' Instruction
+ - 'zext .. to' Instruction
+ - 'sext .. to' Instruction
+ - 'fptrunc .. to' Instruction
+ - 'fpext .. to' Instruction
+ - 'fp2uint .. to' Instruction
+ - 'fp2sint .. to' Instruction
+ - 'uint2fp .. to' Instruction
+ - 'sint2fp .. to' Instruction
+ - 'bitconvert .. to' Instruction
+
Other Operations
- 'phi' Instruction
- - 'cast .. to' Instruction
- 'select' Instruction
- 'call' Instruction
- 'va_arg' Instruction
@@ -1170,9 +1182,54 @@
following is the syntax for constant expressions:
- - cast ( CST to TYPE )
-
- - Cast a constant to another type.
+ - trunc ( CST to TYPE )
+ - Truncate a constant to another type. The bit size of CST must be larger
+ than the bit size of TYPE. Both types must be integral.
+
+ - zext ( CST to TYPE )
+ - Zero extend a constant to another type. The bit size of CST must be
+ smaller or equal to the bit size of TYPE. Both types must be integral.
+
+ - sext ( CST to TYPE )
+ - Sign extend a constant to another type. The bit size of CST must be
+ smaller or equal to the bit size of TYPE. Both types must be integral.
+
+ - fptrunc ( CST to TYPE )
+ - Truncate a floating point constant to another floating point type. The
+ size of CST must be larger than the size of TYPE. Both types must be
+ floating point.
+
+ - fpext ( CST to TYPE )
+ - Floating point extend a constant to another type. The size of CST must be
+ smaller or equal to the size of TYPE. Both types must be floating point.
+
+ - fp2uint ( CST to TYPE )
+ - Convert a floating point constant to the corresponding unsigned integer
+ constant. TYPE must be an integer type. CST must be floating point. If the
+ value won't fit in the integer type, the results are undefined.
+
+ - fp2sint ( CST to TYPE )
+ - Convert a floating point constant to the corresponding signed integer
+ constant. TYPE must be an integer type. CST must be floating point. If the
+ value won't fit in the integer type, the results are undefined.
+
+ - uint2fp ( CST to TYPE )
+ - Convert an unsigned integer constant to the corresponding floating point
+ constant. TYPE must be floating point. CST must be of integer type. If the
+ value won't fit in the floating point type, the results are undefined.
+
+ - sint2fp ( CST to TYPE )
+ - Convert a signed integer constant to the corresponding floating point
+ constant. TYPE must be floating point. CST must be of integer type. If the
+ value won't fit in the floating point type, the results are undefined.
+
+ - bitconvert ( CST to TYPE )
+ - Convert a constant, CST, to another TYPE. The size of CST and TYPE must be
+ identical (same number of bits). The conversion is done as if the CST value
+ was stored to memory and read back as TYPE. In other words, no bits change
+ with this operator, just the type. This can be used for conversion of pointer
+ and packed types to any other type, as long as they have the same bit width.
+
- getelementptr ( CSTPTR, IDX0, IDX1, ... )
@@ -1403,7 +1460,7 @@
; Emulate a conditional br instruction
- %Val = cast bool %value to int
+ %Val = zext bool %value to int
switch int %Val, label %truedest [int 0, label %falsedest ]
; Emulate an unconditional br instruction
@@ -2740,60 +2797,375 @@
-
Syntax:
-
- <result> = cast <ty> <value> to <ty2> ; yields ty2
+ <result> = trunc <ty> <value> to <ty2> ; yields ty2
Overview:
-
-The 'cast' instruction is used as the primitive means to convert
-integers to floating point, change data type sizes, and break type safety (by
-casting pointers).
+The 'trunc' instruction truncates its operand to the type ty2.
-
Arguments:
+
+The 'trunc' instruction takes a value to trunc, which must
+be an integer type, and a type that specifies the size
+and type of the result, which must be an integral
+type.
+
Semantics:
-The 'cast' instruction takes a value to cast, which must be a first
-class value, and a type to cast it to, which must also be a first class type.
-
+The '
trunc' instruction truncates the high order bits in
value
+and converts the reamining bits to
ty2. The bit size of
value
+must be larger than the bit size of
ty2. Equal sized types are not
+allowed. This implies that a
trunc cannot be a
no-op cast. It
+will always truncate bits.
+
+
When truncating to bool, the truncation is done as a comparison against
+zero. If the value was zero, the bool result will be false.
+If the value was non-zero, the bool result will be true.
+
+
Example:
+
+ %X = trunc int 257 to ubyte ; yields ubyte:1
+ %Y = trunc int 123 to bool ; yields bool:true
+
+
+
+
+
+
+
+
Syntax:
+
+ <result> = zext <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'zext' instruction zero extends its operand to type
+ty2.
+
+
+
Arguments:
+
The 'zext' instruction takes a value to cast, which must be of
+integral type, and a type to cast it to, which must
+also be of integral type. The bit size of the
+value must be smaller than or equal to the bit size of the
+destination type, ty2.
Semantics:
+
The zext fills the high order bits of the value with zero
+bits until it reaches the size of the destination type, ty2. When the
+the operand and the type are the same size, no bit filling is done and the
+cast is considered a no-op cast because no bits change (only the type
+changes).
+
+
When zero extending to bool, the extension is done as a comparison against
+zero. If the value was zero, the bool result will be false.
+If the value was non-zero, the bool result will be true.
+
Example:
+
+ %X = zext int 257 to ulong ; yields ulong:257
+ %Y = zext bool true to int ; yields int:1
+
+
+
+
+
+
+
+
Syntax:
+
+ <result> = sext <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'sext' sign extends value to the type ty2.
+
+
Arguments:
-This instruction follows the C rules for explicit casts when determining how the
-data being cast must change to fit in its new container.
-
+The '
sext' instruction takes a value to cast, which must be of
+
integral type, and a type to cast it to, which must
+also be of
integral type.
+
Semantics:
-When casting to bool, any value that would be considered true in the context of
-a C 'if' condition is converted to the boolean 'true' values,
-all else are 'false'.
+The 'sext' instruction performs a sign extension by copying the sign
+bit (highest order bit) of the value until it reaches the bit size of
+the type ty2. When the the operand and the type are the same size,
+no bit filling is done and the cast is considered a no-op cast because
+no bits change (only the type changes).
+
+
When sign extending to bool, the extension is done as a comparison against
+zero. If the value was zero, the bool result will be false.
+If the value was non-zero, the bool result will be true.
+
+
Example:
+
+
+ %X = sext sbyte -1 to ushort ; yields ushort:65535
+ %Y = sext bool true to int ; yields int:-1
+
+
+
+
+
+
+
+
Syntax:
+
+ <result> = fpext <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'fpext' extends a floating point value to a larger
+floating point value.
+
+
Arguments:
+
The 'fpext' instruction takes a
+floating point value to cast,
+and a floating point type to cast it to.
+
+
Semantics:
+
The 'fpext' instruction extends the value from one floating
+point type to another. If the type of the value and ty2 are
+the same, the instruction is considered a no-op cast because no bits
+change.
+
+
Example:
+
+ %X = fpext float 3.1415 to double ; yields double:3.1415
+ %Y = fpext float 1.0 to float ; yields float:1.0 (no-op)
+
+
+
+
+
+
+
+
+
Syntax:
+
+
+ <result> = fptrunc <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'fptrunc' instruction truncates value to type
+ty2.
+
+
+
Arguments:
+
The 'fptrunc' instruction takes a floating
+ point value to cast and a floating point type to
+cast it to. The size of value must be larger than the size of
+ty2. This implies that fptrunc cannot be used to make a
+no-op cast.
+
+
Semantics:
+
The 'fptrunc' instruction converts a
+floating point value from a larger type to a smaller
+type. If the value cannot fit within the destination type, ty2, then
+the results are undefined.
+
+
Example:
+
+ %X = fptrunc double 123.0 to float ; yields float:123.0
+ %Y = fptrunc double 1.0E+300 to float ; yields undefined
+
+
+
+
+
+
+
+
Syntax:
+
+ <result> = fp2uint <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'fp2uint' converts a floating point value to its
+unsigned integer equivalent of type ty2.
-
-When extending an integral value from a type of one signness to another (for
-example 'sbyte' to 'ulong'), the value is sign-extended if the
-source value is signed, and zero-extended if the source value is
-unsigned. bool values are always zero extended into either zero or
-one.
+
Arguments:
+
The 'fp2uint' instruction takes a value to cast, which must be a
+floating point value, and a type to cast it to, which
+must be an integral type.
+
+
Semantics:
+
The 'fp2uint' instruction converts its
+floating point operand into the nearest (rounding
+towards zero) unsigned integer value. If the value cannot fit in ty2,
+the results are undefined.
+
+
When converting to bool, the conversion is done as a comparison against
+zero. If the value was zero, the bool result will be false.
+If the value was non-zero, the bool result will be true.
+
+
Example:
+
+ %X = fp2uint double 123.0 to int ; yields int:123
+ %Y = fp2uint float 1.0E+300 to bool ; yields bool:true
+ %X = fp2uint float 1.04E+17 to ubyte ; yields undefined:1
+
+
+
+
+
+
+
+
Syntax:
+
+ <result> = fp2sint <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'fp2sint' instruction converts
+floating point value to type ty2.
+
+
Arguments:
+
The 'fp2sint' instruction takes a value to cast, which must be a
+floating point value, and a type to cast it to, which
+must also be an integral type.
+
+
Semantics:
+
The 'fp2sint' instruction converts its
+floating point operand into the nearest (rounding
+towards zero) signed integer value. If the value cannot fit in ty2,
+the results are undefined.
+
+
When converting to bool, the conversion is done as a comparison against
+zero. If the value was zero, the bool result will be false.
+If the value was non-zero, the bool result will be true.
+
+
Example:
+
+ %X = fp2sint double -123.0 to int ; yields int:-123
+ %Y = fp2sint float 1.0E-247 to bool ; yields bool:true
+ %X = fp2sint float 1.04E+17 to sbyte ; yields undefined:1
+
+
+
+
+
+
+
+
Syntax:
+
+ <result> = uint2fp <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'uint2fp' instruction regards value as an unsigned
+integer and converts that value to the ty2 type.
+
+
+
Arguments:
+
The 'uint2fp' instruction takes a value to cast, which must be an
+integral value, and a type to cast it to, which must
+be a floating point type.
+
+
Semantics:
+
The 'uint2fp' instruction interprets its operand as an unsigned
+integer quantity and converts it to the corresponding floating point value. If
+the value cannot fit in the floating point value, the results are undefined.
+
+
+
Example:
+
+ %X = uint2fp int 257 to float ; yields float:257.0
+ %Y = uint2fp sbyte -1 to double ; yields double:255.0
+
+
+
+
+
+
+
+
Syntax:
+
+ <result> = sint2fp <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'sint2fp' instruction regards value as a signed
+integer and converts that value to the ty2 type.
+
+
Arguments:
+
The 'sint2fp' instruction takes a value to cast, which must be an
+integral value, and a type to cast it to, which must be
+a floating point type.
+
+
Semantics:
+
The 'sint2fp' instruction interprets its operand as a signed
+integer quantity and converts it to the corresponding floating point value. If
+the value cannot fit in the floating point value, the results are undefined.
+
Example:
+
+ %X = sint2fp int 257 to float ; yields float:257.0
+ %Y = sint2fp sbyte -1 to double ; yields double:-1.0
+
+
+
+
+
+
+
Syntax:
+
+ <result> = bitconvert <ty> <value> to <ty2> ; yields ty2
+
+
+
Overview:
+
The 'bitconvert' instruction converts value to type
+ty2 without changing any bits.
+
+
Arguments:
+
The 'bitconvert' instruction takes a value to cast, which must be
+a first class value, and a type to cast it to, which must also be a first class type. The bit sizes of value
+and the destination type, ty2, must be identical.
+
+
Semantics:
+
The 'bitconvert' instruction converts value to type
+ty2 as if the value had been stored to memory and read back as type
+ty2. That is, no bits are changed during the conversion. The
+bitconvert instruction may be used to construct no-op casts that
+the zext, sext, and fpext instructions do not permit.
+
+
Example:
- %X = cast int 257 to ubyte ; yields ubyte:1
- %Y = cast int 123 to bool ; yields bool:true
+ %X = bitconvert ubyte 255 to sbyte ; yields sbyte:-1
+ %Y = bitconvert uint* %x to uint ; yields uint:%x
@@ -4000,7 +4372,7 @@
Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2006/11/02 01:53:58 $
+ Last modified: $Date: 2006/11/08 01:11:31 $