From sabre at nondot.org Mon Mar 1 00:59:22 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 01 Mar 2010 06:59:22 -0000
Subject: [llvm-commits] [llvm] r97438 - in /llvm/trunk:
include/llvm/CodeGen/SelectionDAGISel.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
utils/TableGen/DAGISelMatcher.cpp utils/TableGen/DAGISelMatcher.h
utils/TableGen/DAGISelMatcherEmitter.cpp
utils/TableGen/DAGISelMatcherOpt.cpp
Message-ID: <20100301065922.499222A6C12C@llvm.org>
Author: lattner
Date: Mon Mar 1 00:59:22 2010
New Revision: 97438
URL: http://llvm.org/viewvc/llvm-project?rev=97438&view=rev
Log:
add a new OPC_SwitchOpcode which is semantically equivalent
to a scope where every child starts with a CheckOpcode, but
executes more efficiently. Enhance DAGISelMatcherOpt to
form it.
This also fixes a bug in CheckOpcode: apparently the SDNodeInfo
objects are not pointer comparable, we have to compare the
enum name.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/utils/TableGen/DAGISelMatcher.cpp
llvm/trunk/utils/TableGen/DAGISelMatcher.h
llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=97438&r1=97437&r2=97438&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Mar 1 00:59:22 2010
@@ -112,6 +112,7 @@
OPC_CheckPatternPredicate,
OPC_CheckPredicate,
OPC_CheckOpcode,
+ OPC_SwitchOpcode,
OPC_CheckMultiOpcode,
OPC_CheckType,
OPC_CheckChild0Type, OPC_CheckChild1Type, OPC_CheckChild2Type,
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=97438&r1=97437&r2=97438&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Mar 1 00:59:22 2010
@@ -1757,6 +1757,36 @@
if (N->getOpcode() != MatcherTable[MatcherIndex++]) break;
continue;
+ case OPC_SwitchOpcode: {
+ unsigned CurNodeOpcode = N.getOpcode();
+
+ unsigned SwitchStart = MatcherIndex-1;
+
+ unsigned CaseSize;
+ while (1) {
+ // Get the size of this case.
+ CaseSize = MatcherTable[MatcherIndex++];
+ if (CaseSize & 128)
+ CaseSize = GetVBR(CaseSize, MatcherTable, MatcherIndex);
+ if (CaseSize == 0) break;
+
+ // If the opcode matches, then we will execute this case.
+ if (CurNodeOpcode == MatcherTable[MatcherIndex++])
+ break;
+
+ // Otherwise, skip over this case.
+ MatcherIndex += CaseSize;
+ }
+
+ // If we failed to match, bail out.
+ if (CaseSize == 0) break;
+
+ // Otherwise, execute the case we found.
+ DEBUG(errs() << " OpcodeSwitch from " << SwitchStart
+ << " to " << MatcherIndex << "\n");
+ continue;
+ }
+
case OPC_CheckMultiOpcode: {
unsigned NumOps = MatcherTable[MatcherIndex++];
bool OpcodeEquals = false;
Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.cpp?rev=97438&r1=97437&r2=97438&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcher.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcher.cpp Mon Mar 1 00:59:22 2010
@@ -88,6 +88,16 @@
OS.indent(indent) << "CheckOpcode " << Opcode.getEnumName() << '\n';
}
+void SwitchOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
+ OS.indent(indent) << "SwitchOpcode: {\n";
+ for (unsigned i = 0, e = Cases.size(); i != e; ++i) {
+ OS.indent(indent) << "case " << Cases[i].first->getEnumName() << ":\n";
+ Cases[i].second->print(OS, indent+2);
+ }
+ OS.indent(indent) << "}\n";
+}
+
+
void CheckMultiOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const{
OS.indent(indent) << "CheckMultiOpcode \n";
}
@@ -242,6 +252,14 @@
return HashUnsigneds(ChainNodes.begin(), ChainNodes.end());
}
+bool CheckOpcodeMatcher::isEqualImpl(const Matcher *M) const {
+ // Note: pointer equality isn't enough here, we have to check the enum names
+ // to ensure that the nodes are for the same opcode.
+ return cast(M)->Opcode.getEnumName() ==
+ Opcode.getEnumName();
+}
+
+
bool EmitNodeMatcherCommon::isEqualImpl(const Matcher *m) const {
const EmitNodeMatcherCommon *M = cast(m);
return M->OpcodeName == OpcodeName && M->VTs == VTs &&
@@ -288,7 +306,9 @@
bool CheckOpcodeMatcher::isContradictoryImpl(const Matcher *M) const {
if (const CheckOpcodeMatcher *COM = dyn_cast(M)) {
// One node can't have two different opcodes!
- return &COM->getOpcode() != &getOpcode();
+ // Note: pointer equality isn't enough here, we have to check the enum names
+ // to ensure that the nodes are for the same opcode.
+ return COM->getOpcode().getEnumName() != getOpcode().getEnumName();
}
// TODO: CheckMultiOpcodeMatcher?
Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.h?rev=97438&r1=97437&r2=97438&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcher.h (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcher.h Mon Mar 1 00:59:22 2010
@@ -54,6 +54,7 @@
CheckPatternPredicate,
CheckPredicate, // Fail if node predicate fails.
CheckOpcode, // Fail if not opcode.
+ SwitchOpcode, // Dispatch based on opcode.
CheckMultiOpcode, // Fail if not in opcode list.
CheckType, // Fail if not correct type.
CheckChildType, // Fail if child has wrong type.
@@ -416,12 +417,37 @@
private:
virtual void printImpl(raw_ostream &OS, unsigned indent) const;
- virtual bool isEqualImpl(const Matcher *M) const {
- return &cast(M)->Opcode == &Opcode;
- }
+ virtual bool isEqualImpl(const Matcher *M) const;
virtual unsigned getHashImpl() const;
virtual bool isContradictoryImpl(const Matcher *M) const;
};
+
+/// SwitchOpcodeMatcher - Switch based on the current node's opcode, dispatching
+/// to one matcher per opcode. If the opcode doesn't match any of the cases,
+/// then the match fails. This is semantically equivalent to a Scope node where
+/// every child does a CheckOpcode, but is much faster.
+class SwitchOpcodeMatcher : public Matcher {
+ SmallVector, 8> Cases;
+public:
+ SwitchOpcodeMatcher(const std::pair *cases,
+ unsigned numcases)
+ : Matcher(SwitchOpcode), Cases(cases, cases+numcases) {}
+
+ static inline bool classof(const Matcher *N) {
+ return N->getKind() == SwitchOpcode;
+ }
+
+ unsigned getNumCases() const { return Cases.size(); }
+
+ const SDNodeInfo &getCaseOpcode(unsigned i) const { return *Cases[i].first; }
+ Matcher *getCaseMatcher(unsigned i) { return Cases[i].second; }
+ const Matcher *getCaseMatcher(unsigned i) const { return Cases[i].second; }
+
+private:
+ virtual void printImpl(raw_ostream &OS, unsigned indent) const;
+ virtual bool isEqualImpl(const Matcher *M) const { return false; }
+ virtual unsigned getHashImpl() const { return 4123; }
+};
/// CheckMultiOpcodeMatcher - This checks to see if the current node has one
/// of the specified opcode, if not it fails to match.
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp?rev=97438&r1=97437&r2=97438&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp Mon Mar 1 00:59:22 2010
@@ -158,8 +158,8 @@
TmpBuf.clear();
raw_svector_ostream OS(TmpBuf);
formatted_raw_ostream FOS(OS);
- ChildSize = EmitMatcherList(cast(N)->getChild(i),
- Indent+1, CurrentIdx+VBRSize, FOS);
+ ChildSize = EmitMatcherList(SM->getChild(i), Indent+1,
+ CurrentIdx+VBRSize, FOS);
} while (GetVBRSize(ChildSize) != VBRSize);
assert(ChildSize != 0 && "Should not have a zero-sized child!");
@@ -235,6 +235,53 @@
<< cast(N)->getOpcode().getEnumName() << ",\n";
return 2;
+ case Matcher::SwitchOpcode: {
+ unsigned StartIdx = CurrentIdx;
+ const SwitchOpcodeMatcher *SOM = cast(N);
+ OS << "OPC_SwitchOpcode /*" << SOM->getNumCases() << " cases */, ";
+ ++CurrentIdx;
+
+ // For each case we emit the size, then the opcode, then the matcher.
+ for (unsigned i = 0, e = SOM->getNumCases(); i != e; ++i) {
+ // We need to encode the opcode and the offset of the case code before
+ // emitting the case code. Handle this by buffering the output into a
+ // string while we get the size. Unfortunately, the offset of the
+ // children depends on the VBR size of the child, so for large children we
+ // have to iterate a bit.
+ SmallString<128> TmpBuf;
+ unsigned ChildSize = 0;
+ unsigned VBRSize = 0;
+ do {
+ VBRSize = GetVBRSize(ChildSize);
+
+ TmpBuf.clear();
+ raw_svector_ostream OS(TmpBuf);
+ formatted_raw_ostream FOS(OS);
+ ChildSize = EmitMatcherList(SOM->getCaseMatcher(i),
+ Indent+1, CurrentIdx+VBRSize+1, FOS);
+ } while (GetVBRSize(ChildSize) != VBRSize);
+
+ assert(ChildSize != 0 && "Should not have a zero-sized child!");
+
+ if (i != 0)
+ OS.PadToColumn(Indent*2) << "/*SwitchOpcode*/ ";
+
+ // Emit the VBR.
+ CurrentIdx += EmitVBRValue(ChildSize, OS);
+
+ OS << " " << SOM->getCaseOpcode(i).getEnumName() << ",";
+ OS << "// ->" << CurrentIdx+ChildSize+1 << '\n';
+ ++CurrentIdx;
+ OS << TmpBuf.str();
+ CurrentIdx += ChildSize;
+ }
+
+ // Emit the final zero to terminate the switch.
+ OS.PadToColumn(Indent*2) << "0, // EndSwitchOpcode\n";
+ ++CurrentIdx;
+ return CurrentIdx-StartIdx;
+ }
+
case Matcher::CheckMultiOpcode: {
const CheckMultiOpcodeMatcher *CMO = cast(N);
OS << "OPC_CheckMultiOpcode, " << CMO->getNumOpcodes() << ", ";
@@ -575,6 +622,7 @@
OS << "OPC_CheckPatternPredicate"; break;
case Matcher::CheckPredicate: OS << "OPC_CheckPredicate"; break;
case Matcher::CheckOpcode: OS << "OPC_CheckOpcode"; break;
+ case Matcher::SwitchOpcode: OS << "OPC_SwitchOpcode"; break;
case Matcher::CheckMultiOpcode: OS << "OPC_CheckMultiOpcode"; break;
case Matcher::CheckType: OS << "OPC_CheckType"; break;
case Matcher::CheckChildType: OS << "OPC_CheckChildType"; break;
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp?rev=97438&r1=97437&r2=97438&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp Mon Mar 1 00:59:22 2010
@@ -15,6 +15,7 @@
#include "DAGISelMatcher.h"
#include "CodeGenDAGPatterns.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include
@@ -152,7 +153,8 @@
// like X86 where many operations are valid on multiple types.
if ((isa(N) || isa(N) ||
isa(N)) &&
- isa(N->getNext())) {
+ (isa(N->getNext()) ||
+ isa(N->getNext()))) {
// Unlink the two nodes from the list.
Matcher *CheckType = MatcherPtr.take();
Matcher *CheckOpcode = CheckType->takeNext();
@@ -256,7 +258,7 @@
}
SmallVector NewOptionsToMatch;
-
+
// Loop over options to match, merging neighboring patterns with identical
// starting nodes into a shared matcher.
for (unsigned OptionIdx = 0, e = OptionsToMatch.size(); OptionIdx != e;) {
@@ -342,13 +344,55 @@
NewOptionsToMatch.push_back(Shared);
}
+
+ // If we're down to a single pattern to match, then we don't need this scope
+ // anymore.
+ if (NewOptionsToMatch.size() == 1) {
+ MatcherPtr.reset(NewOptionsToMatch[0]);
+ return;
+ }
+
+ // If our factoring failed (didn't achieve anything) see if we can simplify in
+ // other ways.
+
+ // Check to see if all of the leading entries are now opcode checks. If so,
+ // we can convert this Scope to be a OpcodeSwitch instead.
+ bool AllOpcodeChecks = true;
+ for (unsigned i = 0, e = NewOptionsToMatch.size(); i != e; ++i) {
+ if (isa(NewOptionsToMatch[i])) continue;
+
+#if 0
+ if (i > 3) {
+ errs() << "FAILING OPC #" << i << "\n";
+ NewOptionsToMatch[i]->dump();
+ }
+#endif
+
+ AllOpcodeChecks = false;
+ break;
+ }
+
+ // If all the options are CheckOpcode's, we can form the SwitchOpcode, woot.
+ if (AllOpcodeChecks) {
+ StringSet<> Opcodes;
+ SmallVector, 8> Cases;
+ for (unsigned i = 0, e = NewOptionsToMatch.size(); i != e; ++i) {
+ CheckOpcodeMatcher *COM =cast(NewOptionsToMatch[i]);
+ assert(Opcodes.insert(COM->getOpcode().getEnumName()) &&
+ "Duplicate opcodes not factored?");
+ Cases.push_back(std::make_pair(&COM->getOpcode(), COM->getNext()));
+ }
+
+ MatcherPtr.reset(new SwitchOpcodeMatcher(&Cases[0], Cases.size()));
+ return;
+ }
+
// Reassemble a new Scope node.
- assert(!NewOptionsToMatch.empty() && "where'd all our children go?");
+ assert(!NewOptionsToMatch.empty() &&
+ "Where'd all our children go? Did we really factor everything??");
if (NewOptionsToMatch.empty())
MatcherPtr.reset(0);
- if (NewOptionsToMatch.size() == 1)
- MatcherPtr.reset(NewOptionsToMatch[0]);
else {
Scope->setNumChildren(NewOptionsToMatch.size());
for (unsigned i = 0, e = NewOptionsToMatch.size(); i != e; ++i)
From sabre at nondot.org Mon Mar 1 01:17:40 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 01 Mar 2010 07:17:40 -0000
Subject: [llvm-commits] [llvm] r97439 - in /llvm/trunk:
include/llvm/CodeGen/SelectionDAGISel.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
utils/TableGen/DAGISelEmitter.cpp utils/TableGen/DAGISelMatcher.cpp
utils/TableGen/DAGISelMatcher.h utils/TableGen/DAGISelMatcherEmitter.cpp
utils/TableGen/DAGISelMatcherGen.cpp utils/TableGen/DAGISelMatcherOpt.cpp
Message-ID: <20100301071741.0F05B2A6C12C@llvm.org>
Author: lattner
Date: Mon Mar 1 01:17:40 2010
New Revision: 97439
URL: http://llvm.org/viewvc/llvm-project?rev=97439&view=rev
Log:
eliminate the CheckMultiOpcodeMatcher code and have each
ComplexPattern at the root be generated multiple times, once
for each opcode they are part of. This encourages factoring
because the opcode checks get treated just like everything
else in the matcher.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
llvm/trunk/utils/TableGen/DAGISelMatcher.cpp
llvm/trunk/utils/TableGen/DAGISelMatcher.h
llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp
llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=97439&r1=97438&r2=97439&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Mar 1 01:17:40 2010
@@ -113,7 +113,6 @@
OPC_CheckPredicate,
OPC_CheckOpcode,
OPC_SwitchOpcode,
- OPC_CheckMultiOpcode,
OPC_CheckType,
OPC_CheckChild0Type, OPC_CheckChild1Type, OPC_CheckChild2Type,
OPC_CheckChild3Type, OPC_CheckChild4Type, OPC_CheckChild5Type,
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=97439&r1=97438&r2=97439&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Mar 1 01:17:40 2010
@@ -1787,15 +1787,6 @@
continue;
}
- case OPC_CheckMultiOpcode: {
- unsigned NumOps = MatcherTable[MatcherIndex++];
- bool OpcodeEquals = false;
- for (unsigned i = 0; i != NumOps; ++i)
- OpcodeEquals |= N->getOpcode() == MatcherTable[MatcherIndex++];
- if (!OpcodeEquals) break;
- continue;
- }
-
case OPC_CheckType: {
MVT::SimpleValueType VT =
(MVT::SimpleValueType)MatcherTable[MatcherIndex++];
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=97439&r1=97438&r2=97439&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Mon Mar 1 01:17:40 2010
@@ -1959,10 +1959,17 @@
PatternSortingPredicate2(CGP));
- // Convert each pattern into Matcher's.
+ // Convert each variant of each pattern into a Matcher.
std::vector PatternMatchers;
- for (unsigned i = 0, e = Patterns.size(); i != e; ++i)
- PatternMatchers.push_back(ConvertPatternToMatcher(*Patterns[i], CGP));
+ for (unsigned i = 0, e = Patterns.size(); i != e; ++i) {
+ for (unsigned Variant = 0; ; ++Variant) {
+ if (Matcher *M = ConvertPatternToMatcher(*Patterns[i], Variant, CGP))
+ PatternMatchers.push_back(M);
+ else
+ break;
+ }
+ }
+
Matcher *TheMatcher = new ScopeMatcher(&PatternMatchers[0],
PatternMatchers.size());
Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.cpp?rev=97439&r1=97438&r2=97439&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcher.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcher.cpp Mon Mar 1 01:17:40 2010
@@ -98,10 +98,6 @@
}
-void CheckMultiOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const{
- OS.indent(indent) << "CheckMultiOpcode \n";
-}
-
void CheckTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
OS.indent(indent) << "CheckType " << getEnumName(Type) << '\n';
}
@@ -221,13 +217,6 @@
return HashString(Opcode.getEnumName());
}
-unsigned CheckMultiOpcodeMatcher::getHashImpl() const {
- unsigned Result = 0;
- for (unsigned i = 0, e = Opcodes.size(); i != e; ++i)
- Result |= HashString(Opcodes[i]->getEnumName());
- return Result;
-}
-
unsigned CheckCondCodeMatcher::getHashImpl() const {
return HashString(CondCodeName);
}
@@ -311,8 +300,6 @@
return COM->getOpcode().getEnumName() != getOpcode().getEnumName();
}
- // TODO: CheckMultiOpcodeMatcher?
-
// If the node has a known type, and if the type we're checking for is
// different, then we know they contradict. For example, a check for
// ISD::STORE will never be true at the same time a check for Type i32 is.
Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.h?rev=97439&r1=97438&r2=97439&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcher.h (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcher.h Mon Mar 1 01:17:40 2010
@@ -25,7 +25,7 @@
class Record;
class SDNodeInfo;
-Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,
+Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,unsigned Variant,
const CodeGenDAGPatterns &CGP);
Matcher *OptimizeMatcher(Matcher *Matcher, const CodeGenDAGPatterns &CGP);
void EmitMatcherTable(const Matcher *Matcher, const CodeGenDAGPatterns &CGP,
@@ -449,33 +449,6 @@
virtual unsigned getHashImpl() const { return 4123; }
};
-/// CheckMultiOpcodeMatcher - This checks to see if the current node has one
-/// of the specified opcode, if not it fails to match.
-class CheckMultiOpcodeMatcher : public Matcher {
- SmallVector Opcodes;
-public:
- CheckMultiOpcodeMatcher(const SDNodeInfo * const *opcodes, unsigned numops)
- : Matcher(CheckMultiOpcode), Opcodes(opcodes, opcodes+numops) {}
-
- unsigned getNumOpcodes() const { return Opcodes.size(); }
- const SDNodeInfo &getOpcode(unsigned i) const { return *Opcodes[i]; }
-
- static inline bool classof(const Matcher *N) {
- return N->getKind() == CheckMultiOpcode;
- }
-
- virtual bool isSafeToReorderWithPatternPredicate() const { return true; }
-
-private:
- virtual void printImpl(raw_ostream &OS, unsigned indent) const;
- virtual bool isEqualImpl(const Matcher *M) const {
- return cast(M)->Opcodes == Opcodes;
- }
- virtual unsigned getHashImpl() const;
-};
-
-
-
/// CheckTypeMatcher - This checks to see if the current node has the
/// specified type, if not it fails to match.
class CheckTypeMatcher : public Matcher {
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp?rev=97439&r1=97438&r2=97439&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp Mon Mar 1 01:17:40 2010
@@ -282,16 +282,7 @@
return CurrentIdx-StartIdx;
}
- case Matcher::CheckMultiOpcode: {
- const CheckMultiOpcodeMatcher *CMO = cast(N);
- OS << "OPC_CheckMultiOpcode, " << CMO->getNumOpcodes() << ", ";
- for (unsigned i = 0, e = CMO->getNumOpcodes(); i != e; ++i)
- OS << CMO->getOpcode(i).getEnumName() << ", ";
- OS << '\n';
- return 2 + CMO->getNumOpcodes();
- }
-
- case Matcher::CheckType:
+ case Matcher::CheckType:
OS << "OPC_CheckType, "
<< getEnumName(cast(N)->getType()) << ",\n";
return 2;
@@ -623,7 +614,6 @@
case Matcher::CheckPredicate: OS << "OPC_CheckPredicate"; break;
case Matcher::CheckOpcode: OS << "OPC_CheckOpcode"; break;
case Matcher::SwitchOpcode: OS << "OPC_SwitchOpcode"; break;
- case Matcher::CheckMultiOpcode: OS << "OPC_CheckMultiOpcode"; break;
case Matcher::CheckType: OS << "OPC_CheckType"; break;
case Matcher::CheckChildType: OS << "OPC_CheckChildType"; break;
case Matcher::CheckInteger: OS << "OPC_CheckInteger"; break;
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp?rev=97439&r1=97438&r2=97439&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp Mon Mar 1 01:17:40 2010
@@ -97,7 +97,7 @@
delete PatWithNoTypes;
}
- void EmitMatcherCode();
+ bool EmitMatcherCode(unsigned Variant);
void EmitResultCode();
Matcher *GetMatcher() const { return TheMatcher; }
@@ -247,20 +247,6 @@
// Handle complex pattern.
const ComplexPattern &CP = CGP.getComplexPattern(LeafRec);
-
- // If we're at the root of the pattern, we have to check that the opcode
- // is a one of the ones requested to be matched.
- if (N == Pattern.getSrcPattern()) {
- const std::vector &OpNodes = CP.getRootNodes();
- if (OpNodes.size() == 1) {
- AddMatcher(new CheckOpcodeMatcher(CGP.getSDNodeInfo(OpNodes[0])));
- } else if (!OpNodes.empty()) {
- SmallVector OpNames;
- for (unsigned i = 0, e = OpNodes.size(); i != e; i++)
- OpNames.push_back(&CGP.getSDNodeInfo(OpNodes[i]));
- AddMatcher(new CheckMultiOpcodeMatcher(OpNames.data(), OpNames.size()));
- }
- }
// Emit a CheckComplexPat operation, which does the match (aborting if it
// fails) and pushes the matched operands onto the recorded nodes list.
@@ -495,7 +481,30 @@
EmitOperatorMatchCode(N, NodeNoTypes);
}
-void MatcherGen::EmitMatcherCode() {
+/// EmitMatcherCode - Generate the code that matches the predicate of this
+/// pattern for the specified Variant. If the variant is invalid this returns
+/// true and does not generate code, if it is valid, it returns false.
+bool MatcherGen::EmitMatcherCode(unsigned Variant) {
+ // If the root of the pattern is a ComplexPattern and if it is specified to
+ // match some number of root opcodes, these are considered to be our variants.
+ // Depending on which variant we're generating code for, emit the root opcode
+ // check.
+ if (const ComplexPattern *CP =
+ Pattern.getSrcPattern()->getComplexPatternInfo(CGP)) {
+
+ const std::vector &OpNodes = CP->getRootNodes();
+ if (OpNodes.empty()) {
+ // FIXME: Empty OpNodes runs on everything, is this even valid?
+ if (Variant != 0) return true;
+ } else {
+ if (Variant >= OpNodes.size()) return true;
+
+ AddMatcher(new CheckOpcodeMatcher(CGP.getSDNodeInfo(OpNodes[Variant])));
+ }
+ } else {
+ if (Variant != 0) return true;
+ }
+
// If the pattern has a predicate on it (e.g. only enabled when a subtarget
// feature is around, do the check).
// FIXME: This should get emitted after the match code below to encourage
@@ -503,11 +512,11 @@
// dag combine, eliminating the horrible side-effect-full stuff from
// X86's MatchAddress.
if (!Pattern.getPredicateCheck().empty())
- AddMatcher(new
- CheckPatternPredicateMatcher(Pattern.getPredicateCheck()));
-
+ AddMatcher(new CheckPatternPredicateMatcher(Pattern.getPredicateCheck()));
+
// Emit the matcher for the pattern structure and types.
EmitMatchCode(Pattern.getSrcPattern(), PatWithNoTypes);
+ return false;
}
@@ -849,13 +858,16 @@
}
+/// ConvertPatternToMatcher - Create the matcher for the specified pattern with
+/// the specified variant. If the variant number is invalid, this returns null.
Matcher *llvm::ConvertPatternToMatcher(const PatternToMatch &Pattern,
+ unsigned Variant,
const CodeGenDAGPatterns &CGP) {
MatcherGen Gen(Pattern, CGP);
// Generate the code for the matcher.
- Gen.EmitMatcherCode();
-
+ if (Gen.EmitMatcherCode(Variant))
+ return 0;
// FIXME2: Kill extra MoveParent commands at the end of the matcher sequence.
// FIXME2: Split result code out to another table, and make the matcher end
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp?rev=97439&r1=97438&r2=97439&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherOpt.cpp Mon Mar 1 01:17:40 2010
@@ -153,8 +153,7 @@
// like X86 where many operations are valid on multiple types.
if ((isa(N) || isa(N) ||
isa(N)) &&
- (isa(N->getNext()) ||
- isa(N->getNext()))) {
+ isa(N->getNext())) {
// Unlink the two nodes from the list.
Matcher *CheckType = MatcherPtr.take();
Matcher *CheckOpcode = CheckType->takeNext();
From sabre at nondot.org Mon Mar 1 01:27:07 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 01 Mar 2010 07:27:07 -0000
Subject: [llvm-commits] [llvm] r97440 - in /llvm/trunk/utils/TableGen:
DAGISelMatcher.h DAGISelMatcherGen.cpp
Message-ID: <20100301072707.622CF2A6C12C@llvm.org>
Author: lattner
Date: Mon Mar 1 01:27:07 2010
New Revision: 97440
URL: http://llvm.org/viewvc/llvm-project?rev=97440&view=rev
Log:
Emit a redundant check for immediates at root context, e.g. (imm 0).
This allows formation of OpcodeSwitch for top level patterns, in
particular on X86. This saves about 1K of data space in the x86
table and makes the dispatch much more efficient.
Modified:
llvm/trunk/utils/TableGen/DAGISelMatcher.h
llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp
Modified: llvm/trunk/utils/TableGen/DAGISelMatcher.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcher.h?rev=97440&r1=97439&r2=97440&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcher.h (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcher.h Mon Mar 1 01:27:07 2010
@@ -55,7 +55,6 @@
CheckPredicate, // Fail if node predicate fails.
CheckOpcode, // Fail if not opcode.
SwitchOpcode, // Dispatch based on opcode.
- CheckMultiOpcode, // Fail if not in opcode list.
CheckType, // Fail if not correct type.
CheckChildType, // Fail if child has wrong type.
CheckInteger, // Fail if wrong val.
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp?rev=97440&r1=97439&r2=97440&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp Mon Mar 1 01:27:07 2010
@@ -205,8 +205,17 @@
AddMatcher(new CheckPredicateMatcher(N->getPredicateFns()[i]));
// Direct match against an integer constant.
- if (IntInit *II = dynamic_cast(N->getLeafValue()))
+ if (IntInit *II = dynamic_cast(N->getLeafValue())) {
+ // If this is the root of the dag we're matching, we emit a redundant opcode
+ // check to ensure that this gets folded into the normal top-level
+ // OpcodeSwitch.
+ if (N == Pattern.getSrcPattern()) {
+ const SDNodeInfo &NI = CGP.getSDNodeInfo(CGP.getSDNodeNamed("imm"));
+ AddMatcher(new CheckOpcodeMatcher(NI));
+ }
+
return AddMatcher(new CheckIntegerMatcher(II->getValue()));
+ }
DefInit *DI = dynamic_cast(N->getLeafValue());
if (DI == 0) {
From sabre at nondot.org Mon Mar 1 01:43:08 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 01 Mar 2010 07:43:08 -0000
Subject: [llvm-commits] [llvm] r97441 - in
/llvm/trunk/lib/CodeGen/SelectionDAG: SelectionDAG.cpp SelectionDAGISel.cpp
Message-ID: <20100301074308.AE69C2A6C12C@llvm.org>
Author: lattner
Date: Mon Mar 1 01:43:08 2010
New Revision: 97441
URL: http://llvm.org/viewvc/llvm-project?rev=97441&view=rev
Log:
some trivial microoptimizations.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=97441&r1=97440&r2=97441&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Mar 1 01:43:08 2010
@@ -4736,12 +4736,14 @@
// Delete any nodes that are still dead after adding the uses for the
// new operands.
- SmallVector DeadNodes;
- for (SmallPtrSet::iterator I = DeadNodeSet.begin(),
- E = DeadNodeSet.end(); I != E; ++I)
- if ((*I)->use_empty())
- DeadNodes.push_back(*I);
- RemoveDeadNodes(DeadNodes);
+ if (!DeadNodeSet.empty()) {
+ SmallVector DeadNodes;
+ for (SmallPtrSet::iterator I = DeadNodeSet.begin(),
+ E = DeadNodeSet.end(); I != E; ++I)
+ if ((*I)->use_empty())
+ DeadNodes.push_back(*I);
+ RemoveDeadNodes(DeadNodes);
+ }
if (IP)
CSEMap.InsertNode(N, IP); // Memoize the new node.
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=97441&r1=97440&r2=97441&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Mar 1 01:43:08 2010
@@ -1760,7 +1760,7 @@
case OPC_SwitchOpcode: {
unsigned CurNodeOpcode = N.getOpcode();
- unsigned SwitchStart = MatcherIndex-1;
+ unsigned SwitchStart = MatcherIndex-1; (void)SwitchStart;
unsigned CaseSize;
while (1) {
@@ -2060,8 +2060,15 @@
if (EmitNodeInfo & OPFL_FlagOutput)
VTs.push_back(MVT::Flag);
- // FIXME: Use faster version for the common 'one VT' case?
- SDVTList VTList = CurDAG->getVTList(VTs.data(), VTs.size());
+ // This is hot code, so optimize the two most common cases of 1 and 2
+ // results.
+ SDVTList VTList;
+ if (VTs.size() == 1)
+ VTList = CurDAG->getVTList(VTs[0]);
+ else if (VTs.size() == 2)
+ VTList = CurDAG->getVTList(VTs[0], VTs[1]);
+ else
+ VTList = CurDAG->getVTList(VTs.data(), VTs.size());
// Get the operand list.
unsigned NumOps = MatcherTable[MatcherIndex++];
From sabre at nondot.org Mon Mar 1 01:54:59 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 01 Mar 2010 07:54:59 -0000
Subject: [llvm-commits] [llvm] r97442 -
/llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp
Message-ID: <20100301075459.CEFBE2A6C12C@llvm.org>
Author: lattner
Date: Mon Mar 1 01:54:59 2010
New Revision: 97442
URL: http://llvm.org/viewvc/llvm-project?rev=97442&view=rev
Log:
Emit type checks late instead of early, this encourages
structural matching code to be factored and shared this
shrinks the X86 isel table from 86537 to 83890 bytes.
Modified:
llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp?rev=97442&r1=97441&r2=97442&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherGen.cpp Mon Mar 1 01:54:59 2010
@@ -460,8 +460,9 @@
// If N and NodeNoTypes don't agree on a type, then this is a case where we
// need to do a type check. Emit the check, apply the tyep to NodeNoTypes and
// reinfer any correlated types.
+ unsigned NodeType = EEVT::isUnknown;
if (NodeNoTypes->getExtTypes() != N->getExtTypes()) {
- AddMatcher(new CheckTypeMatcher(N->getTypeNum(0)));
+ NodeType = N->getTypeNum(0);
NodeNoTypes->setTypes(N->getExtTypes());
InferPossibleTypes();
}
@@ -488,6 +489,10 @@
EmitLeafMatchCode(N);
else
EmitOperatorMatchCode(N, NodeNoTypes);
+
+ if (NodeType != EEVT::isUnknown)
+ AddMatcher(new CheckTypeMatcher((MVT::SimpleValueType)NodeType));
+
}
/// EmitMatcherCode - Generate the code that matches the predicate of this
From gohman at apple.com Mon Mar 1 11:34:28 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:34:28 -0000
Subject: [llvm-commits] [llvm] r97446 -
/llvm/trunk/lib/VMCore/PassManager.cpp
Message-ID: <20100301173428.450462A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:34:28 2010
New Revision: 97446
URL: http://llvm.org/viewvc/llvm-project?rev=97446&view=rev
Log:
Don't print "Modified" for passes which haven't modified anything.
Modified:
llvm/trunk/lib/VMCore/PassManager.cpp
Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=97446&r1=97445&r2=97446&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Mon Mar 1 11:34:28 2010
@@ -1118,6 +1118,7 @@
for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
BasicBlockPass *BP = getContainedPass(Index);
+ bool LocalChanged = false;
dumpPassInfo(BP, EXECUTION_MSG, ON_BASICBLOCK_MSG, I->getName());
dumpRequiredSet(BP);
@@ -1129,11 +1130,12 @@
PassManagerPrettyStackEntry X(BP, *I);
Timer *T = StartPassTimer(BP);
- Changed |= BP->runOnBasicBlock(*I);
+ LocalChanged |= BP->runOnBasicBlock(*I);
StopPassTimer(BP, T);
}
- if (Changed)
+ Changed |= LocalChanged;
+ if (LocalChanged)
dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG,
I->getName());
dumpPreservedSet(BP);
@@ -1334,6 +1336,7 @@
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
FunctionPass *FP = getContainedPass(Index);
+ bool LocalChanged = false;
dumpPassInfo(FP, EXECUTION_MSG, ON_FUNCTION_MSG, F.getName());
dumpRequiredSet(FP);
@@ -1344,11 +1347,12 @@
PassManagerPrettyStackEntry X(FP, F);
Timer *T = StartPassTimer(FP);
- Changed |= FP->runOnFunction(F);
+ LocalChanged |= FP->runOnFunction(F);
StopPassTimer(FP, T);
}
- if (Changed)
+ Changed |= LocalChanged;
+ if (LocalChanged)
dumpPassInfo(FP, MODIFICATION_MSG, ON_FUNCTION_MSG, F.getName());
dumpPreservedSet(FP);
@@ -1407,6 +1411,7 @@
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
ModulePass *MP = getContainedPass(Index);
+ bool LocalChanged = false;
dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, M.getModuleIdentifier());
dumpRequiredSet(MP);
@@ -1416,11 +1421,12 @@
{
PassManagerPrettyStackEntry X(MP, M);
Timer *T = StartPassTimer(MP);
- Changed |= MP->runOnModule(M);
+ LocalChanged |= MP->runOnModule(M);
StopPassTimer(MP, T);
}
- if (Changed)
+ Changed |= LocalChanged;
+ if (LocalChanged)
dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG,
M.getModuleIdentifier());
dumpPreservedSet(MP);
From gohman at apple.com Mon Mar 1 11:41:39 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:41:39 -0000
Subject: [llvm-commits] [llvm] r97447 - /llvm/trunk/docs/LangRef.html
Message-ID: <20100301174140.13AD42A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:41:39 2010
New Revision: 97447
URL: http://llvm.org/viewvc/llvm-project?rev=97447&view=rev
Log:
Fix spelling.
Modified:
llvm/trunk/docs/LangRef.html
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=97447&r1=97446&r2=97447&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Mon Mar 1 11:41:39 2010
@@ -848,7 +848,7 @@
-
LLVM function definitions consist of the "define" keyord, an
+
LLVM function definitions consist of the "define" keyword, an
optional linkage type, an optional
visibility style, an optional
calling convention, a return type, an optional
@@ -4104,11 +4104,11 @@
The optional !nontemporal metadata must reference a single
metatadata name <index> corresponding to a metadata node with
- one i32 entry of value 1. The existance of
+ one i32 entry of value 1. The existence of
the !nontemporal metatadata on the instruction tells the optimizer
and code generator that this load is not expected to be reused in the cache.
The code generator may select special instructions to save cache bandwidth,
- such as the MOVNT intruction on x86.
+ such as the
MOVNT instruction on x86.
Semantics:
The location of memory pointed to is loaded. If the value being loaded is of
@@ -4164,11 +4164,11 @@
The optional !nontemporal metadata must reference a single metatadata
name corresponding to a metadata node with one i32 entry of
- value 1. The existance of the !nontemporal metatadata on the
+ value 1. The existence of the !nontemporal metatadata on the
instruction tells the optimizer and code generator that this load is
not expected to be reused in the cache. The code generator may
select special instructions to save cache bandwidth, such as the
- MOVNT intruction on x86.
+ MOVNT instruction on x86.
Semantics:
@@ -4964,7 +4964,7 @@
op1 is equal to
op2.
ogt: yields true if both operands are not a QNAN and
- op1 is greather than op2.
+
op1 is greater than
op2.
oge: yields true if both operands are not a QNAN and
op1 is greater than or equal to op2.
@@ -5209,7 +5209,7 @@
standard C99 library as being the C99 library functions, and may perform
optimizations or generate code for them under that assumption. This is
something we'd like to change in the future to provide better support for
-freestanding environments and non-C-based langauges.
+freestanding environments and non-C-based languages.
@@ -5765,7 +5765,7 @@
Semantics:
This intrinsic does not modify the behavior of the program. Backends that do
- not support this intrinisic may ignore it.
+ not support this intrinsic may ignore it.
@@ -5845,7 +5845,7 @@
number of bytes to copy, and the fourth argument is the alignment of the
source and destination locations.
-If the call to this intrinisic has an alignment value that is not 0 or 1,
+
If the call to this intrinsic has an alignment value that is not 0 or 1,
then the caller guarantees that both the source and destination pointers are
aligned to that boundary.
@@ -5895,7 +5895,7 @@
number of bytes to copy, and the fourth argument is the alignment of the
source and destination locations.
-If the call to this intrinisic has an alignment value that is not 0 or 1,
+
If the call to this intrinsic has an alignment value that is not 0 or 1,
then the caller guarantees that the source and destination pointers are
aligned to that boundary.
@@ -5943,7 +5943,7 @@
specifying the number of bytes to fill, and the fourth argument is the known
alignment of destination location.
-If the call to this intrinisic has an alignment value that is not 0 or 1,
+
If the call to this intrinsic has an alignment value that is not 0 or 1,
then the caller guarantees that the destination pointer is aligned to that
boundary.
@@ -6714,7 +6714,7 @@
Arguments:
The llvm.memory.barrier intrinsic requires five boolean arguments.
The first four arguments enables a specific barrier as listed below. The
- fith argument specifies that the barrier applies to io or device or uncached
+ fifth argument specifies that the barrier applies to io or device or uncached
memory.
From gohman at apple.com Mon Mar 1 11:42:17 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:42:17 -0000
Subject: [llvm-commits] [llvm] r97448 -
/llvm/trunk/lib/Transforms/Hello/Hello.cpp
Message-ID: <20100301174217.3CB862A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:42:17 2010
New Revision: 97448
URL: http://llvm.org/viewvc/llvm-project?rev=97448&view=rev
Log:
Prune #includes.
Modified:
llvm/trunk/lib/Transforms/Hello/Hello.cpp
Modified: llvm/trunk/lib/Transforms/Hello/Hello.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Hello/Hello.cpp?rev=97448&r1=97447&r2=97448&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Hello/Hello.cpp (original)
+++ llvm/trunk/lib/Transforms/Hello/Hello.cpp Mon Mar 1 11:42:17 2010
@@ -15,7 +15,6 @@
#define DEBUG_TYPE "hello"
#include "llvm/Pass.h"
#include "llvm/Function.h"
-#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/Statistic.h"
using namespace llvm;
From gohman at apple.com Mon Mar 1 11:43:58 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:43:58 -0000
Subject: [llvm-commits] [llvm] r97450 - /llvm/trunk/lib/Target/X86/README.txt
Message-ID: <20100301174358.099852A6C12D@llvm.org>
Author: djg
Date: Mon Mar 1 11:43:57 2010
New Revision: 97450
URL: http://llvm.org/viewvc/llvm-project?rev=97450&view=rev
Log:
This is now done.
Modified:
llvm/trunk/lib/Target/X86/README.txt
Modified: llvm/trunk/lib/Target/X86/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=97450&r1=97449&r2=97450&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/README.txt (original)
+++ llvm/trunk/lib/Target/X86/README.txt Mon Mar 1 11:43:57 2010
@@ -227,11 +227,6 @@
//===---------------------------------------------------------------------===//
-Teach the coalescer to coalesce vregs of different register classes. e.g. FR32 /
-FR64 to VR128.
-
-//===---------------------------------------------------------------------===//
-
Adding to the list of cmp / test poor codegen issues:
int test(__m128 *A, __m128 *B) {
From gohman at apple.com Mon Mar 1 11:45:15 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:45:15 -0000
Subject: [llvm-commits] [llvm] r97451 -
/llvm/trunk/include/llvm/Target/TargetOpcodes.h
Message-ID: <20100301174515.E2CAE2A6C12D@llvm.org>
Author: djg
Date: Mon Mar 1 11:45:15 2010
New Revision: 97451
URL: http://llvm.org/viewvc/llvm-project?rev=97451&view=rev
Log:
Use Doxygen comment syntax.
Modified:
llvm/trunk/include/llvm/Target/TargetOpcodes.h
Modified: llvm/trunk/include/llvm/Target/TargetOpcodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOpcodes.h?rev=97451&r1=97450&r2=97451&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetOpcodes.h (original)
+++ llvm/trunk/include/llvm/Target/TargetOpcodes.h Mon Mar 1 11:45:15 2010
@@ -16,7 +16,7 @@
namespace llvm {
-// Invariant opcodes: All instruction sets have these as their low opcodes.
+/// Invariant opcodes: All instruction sets have these as their low opcodes.
namespace TargetOpcode {
enum {
PHI = 0,
@@ -63,7 +63,7 @@
/// the copy are emitted with the TargetInstrInfo::copyRegToReg hook.
COPY_TO_REGCLASS = 10,
- // DBG_VALUE - a mapping of the llvm.dbg.value intrinsic
+ /// DBG_VALUE - a mapping of the llvm.dbg.value intrinsic
DBG_VALUE = 11
};
} // end namespace TargetOpcode
From gohman at apple.com Mon Mar 1 11:42:55 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:42:55 -0000
Subject: [llvm-commits] [llvm] r97449 -
/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp
Message-ID: <20100301174255.DE59D2A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:42:55 2010
New Revision: 97449
URL: http://llvm.org/viewvc/llvm-project?rev=97449&view=rev
Log:
Fix a missing newline in debug output.
Modified:
llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp
Modified: llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp?rev=97449&r1=97448&r2=97449&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp (original)
+++ llvm/trunk/lib/Analysis/AliasAnalysisCounter.cpp Mon Mar 1 11:42:55 2010
@@ -162,7 +162,7 @@
errs() << MRString << ": Ptr: ";
errs() << "[" << Size << "B] ";
WriteAsOperand(errs(), P, true, M);
- errs() << "\t<->" << *CS.getInstruction();
+ errs() << "\t<->" << *CS.getInstruction() << '\n';
}
return R;
}
From gohman at apple.com Mon Mar 1 11:47:21 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:47:21 -0000
Subject: [llvm-commits] [llvm] r97452 -
/llvm/trunk/include/llvm/Analysis/Dominators.h
Message-ID: <20100301174721.8C37D2A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:47:21 2010
New Revision: 97452
URL: http://llvm.org/viewvc/llvm-project?rev=97452&view=rev
Log:
Whitespace cleanups.
Modified:
llvm/trunk/include/llvm/Analysis/Dominators.h
Modified: llvm/trunk/include/llvm/Analysis/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Dominators.h?rev=97452&r1=97451&r2=97452&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/Dominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/Dominators.h Mon Mar 1 11:47:21 2010
@@ -52,7 +52,7 @@
Roots(), IsPostDominators(isPostDom) {}
public:
- /// getRoots - Return the root blocks of the current CFG. This may include
+ /// getRoots - Return the root blocks of the current CFG. This may include
/// multiple blocks if we are computing post dominators. For forward
/// dominators, this will always be a single block (the entry node).
///
@@ -225,7 +225,7 @@
DenseMap Info;
void reset() {
- for (typename DomTreeNodeMapType::iterator I = this->DomTreeNodes.begin(),
+ for (typename DomTreeNodeMapType::iterator I = this->DomTreeNodes.begin(),
E = DomTreeNodes.end(); I != E; ++I)
delete I->second;
DomTreeNodes.clear();
@@ -248,7 +248,7 @@
for (typename GraphTraits >::ChildIteratorType PI =
GraphTraits >::child_begin(NewBB),
PE = GraphTraits >::child_end(NewBB); PI != PE; ++PI)
- PredBlocks.push_back(*PI);
+ PredBlocks.push_back(*PI);
assert(!PredBlocks.empty() && "No predblocks??");
@@ -310,7 +310,7 @@
if (DomTreeNodes.size() != OtherDomTreeNodes.size())
return true;
- for (typename DomTreeNodeMapType::const_iterator
+ for (typename DomTreeNodeMapType::const_iterator
I = this->DomTreeNodes.begin(),
E = this->DomTreeNodes.end(); I != E; ++I) {
NodeT *BB = I->first;
@@ -361,7 +361,7 @@
return properlyDominates(getNode(A), getNode(B));
}
- bool dominatedBySlowTreeWalk(const DomTreeNodeBase *A,
+ bool dominatedBySlowTreeWalk(const DomTreeNodeBase *A,
const DomTreeNodeBase *B) const {
const DomTreeNodeBase *IDom;
if (A == 0 || B == 0) return false;
@@ -374,7 +374,7 @@
/// isReachableFromEntry - Return true if A is dominated by the entry
/// block of the function containing it.
bool isReachableFromEntry(NodeT* A) {
- assert (!this->isPostDominator()
+ assert (!this->isPostDominator()
&& "This is not implemented for post dominators");
return dominates(&A->getParent()->front(), A);
}
@@ -384,7 +384,7 @@
///
inline bool dominates(const DomTreeNodeBase *A,
const DomTreeNodeBase *B) {
- if (B == A)
+ if (B == A)
return true; // A node trivially dominates itself.
if (A == 0 || B == 0)
@@ -412,7 +412,7 @@
}
inline bool dominates(const NodeT *A, const NodeT *B) {
- if (A == B)
+ if (A == B)
return true;
// Cast away the const qualifiers here. This is ok since
@@ -431,9 +431,9 @@
/// for basic block A and B. If there is no such block then return NULL.
NodeT *findNearestCommonDominator(NodeT *A, NodeT *B) {
- assert (!this->isPostDominator()
+ assert (!this->isPostDominator()
&& "This is not implemented for post dominators");
- assert (A->getParent() == B->getParent()
+ assert (A->getParent() == B->getParent()
&& "Two blocks are not in same function");
// If either A or B is a entry block then it is nearest common dominator.
@@ -478,14 +478,14 @@
// the CFG...
/// addNewBlock - Add a new node to the dominator tree information. This
- /// creates a new node as a child of DomBB dominator node,linking it into
+ /// creates a new node as a child of DomBB dominator node,linking it into
/// the children list of the immediate dominator.
DomTreeNodeBase *addNewBlock(NodeT *BB, NodeT *DomBB) {
assert(getNode(BB) == 0 && "Block already in dominator tree!");
DomTreeNodeBase *IDomNode = getNode(DomBB);
assert(IDomNode && "Not immediate dominator specified for block!");
DFSInfoValid = false;
- return DomTreeNodes[BB] =
+ return DomTreeNodes[BB] =
IDomNode->addChild(new DomTreeNodeBase(BB, IDomNode));
}
@@ -503,7 +503,7 @@
changeImmediateDominator(getNode(BB), getNode(NewBB));
}
- /// eraseNode - Removes a node from the dominator tree. Block must not
+ /// eraseNode - Removes a node from the dominator tree. Block must not
/// domiante any other blocks. Removes node from its immediate dominator's
/// children list. Deletes dominator node associated with basic block BB.
void eraseNode(NodeT *BB) {
@@ -708,7 +708,7 @@
DominatorTreeBase& getBase() { return *DT; }
- /// getRoots - Return the root blocks of the current CFG. This may include
+ /// getRoots - Return the root blocks of the current CFG. This may include
/// multiple blocks if we are computing post dominators. For forward
/// dominators, this will always be a single block (the entry node).
///
@@ -785,7 +785,7 @@
}
/// addNewBlock - Add a new node to the dominator tree information. This
- /// creates a new node as a child of DomBB dominator node,linking it into
+ /// creates a new node as a child of DomBB dominator node,linking it into
/// the children list of the immediate dominator.
inline DomTreeNode *addNewBlock(BasicBlock *BB, BasicBlock *DomBB) {
return DT->addNewBlock(BB, DomBB);
@@ -802,7 +802,7 @@
DT->changeImmediateDominator(N, NewIDom);
}
- /// eraseNode - Removes a node from the dominator tree. Block must not
+ /// eraseNode - Removes a node from the dominator tree. Block must not
/// domiante any other blocks. Removes node from its immediate dominator's
/// children list. Deletes dominator node associated with basic block BB.
inline void eraseNode(BasicBlock *BB) {
@@ -820,7 +820,7 @@
}
- virtual void releaseMemory() {
+ virtual void releaseMemory() {
DT->releaseMemory();
}
@@ -886,10 +886,10 @@
const bool IsPostDominators;
public:
- DominanceFrontierBase(void *ID, bool isPostDom)
+ DominanceFrontierBase(void *ID, bool isPostDom)
: FunctionPass(ID), IsPostDominators(isPostDom) {}
- /// getRoots - Return the root blocks of the current CFG. This may include
+ /// getRoots - Return the root blocks of the current CFG. This may include
/// multiple blocks if we are computing post dominators. For forward
/// dominators, this will always be a single block (the entry node).
///
@@ -940,7 +940,7 @@
bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const {
std::set tmpSet;
for (DomSetType::const_iterator I = DS2.begin(),
- E = DS2.end(); I != E; ++I)
+ E = DS2.end(); I != E; ++I)
tmpSet.insert(*I);
for (DomSetType::const_iterator I = DS1.begin(),
@@ -965,14 +965,14 @@
bool compare(DominanceFrontierBase &Other) const {
DomSetMapType tmpFrontiers;
for (DomSetMapType::const_iterator I = Other.begin(),
- E = Other.end(); I != E; ++I)
+ E = Other.end(); I != E; ++I)
tmpFrontiers.insert(std::make_pair(I->first, I->second));
for (DomSetMapType::iterator I = tmpFrontiers.begin(),
E = tmpFrontiers.end(); I != E; ) {
BasicBlock *Node = I->first;
const_iterator DFI = find(Node);
- if (DFI == end())
+ if (DFI == end())
return true;
if (compareDomSet(I->second, DFI->second))
@@ -1001,7 +1001,7 @@
class DominanceFrontier : public DominanceFrontierBase {
public:
static char ID; // Pass ID, replacement for typeid
- DominanceFrontier() :
+ DominanceFrontier() :
DominanceFrontierBase(&ID, false) {}
BasicBlock *getRoot() const {
@@ -1033,7 +1033,7 @@
/// to reflect this change.
void changeImmediateDominator(BasicBlock *BB, BasicBlock *NewBB,
DominatorTree *DT) {
- // NewBB is now dominating BB. Which means BB's dominance
+ // NewBB is now dominating BB. Which means BB's dominance
// frontier is now part of NewBB's dominance frontier. However, BB
// itself is not member of NewBB's dominance frontier.
DominanceFrontier::iterator NewDFI = find(NewBB);
From gohman at apple.com Mon Mar 1 11:49:52 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:49:52 -0000
Subject: [llvm-commits] [llvm] r97453 - in /llvm/trunk:
include/llvm/Analysis/IVUsers.h include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/IVUsers.cpp lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ScalarEvolutionExpander.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
Message-ID: <20100301174952.2534F2A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:49:51 2010
New Revision: 97453
URL: http://llvm.org/viewvc/llvm-project?rev=97453&view=rev
Log:
Spelling fixes.
Modified:
llvm/trunk/include/llvm/Analysis/IVUsers.h
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/lib/Analysis/IVUsers.cpp
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/include/llvm/Analysis/IVUsers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IVUsers.h?rev=97453&r1=97452&r2=97453&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/IVUsers.h (original)
+++ llvm/trunk/include/llvm/Analysis/IVUsers.h Mon Mar 1 11:49:51 2010
@@ -61,7 +61,7 @@
Stride = Val;
}
- /// getOffset - Return the offset to add to a theoeretical induction
+ /// getOffset - Return the offset to add to a theoretical induction
/// variable that starts at zero and counts up by the stride to compute
/// the value for the use. This always has the same type as the stride.
const SCEV *getOffset() const { return Offset; }
@@ -116,7 +116,7 @@
bool IsUseOfPostIncrementedValue;
/// Deleted - Implementation of CallbackVH virtual function to
- /// recieve notification when the User is deleted.
+ /// receive notification when the User is deleted.
virtual void deleted();
};
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=97453&r1=97452&r2=97453&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Mon Mar 1 11:49:51 2010
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// The ScalarEvolution class is an LLVM pass which can be used to analyze and
-// catagorize scalar expressions in loops. It specializes in recognizing
+// categorize scalar expressions in loops. It specializes in recognizing
// general induction variables, representing them with the abstract and opaque
// SCEV class. Given this analysis, trip counts of loops and other important
// properties can be obtained.
@@ -55,7 +55,7 @@
protected:
/// SubclassData - This field is initialized to zero and may be used in
- /// subclasses to store miscelaneous information.
+ /// subclasses to store miscellaneous information.
unsigned short SubclassData;
private:
@@ -177,7 +177,7 @@
///
LoopInfo *LI;
- /// TD - The target data information for the target we are targetting.
+ /// TD - The target data information for the target we are targeting.
///
TargetData *TD;
@@ -194,7 +194,7 @@
std::map Scalars;
/// BackedgeTakenInfo - Information about the backedge-taken count
- /// of a loop. This currently inclues an exact count and a maximum count.
+ /// of a loop. This currently includes an exact count and a maximum count.
///
struct BackedgeTakenInfo {
/// Exact - An expression indicating the exact backedge-taken count of
@@ -353,14 +353,14 @@
bool Inverse);
/// isImpliedCondOperands - Test whether the condition described by Pred,
- /// LHS, and RHS is true whenever the condition desribed by Pred, FoundLHS,
+ /// LHS, and RHS is true whenever the condition described by Pred, FoundLHS,
/// and FoundRHS is true.
bool isImpliedCondOperands(ICmpInst::Predicate Pred,
const SCEV *LHS, const SCEV *RHS,
const SCEV *FoundLHS, const SCEV *FoundRHS);
/// isImpliedCondOperandsHelper - Test whether the condition described by
- /// Pred, LHS, and RHS is true whenever the condition desribed by Pred,
+ /// Pred, LHS, and RHS is true whenever the condition described by Pred,
/// FoundLHS, and FoundRHS is true.
bool isImpliedCondOperandsHelper(ICmpInst::Predicate Pred,
const SCEV *LHS, const SCEV *RHS,
Modified: llvm/trunk/lib/Analysis/IVUsers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=97453&r1=97452&r2=97453&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IVUsers.cpp (original)
+++ llvm/trunk/lib/Analysis/IVUsers.cpp Mon Mar 1 11:49:51 2010
@@ -222,7 +222,7 @@
// Descend recursively, but not into PHI nodes outside the current loop.
// It's important to see the entire expression outside the loop to get
// choices that depend on addressing mode use right, although we won't
- // consider references ouside the loop in all cases.
+ // consider references outside the loop in all cases.
// If User is already in Processed, we don't want to recurse into it again,
// but do want to record a second reference in the same instruction.
bool AddUserToIVUsers = false;
@@ -330,7 +330,7 @@
}
OS << ":\n";
- // Use a defualt AssemblyAnnotationWriter to suppress the default info
+ // Use a default AssemblyAnnotationWriter to suppress the default info
// comments, which aren't relevant here.
AssemblyAnnotationWriter Annotator;
for (ilist::const_iterator UI = IVUses.begin(),
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=97453&r1=97452&r2=97453&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Mar 1 11:49:51 2010
@@ -616,7 +616,7 @@
/// When this routine is finished, we know that any duplicates in the vector are
/// consecutive and that complexity is monotonically increasing.
///
-/// Note that we go take special precautions to ensure that we get determinstic
+/// Note that we go take special precautions to ensure that we get deterministic
/// results from this routine. In other words, we don't want the results of
/// this to depend on where the addresses of various SCEV objects happened to
/// land in memory.
@@ -744,7 +744,7 @@
// We need at least W + T bits for the multiplication step
unsigned CalculationBits = W + T;
- // Calcuate 2^T, at width T+W.
+ // Calculate 2^T, at width T+W.
APInt DivFactor = APInt(CalculationBits, 1).shl(T);
// Calculate the multiplicative inverse of K! / 2^T;
@@ -1410,7 +1410,7 @@
// If we deleted at least one add, we added operands to the end of the list,
// and they are not necessarily sorted. Recurse to resort and resimplify
- // any operands we just aquired.
+ // any operands we just acquired.
if (DeletedAdd)
return getAddExpr(Ops);
}
@@ -1717,7 +1717,7 @@
// If we deleted at least one mul, we added operands to the end of the list,
// and they are not necessarily sorted. Recurse to resort and resimplify
- // any operands we just aquired.
+ // any operands we just acquired.
if (DeletedMul)
return getMulExpr(Ops);
}
@@ -2746,7 +2746,7 @@
} else {
// For an array, add the element offset, explicitly scaled.
const SCEV *LocalOffset = getSCEV(Index);
- // Getelementptr indicies are signed.
+ // Getelementptr indices are signed.
LocalOffset = getTruncateOrSignExtend(LocalOffset, IntPtrTy);
// Lower "inbounds" GEPs to NSW arithmetic.
LocalOffset = getMulExpr(LocalOffset, getSizeOfExpr(*GTI),
@@ -3220,7 +3220,7 @@
const Type *Z0Ty = Z0->getType();
unsigned Z0TySize = getTypeSizeInBits(Z0Ty);
- // If C is a low-bits mask, the zero extend is zerving to
+ // If C is a low-bits mask, the zero extend is serving to
// mask off the high bits. Complement the operand and
// re-apply the zext.
if (APIntOps::isMask(Z0TySize, CI->getValue()))
@@ -3405,7 +3405,7 @@
const ScalarEvolution::BackedgeTakenInfo &
ScalarEvolution::getBackedgeTakenInfo(const Loop *L) {
// Initially insert a CouldNotCompute for this loop. If the insertion
- // succeeds, procede to actually compute a backedge-taken count and
+ // succeeds, proceed to actually compute a backedge-taken count and
// update the value. The temporary CouldNotCompute value tells SCEV
// code elsewhere that it shouldn't attempt to request a new
// backedge-taken count, which could result in infinite recursion.
@@ -3622,7 +3622,7 @@
return getCouldNotCompute();
}
- // Procede to the next level to examine the exit condition expression.
+ // Proceed to the next level to examine the exit condition expression.
return ComputeBackedgeTakenCountFromExitCond(L, ExitBr->getCondition(),
ExitBr->getSuccessor(0),
ExitBr->getSuccessor(1));
@@ -3711,7 +3711,7 @@
}
// With an icmp, it may be feasible to compute an exact backedge-taken count.
- // Procede to the next level to examine the icmp.
+ // Proceed to the next level to examine the icmp.
if (ICmpInst *ExitCondICmp = dyn_cast(ExitCond))
return ComputeBackedgeTakenCountFromExitCondICmp(L, ExitCondICmp, TBB, FBB);
@@ -4780,7 +4780,7 @@
ICmpInst::Predicate Pred,
const SCEV *LHS, const SCEV *RHS,
bool Inverse) {
- // Recursivly handle And and Or conditions.
+ // Recursively handle And and Or conditions.
if (BinaryOperator *BO = dyn_cast(CondValue)) {
if (BO->getOpcode() == Instruction::And) {
if (!Inverse)
@@ -4983,7 +4983,7 @@
}
/// isImpliedCondOperands - Test whether the condition described by Pred,
-/// LHS, and RHS is true whenever the condition desribed by Pred, FoundLHS,
+/// LHS, and RHS is true whenever the condition described by Pred, FoundLHS,
/// and FoundRHS is true.
bool ScalarEvolution::isImpliedCondOperands(ICmpInst::Predicate Pred,
const SCEV *LHS, const SCEV *RHS,
@@ -4998,7 +4998,7 @@
}
/// isImpliedCondOperandsHelper - Test whether the condition described by
-/// Pred, LHS, and RHS is true whenever the condition desribed by Pred,
+/// Pred, LHS, and RHS is true whenever the condition described by Pred,
/// FoundLHS, and FoundRHS is true.
bool
ScalarEvolution::isImpliedCondOperandsHelper(ICmpInst::Predicate Pred,
@@ -5156,7 +5156,7 @@
// If MaxEnd is within a step of the maximum integer value in its type,
// adjust it down to the minimum value which would produce the same effect.
- // This allows the subsequent ceiling divison of (N+(step-1))/step to
+ // This allows the subsequent ceiling division of (N+(step-1))/step to
// compute the correct value.
const SCEV *StepMinusOne = getMinusSCEV(Step,
getIntegerSCEV(1, Step->getType()));
@@ -5433,7 +5433,7 @@
}
void ScalarEvolution::print(raw_ostream &OS, const Module *) const {
- // ScalarEvolution's implementaiton of the print method is to print
+ // ScalarEvolution's implementation of the print method is to print
// out SCEV values of all instructions that are interesting. Doing
// this potentially causes it to create new SCEV objects though,
// which technically conflicts with the const qualifier. This isn't
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=97453&r1=97452&r2=97453&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Mon Mar 1 11:49:51 2010
@@ -152,7 +152,7 @@
/// FactorOutConstant - Test if S is divisible by Factor, using signed
/// division. If so, update S with Factor divided out and return true.
-/// S need not be evenly divisble if a reasonable remainder can be
+/// S need not be evenly divisible if a reasonable remainder can be
/// computed.
/// TODO: When ScalarEvolution gets a SCEVSDivExpr, this can be made
/// unnecessary; in its place, just signed-divide Ops[i] by the scale and
@@ -462,7 +462,7 @@
break;
}
- // If none of the operands were convertable to proper GEP indices, cast
+ // If none of the operands were convertible to proper GEP indices, cast
// the base to i8* and do an ugly getelementptr with that. It's still
// better than ptrtoint+arithmetic+inttoptr at least.
if (!AnyNonZeroIndices) {
@@ -820,7 +820,7 @@
const Type *ExpandTy = PostLoopScale ? IntTy : STy;
PHINode *PN = getAddRecExprPHILiterally(Normalized, L, ExpandTy, IntTy);
- // Accomodate post-inc mode, if necessary.
+ // Accommodate post-inc mode, if necessary.
Value *Result;
if (L != PostIncLoop)
Result = PN;
@@ -1131,7 +1131,7 @@
}
void SCEVExpander::restoreInsertPoint(BasicBlock *BB, BasicBlock::iterator I) {
- // If we aquired more instructions since the old insert point was saved,
+ // If we acquired more instructions since the old insert point was saved,
// advance past them.
while (isInsertedInstruction(I)) ++I;
Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=97453&r1=97452&r2=97453&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Mon Mar 1 11:49:51 2010
@@ -594,8 +594,8 @@
}
}
-/// Return true if it is OK to use SIToFPInst for an inducation variable
-/// with given inital and exit values.
+/// Return true if it is OK to use SIToFPInst for an induction variable
+/// with given initial and exit values.
static bool useSIToFPInst(ConstantFP &InitV, ConstantFP &ExitV,
uint64_t intIV, uint64_t intEV) {
@@ -648,7 +648,7 @@
if (!convertToInt(InitValue->getValueAPF(), &newInitValue))
return;
- // Check IV increment. Reject this PH if increement operation is not
+ // Check IV increment. Reject this PH if increment operation is not
// an add or increment value can not be represented by an integer.
BinaryOperator *Incr =
dyn_cast(PH->getIncomingValue(BackEdge));
@@ -684,7 +684,7 @@
if (BI->getCondition() != EC) return;
}
- // Find exit value. If exit value can not be represented as an interger then
+ // Find exit value. If exit value can not be represented as an integer then
// do not handle this floating point PH.
ConstantFP *EV = NULL;
unsigned EVIndex = 1;
@@ -746,11 +746,11 @@
ICmpInst *NewEC = new ICmpInst(EC->getParent()->getTerminator(),
NewPred, LHS, RHS, EC->getName());
- // In the following deltions, PH may become dead and may be deleted.
+ // In the following deletions, PH may become dead and may be deleted.
// Use a WeakVH to observe whether this happens.
WeakVH WeakPH = PH;
- // Delete old, floating point, exit comparision instruction.
+ // Delete old, floating point, exit comparison instruction.
NewEC->takeName(EC);
EC->replaceAllUsesWith(NewEC);
RecursivelyDeleteTriviallyDeadInstructions(EC);
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=97453&r1=97452&r2=97453&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Mar 1 11:49:51 2010
@@ -198,7 +198,7 @@
}
-/// DoInitialMatch - Recurrsion helper for InitialMatch.
+/// DoInitialMatch - Recursion helper for InitialMatch.
static void DoInitialMatch(const SCEV *S, Loop *L,
SmallVectorImpl &Good,
SmallVectorImpl &Bad,
@@ -1246,7 +1246,7 @@
}
/// OptimizeShadowIV - If IV is used in a int-to-float cast
-/// inside the loop then try to eliminate the cast opeation.
+/// inside the loop then try to eliminate the cast operation.
void LSRInstance::OptimizeShadowIV() {
const SCEV *BackedgeTakenCount = SE.getBackedgeTakenCount(L);
if (isa(BackedgeTakenCount))
@@ -1673,7 +1673,7 @@
/// getUse - Return an LSRUse index and an offset value for a fixup which
/// needs the given expression, with the given kind and optional access type.
-/// Either reuse an exisitng use or create a new one, as needed.
+/// Either reuse an existing use or create a new one, as needed.
std::pair
LSRInstance::getUse(const SCEV *&Expr,
LSRUse::KindType Kind, const Type *AccessTy) {
@@ -2035,7 +2035,7 @@
/// loop-dominating registers added into a single register.
void LSRInstance::GenerateCombinations(LSRUse &LU, unsigned LUIdx,
Formula Base) {
- // This method is only intersting on a plurality of registers.
+ // This method is only interesting on a plurality of registers.
if (Base.BaseRegs.size() <= 1) return;
Formula F = Base;
@@ -2054,7 +2054,7 @@
const SCEV *Sum = SE.getAddExpr(Ops);
// TODO: If Sum is zero, it probably means ScalarEvolution missed an
// opportunity to fold something. For now, just ignore such cases
- // rather than procede with zero in a register.
+ // rather than proceed with zero in a register.
if (!Sum->isZero()) {
F.BaseRegs.push_back(Sum);
(void)InsertFormula(LU, LUIdx, F);
@@ -2401,7 +2401,7 @@
const SCEV *NegImmS = SE.getSCEV(ConstantInt::get(IntTy, -(uint64_t)Imm));
unsigned BitWidth = SE.getTypeSizeInBits(IntTy);
- // TODO: Use a more targetted data structure.
+ // TODO: Use a more targeted data structure.
for (size_t L = 0, LE = LU.Formulae.size(); L != LE; ++L) {
Formula F = LU.Formulae[L];
// Use the immediate in the scaled register.
@@ -2569,9 +2569,9 @@
});
}
-/// NarrowSearchSpaceUsingHeuristics - If there are an extrordinary number of
+/// NarrowSearchSpaceUsingHeuristics - If there are an extraordinary number of
/// formulae to choose from, use some rough heuristics to prune down the number
-/// of formulae. This keeps the main solver from taking an extrordinary amount
+/// of formulae. This keeps the main solver from taking an extraordinary amount
/// of time in some worst-case scenarios.
void LSRInstance::NarrowSearchSpaceUsingHeuristics() {
// This is a rough guess that seems to work fairly well.
@@ -2621,7 +2621,7 @@
}
DEBUG(dbgs() << "Narrowing the search space by assuming " << *Best
- << " will yeild profitable reuse.\n");
+ << " will yield profitable reuse.\n");
Taken.insert(Best);
// In any use with formulae which references this register, delete formulae
@@ -2668,7 +2668,7 @@
// - sort the formula so that the most profitable solutions are found first
// - sort the uses too
// - search faster:
- // - dont compute a cost, and then compare. compare while computing a cost
+ // - don't compute a cost, and then compare. compare while computing a cost
// and bail early.
// - track register sets with SmallBitVector
@@ -3104,7 +3104,7 @@
dbgs() << ":\n");
/// OptimizeShadowIV - If IV is used in a int-to-float cast
- /// inside the loop then try to eliminate the cast opeation.
+ /// inside the loop then try to eliminate the cast operation.
OptimizeShadowIV();
// Change loop terminating condition to use the postinc iv when possible.
From gohman at apple.com Mon Mar 1 11:52:16 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:52:16 -0000
Subject: [llvm-commits] [llvm] r97455 - in /llvm/trunk:
lib/Target/PIC16/AsmPrinter/ runtime/libprofile/ unittests/ExecutionEngine/
unittests/ExecutionEngine/JIT/ unittests/Support/ unittests/VMCore/
Message-ID: <20100301175216.EB1132A6C12D@llvm.org>
Author: djg
Date: Mon Mar 1 11:52:16 2010
New Revision: 97455
URL: http://llvm.org/viewvc/llvm-project?rev=97455&view=rev
Log:
svn:ignore fixes.
Modified:
llvm/trunk/lib/Target/PIC16/AsmPrinter/ (props changed)
llvm/trunk/runtime/libprofile/ (props changed)
llvm/trunk/unittests/ExecutionEngine/ (props changed)
llvm/trunk/unittests/ExecutionEngine/JIT/ (props changed)
llvm/trunk/unittests/Support/ (props changed)
llvm/trunk/unittests/VMCore/ (props changed)
Propchange: llvm/trunk/lib/Target/PIC16/AsmPrinter/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Mar 1 11:52:16 2010
@@ -1,3 +1,7 @@
Debug
-Release-Asserts
Release
+Release-Asserts
+Debug+Coverage-Asserts
+Debug+Coverage
+Release+Coverage
+Debug+Checks
Propchange: llvm/trunk/runtime/libprofile/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Mar 1 11:52:16 2010
@@ -1,3 +1,7 @@
Debug
-Release-Asserts
Release
+Release-Asserts
+Debug+Coverage-Asserts
+Debug+Coverage
+Release+Coverage
+Debug+Checks
Propchange: llvm/trunk/unittests/ExecutionEngine/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Mar 1 11:52:16 2010
@@ -1,3 +1,7 @@
Debug
Release
Release-Asserts
+Debug+Coverage-Asserts
+Debug+Coverage
+Release+Coverage
+Debug+Checks
Propchange: llvm/trunk/unittests/ExecutionEngine/JIT/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Mar 1 11:52:16 2010
@@ -1,3 +1,7 @@
Debug
Release
Release-Asserts
+Debug+Coverage-Asserts
+Debug+Coverage
+Release+Coverage
+Debug+Checks
Propchange: llvm/trunk/unittests/Support/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Mar 1 11:52:16 2010
@@ -1,4 +1,7 @@
Debug
Release
Release-Asserts
-
+Debug+Coverage-Asserts
+Debug+Coverage
+Release+Coverage
+Debug+Checks
Propchange: llvm/trunk/unittests/VMCore/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Mar 1 11:52:16 2010
@@ -1,3 +1,7 @@
Debug
Release
Release-Asserts
+Debug+Coverage-Asserts
+Debug+Coverage
+Release+Coverage
+Debug+Checks
From gohman at apple.com Mon Mar 1 11:53:15 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:53:15 -0000
Subject: [llvm-commits] [llvm] r97456 -
/llvm/trunk/test/Transforms/InstCombine/objsize.ll
Message-ID: <20100301175315.AFB9E2A6C12D@llvm.org>
Author: djg
Date: Mon Mar 1 11:53:15 2010
New Revision: 97456
URL: http://llvm.org/viewvc/llvm-project?rev=97456&view=rev
Log:
LLVM instruction syntax doesn't have trailing semicolons.
Modified:
llvm/trunk/test/Transforms/InstCombine/objsize.ll
Modified: llvm/trunk/test/Transforms/InstCombine/objsize.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/objsize.ll?rev=97456&r1=97455&r2=97456&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/objsize.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/objsize.ll Mon Mar 1 11:53:15 2010
@@ -23,12 +23,12 @@
br i1 %cmp, label %cond.true, label %cond.false
cond.true:
- %1 = load i8** %retval;
- ret i8* %1;
+ %1 = load i8** %retval
+ ret i8* %1
cond.false:
- %2 = load i8** %retval;
- ret i8* %2;
+ %2 = load i8** %retval
+ ret i8* %2
}
define i32 @f() nounwind {
@@ -64,7 +64,7 @@
}
@.str5 = private constant [9 x i32] [i32 97, i32 98, i32 99, i32 100, i32 0, i32
- 101, i32 102, i32 103, i32 0], align 4 ;
+ 101, i32 102, i32 103, i32 0], align 4
define i32 @test2() nounwind {
; CHECK: @test2
; CHECK-NEXT: ret i32 34
From gohman at apple.com Mon Mar 1 11:53:39 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:53:39 -0000
Subject: [llvm-commits] [llvm] r97457 - /llvm/trunk/utils/llvm.grm
Message-ID: <20100301175339.B888C2A6C12D@llvm.org>
Author: djg
Date: Mon Mar 1 11:53:39 2010
New Revision: 97457
URL: http://llvm.org/viewvc/llvm-project?rev=97457&view=rev
Log:
Add the alignstack keyword.
Modified:
llvm/trunk/utils/llvm.grm
Modified: llvm/trunk/utils/llvm.grm
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm.grm?rev=97457&r1=97456&r2=97457&view=diff
==============================================================================
--- llvm/trunk/utils/llvm.grm (original)
+++ llvm/trunk/utils/llvm.grm Mon Mar 1 11:53:39 2010
@@ -162,6 +162,7 @@
| readnone
| readonly
| inlinehint
+ | alignstack
| noinline
| alwaysinline
| optsize
From gohman at apple.com Mon Mar 1 11:55:27 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:55:27 -0000
Subject: [llvm-commits] [llvm] r97458 -
/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
Message-ID: <20100301175527.D05802A6C12D@llvm.org>
Author: djg
Date: Mon Mar 1 11:55:27 2010
New Revision: 97458
URL: http://llvm.org/viewvc/llvm-project?rev=97458&view=rev
Log:
Add some debug output to LoopSimplify.
Modified:
llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp?rev=97458&r1=97457&r2=97458&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopSimplify.cpp Mon Mar 1 11:55:27 2010
@@ -51,6 +51,7 @@
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Support/CFG.h"
+#include "llvm/Support/Debug.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
@@ -147,6 +148,11 @@
// Delete each unique out-of-loop (and thus dead) predecessor.
for (SmallPtrSet::iterator I = BadPreds.begin(),
E = BadPreds.end(); I != E; ++I) {
+
+ DEBUG(dbgs() << "LoopSimplify: Deleting edge from dead predecessor ";
+ WriteAsOperand(dbgs(), *I, false);
+ dbgs() << "\n");
+
// Inform each successor of each dead pred.
for (succ_iterator SI = succ_begin(*I), SE = succ_end(*I); SI != SE; ++SI)
(*SI)->removePredecessor(*I);
@@ -169,6 +175,11 @@
if (BranchInst *BI = dyn_cast((*I)->getTerminator()))
if (BI->isConditional()) {
if (UndefValue *Cond = dyn_cast(BI->getCondition())) {
+
+ DEBUG(dbgs() << "LoopSimplify: Resolving \"br i1 undef\" to exit in ";
+ WriteAsOperand(dbgs(), *I, false);
+ dbgs() << "\n");
+
BI->setCondition(ConstantInt::get(Cond->getType(),
!L->contains(BI->getSuccessor(0))));
Changed = true;
@@ -296,6 +307,11 @@
// Success. The block is now dead, so remove it from the loop,
// update the dominator tree and dominance frontier, and delete it.
+
+ DEBUG(dbgs() << "LoopSimplify: Eliminating exiting block ";
+ WriteAsOperand(dbgs(), ExitingBlock, false);
+ dbgs() << "\n");
+
assert(pred_begin(ExitingBlock) == pred_end(ExitingBlock));
Changed = true;
LI->removeBlock(ExitingBlock);
@@ -349,6 +365,10 @@
SplitBlockPredecessors(Header, &OutsideBlocks[0], OutsideBlocks.size(),
".preheader", this);
+ DEBUG(dbgs() << "LoopSimplify: Creating pre-header ";
+ WriteAsOperand(dbgs(), NewBB, false);
+ dbgs() << "\n");
+
// Make sure that NewBB is put someplace intelligent, which doesn't mess up
// code layout too horribly.
PlaceSplitBlockCarefully(NewBB, OutsideBlocks, L);
@@ -374,6 +394,10 @@
LoopBlocks.size(), ".loopexit",
this);
+ DEBUG(dbgs() << "LoopSimplify: Creating dedicated exit block ";
+ WriteAsOperand(dbgs(), NewBB, false);
+ dbgs() << "\n");
+
return NewBB;
}
@@ -494,6 +518,8 @@
OuterLoopPreds.push_back(PN->getIncomingBlock(i));
}
+ DEBUG(dbgs() << "LoopSimplify: Splitting out a new outer loop\n");
+
BasicBlock *Header = L->getHeader();
BasicBlock *NewBB = SplitBlockPredecessors(Header, &OuterLoopPreds[0],
OuterLoopPreds.size(),
@@ -588,6 +614,10 @@
Header->getName()+".backedge", F);
BranchInst *BETerminator = BranchInst::Create(Header, BEBlock);
+ DEBUG(dbgs() << "LoopSimplify: Inserting unique backedge block ";
+ WriteAsOperand(dbgs(), BEBlock, false);
+ dbgs() << "\n");
+
// Move the new backedge block to right after the last backedge block.
Function::iterator InsertPos = BackedgeBlocks.back(); ++InsertPos;
F->getBasicBlockList().splice(InsertPos, F->getBasicBlockList(), BEBlock);
From gohman at apple.com Mon Mar 1 11:56:04 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:56:04 -0000
Subject: [llvm-commits] [llvm] r97459 -
/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
Message-ID: <20100301175604.30F112A6C12D@llvm.org>
Author: djg
Date: Mon Mar 1 11:56:04 2010
New Revision: 97459
URL: http://llvm.org/viewvc/llvm-project?rev=97459&view=rev
Log:
Add a comment.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp?rev=97459&r1=97458&r2=97459&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp Mon Mar 1 11:56:04 2010
@@ -10,6 +10,10 @@
// This file defines the ScalarEvolutionAliasAnalysis pass, which implements a
// simple alias analysis implemented in terms of ScalarEvolution queries.
//
+// This differs from traditional loop dependence analysis in that it tests
+// for dependencies within a single iteration of a loop, rather than
+// dependences between different iterations.
+//
// ScalarEvolution has a more complete understanding of pointer arithmetic
// than BasicAliasAnalysis' collection of ad-hoc analyses.
//
@@ -41,7 +45,7 @@
return (AliasAnalysis*)this;
return this;
}
-
+
private:
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
virtual bool runOnFunction(Function &F);
From gohman at apple.com Mon Mar 1 11:51:02 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:51:02 -0000
Subject: [llvm-commits] [llvm] r97454 -
/llvm/trunk/unittests/Support/AllocatorTest.cpp
Message-ID: <20100301175102.7F2422A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:51:02 2010
New Revision: 97454
URL: http://llvm.org/viewvc/llvm-project?rev=97454&view=rev
Log:
Spelling fixes.
Modified:
llvm/trunk/unittests/Support/AllocatorTest.cpp
Modified: llvm/trunk/unittests/Support/AllocatorTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/AllocatorTest.cpp?rev=97454&r1=97453&r2=97454&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/AllocatorTest.cpp (original)
+++ llvm/trunk/unittests/Support/AllocatorTest.cpp Mon Mar 1 11:51:02 2010
@@ -88,7 +88,7 @@
Alloc.Allocate(4096 - sizeof(MemSlab), 0);
EXPECT_EQ(1U, Alloc.GetNumSlabs());
- // If we dont't allocate a new slab, then we will have overflowed.
+ // If we don't allocate a new slab, then we will have overflowed.
Alloc.Allocate(1, 0);
EXPECT_EQ(2U, Alloc.GetNumSlabs());
}
From gohman at apple.com Mon Mar 1 11:56:46 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:56:46 -0000
Subject: [llvm-commits] [llvm] r97460 - in /llvm/trunk/lib/Target:
Sparc/SparcMachineFunctionInfo.h SystemZ/SystemZMachineFunctionInfo.h
Message-ID: <20100301175646.718572A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:56:46 2010
New Revision: 97460
URL: http://llvm.org/viewvc/llvm-project?rev=97460&view=rev
Log:
Add explicit keywords.
Modified:
llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h
llvm/trunk/lib/Target/SystemZ/SystemZMachineFunctionInfo.h
Modified: llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h?rev=97460&r1=97459&r2=97460&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h (original)
+++ llvm/trunk/lib/Target/Sparc/SparcMachineFunctionInfo.h Mon Mar 1 11:56:46 2010
@@ -22,7 +22,7 @@
unsigned GlobalBaseReg;
public:
SparcMachineFunctionInfo() : GlobalBaseReg(0) {}
- SparcMachineFunctionInfo(MachineFunction &MF) : GlobalBaseReg(0) {}
+ explicit SparcMachineFunctionInfo(MachineFunction &MF) : GlobalBaseReg(0) {}
unsigned getGlobalBaseReg() const { return GlobalBaseReg; }
void setGlobalBaseReg(unsigned Reg) { GlobalBaseReg = Reg; }
Modified: llvm/trunk/lib/Target/SystemZ/SystemZMachineFunctionInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZMachineFunctionInfo.h?rev=97460&r1=97459&r2=97460&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZMachineFunctionInfo.h (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZMachineFunctionInfo.h Mon Mar 1 11:56:46 2010
@@ -33,7 +33,8 @@
public:
SystemZMachineFunctionInfo() : CalleeSavedFrameSize(0) {}
- SystemZMachineFunctionInfo(MachineFunction &MF) : CalleeSavedFrameSize(0) {}
+ explicit SystemZMachineFunctionInfo(MachineFunction &MF)
+ : CalleeSavedFrameSize(0) {}
unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
void setCalleeSavedFrameSize(unsigned bytes) { CalleeSavedFrameSize = bytes; }
From gohman at apple.com Mon Mar 1 11:59:21 2010
From: gohman at apple.com (Dan Gohman)
Date: Mon, 01 Mar 2010 17:59:21 -0000
Subject: [llvm-commits] [llvm] r97461 -
/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Message-ID: <20100301175921.95EA92A6C12C@llvm.org>
Author: djg
Date: Mon Mar 1 11:59:21 2010
New Revision: 97461
URL: http://llvm.org/viewvc/llvm-project?rev=97461&view=rev
Log:
Fix optimization of ISD::TRUNCATE on vector operands. Based on a patch
by Micah Villmow for PR6335.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=97461&r1=97460&r2=97461&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Mar 1 11:59:21 2010
@@ -1441,8 +1441,10 @@
case ISD::TRUNCATE: {
// Simplify the input, using demanded bit information, and compute the known
// zero/one bits live out.
+ unsigned OperandBitWidth =
+ Op.getOperand(0).getValueType().getScalarType().getSizeInBits();
APInt TruncMask = NewMask;
- TruncMask.zext(Op.getOperand(0).getValueSizeInBits());
+ TruncMask.zext(OperandBitWidth);
if (SimplifyDemandedBits(Op.getOperand(0), TruncMask,
KnownZero, KnownOne, TLO, Depth+1))
return true;
@@ -1453,15 +1455,14 @@
// on the known demanded bits.
if (Op.getOperand(0).getNode()->hasOneUse()) {
SDValue In = Op.getOperand(0);
- unsigned InBitWidth = In.getValueSizeInBits();
switch (In.getOpcode()) {
default: break;
case ISD::SRL:
// Shrink SRL by a constant if none of the high bits shifted in are
// demanded.
if (ConstantSDNode *ShAmt = dyn_cast(In.getOperand(1))){
- APInt HighBits = APInt::getHighBitsSet(InBitWidth,
- InBitWidth - BitWidth);
+ APInt HighBits = APInt::getHighBitsSet(OperandBitWidth,
+ OperandBitWidth - BitWidth);
HighBits = HighBits.lshr(ShAmt->getZExtValue());
HighBits.trunc(BitWidth);
From dpatel at apple.com Mon Mar 1 12:30:08 2010
From: dpatel at apple.com (Devang Patel)
Date: Mon, 01 Mar 2010 18:30:08 -0000
Subject: [llvm-commits] [llvm] r97464 -
/llvm/trunk/test/CodeGen/Generic/debug-info.ll
Message-ID: <20100301183008.879442A6C12C@llvm.org>
Author: dpatel
Date: Mon Mar 1 12:30:08 2010
New Revision: 97464
URL: http://llvm.org/viewvc/llvm-project?rev=97464&view=rev
Log:
Remove this generic debug info intrinsic test. LLVM does not use this llvm.dbg.stoppoint intrinsic anymore. There are tests to check new implementation, which attaches location information directly with an instruction using metadata.
Removed:
llvm/trunk/test/CodeGen/Generic/debug-info.ll
Removed: llvm/trunk/test/CodeGen/Generic/debug-info.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/debug-info.ll?rev=97463&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/debug-info.ll (original)
+++ llvm/trunk/test/CodeGen/Generic/debug-info.ll (removed)
@@ -1,19 +0,0 @@
-; RUN: llc < %s
-
- %lldb.compile_unit = type { i32, i16, i16, i8*, i8*, i8*, { }* }
- at d.compile_unit7 = external global %lldb.compile_unit ; <%lldb.compile_unit*> [#uses=1]
-
-declare void @llvm.dbg.stoppoint(i32, i32, %lldb.compile_unit*)
-
-define void @rb_raise(i32, ...) {
-entry:
- br i1 false, label %strlen.exit, label %no_exit.i
-
-no_exit.i: ; preds = %entry
- ret void
-
-strlen.exit: ; preds = %entry
- call void @llvm.dbg.stoppoint( i32 4358, i32 0, %lldb.compile_unit* @d.compile_unit7 )
- unreachable
-}
-
From dpatel at apple.com Mon Mar 1 12:30:58 2010
From: dpatel at apple.com (Devang Patel)
Date: Mon, 01 Mar 2010 18:30:58 -0000
Subject: [llvm-commits] [llvm] r97465 -
/llvm/trunk/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll
Message-ID: <20100301183058.A92EB2A6C12C@llvm.org>
Author: dpatel
Date: Mon Mar 1 12:30:58 2010
New Revision: 97465
URL: http://llvm.org/viewvc/llvm-project?rev=97465&view=rev
Log:
Rewrite test to test VLA using new debug info encoding scheme.
Modified:
llvm/trunk/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll
Modified: llvm/trunk/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll?rev=97465&r1=97464&r2=97465&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll Mon Mar 1 12:30:58 2010
@@ -3,74 +3,83 @@
; PR3538
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9"
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.block.type = type { i32, { }* }
- %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8* }
- %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }* }
- %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 }
- %llvm.dbg.subrange.type = type { i32, i64, i64 }
- %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
- at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str = internal constant [4 x i8] c"t.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at .str1 = internal constant [2 x i8] c".\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
- at .str2 = internal constant [6 x i8] c"clang\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
- at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([2 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([6 x i8]* @.str2, i32 0, i32 0), i1 false, i1 false, i8* null }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
- at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str4 = internal constant [5 x i8] c"test\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at .str5 = internal constant [2 x i8] c"X\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
- at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459009, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([2 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
- at llvm.dbg.block = internal constant %llvm.dbg.block.type { i32 458763, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) }, section "llvm.metadata" ; <%llvm.dbg.block.type*> [#uses=1]
- at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type { i32 458785, i64 0, i64 0 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1]
- at llvm.dbg.array = internal constant [1 x { }*] [{ }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to { }*)], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1]
- at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* null, i32 0, i64 0, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array to { }*) }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at .str6 = internal constant [2 x i8] c"Y\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
- at llvm.dbg.variable7 = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.block.type* @llvm.dbg.block to { }*), i8* getelementptr ([2 x i8]* @.str6, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 4, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
-
-define i32 @test(i32 %X) nounwind {
+define signext i8 @foo(i8* %s1) nounwind ssp {
entry:
- %retval = alloca i32 ; [#uses=1]
- %X.addr = alloca i32 ; [#uses=3]
- %saved_stack = alloca i8* ; [#uses=2]
- call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
- store i32 %X, i32* %X.addr
- %0 = bitcast i32* %X.addr to { }* ; <{ }*> [#uses=1]
- call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*))
- call void @llvm.dbg.region.start({ }* bitcast (%llvm.dbg.block.type* @llvm.dbg.block to { }*))
- call void @llvm.dbg.stoppoint(i32 4, i32 3, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- %1 = call i8* @llvm.stacksave() ; [#uses=1]
- store i8* %1, i8** %saved_stack
- %tmp = load i32* %X.addr ; [#uses=1]
- %2 = mul i32 4, %tmp ; [#uses=1]
- %vla = alloca i8, i32 %2 ; [#uses=1]
- %tmp1 = bitcast i8* %vla to i32* ; [#uses=1]
- %3 = bitcast i32* %tmp1 to { }* ; <{ }*> [#uses=1]
- call void @llvm.dbg.declare({ }* %3, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable7 to { }*))
- call void @llvm.dbg.stoppoint(i32 5, i32 1, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.block.type* @llvm.dbg.block to { }*))
- br label %cleanup
-
-cleanup: ; preds = %entry
- %tmp2 = load i8** %saved_stack ; [#uses=1]
- call void @llvm.stackrestore(i8* %tmp2)
- call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
- %4 = load i32* %retval ; [#uses=1]
- ret i32 %4
+ %s1_addr = alloca i8* ; [#uses=2]
+ %retval = alloca i32 ; [#uses=2]
+ %saved_stack.1 = alloca i8* ; [#uses=2]
+ %0 = alloca i32 ; [#uses=2]
+ %str.0 = alloca [0 x i8]* ; <[0 x i8]**> [#uses=3]
+ %1 = alloca i64 ; [#uses=2]
+ %2 = alloca i64 ; [#uses=1]
+ %3 = alloca i64 ; [#uses=6]
+ %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
+ call void @llvm.dbg.declare(metadata !{i8** %s1_addr}, metadata !0), !dbg !7
+ store i8* %s1, i8** %s1_addr
+ call void @llvm.dbg.declare(metadata !{[0 x i8]** %str.0}, metadata !8), !dbg !7
+ %4 = call i8* @llvm.stacksave(), !dbg !7 ; [#uses=1]
+ store i8* %4, i8** %saved_stack.1, align 8, !dbg !7
+ %5 = load i8** %s1_addr, align 8, !dbg !13 ; [#uses=1]
+ %6 = call i64 @strlen(i8* %5) nounwind readonly, !dbg !13 ; [#uses=1]
+ %7 = add i64 %6, 1, !dbg !13 ; [#uses=1]
+ store i64 %7, i64* %3, align 8, !dbg !13
+ %8 = load i64* %3, align 8, !dbg !13 ; [#uses=1]
+ %9 = sub nsw i64 %8, 1, !dbg !13 ; [#uses=0]
+ %10 = load i64* %3, align 8, !dbg !13 ; [#uses=1]
+ %11 = mul i64 %10, 8, !dbg !13 ; [#uses=0]
+ %12 = load i64* %3, align 8, !dbg !13 ; [#uses=1]
+ store i64 %12, i64* %2, align 8, !dbg !13
+ %13 = load i64* %3, align 8, !dbg !13 ; [#uses=1]
+ %14 = mul i64 %13, 8, !dbg !13 ; [#uses=0]
+ %15 = load i64* %3, align 8, !dbg !13 ; [#uses=1]
+ store i64 %15, i64* %1, align 8, !dbg !13
+ %16 = load i64* %1, align 8, !dbg !13 ; [#uses=1]
+ %17 = trunc i64 %16 to i32, !dbg !13 ; [#uses=1]
+ %18 = alloca i8, i32 %17, !dbg !13 ; [#uses=1]
+ %19 = bitcast i8* %18 to [0 x i8]*, !dbg !13 ; <[0 x i8]*> [#uses=1]
+ store [0 x i8]* %19, [0 x i8]** %str.0, align 8, !dbg !13
+ %20 = load [0 x i8]** %str.0, align 8, !dbg !15 ; <[0 x i8]*> [#uses=1]
+ %21 = getelementptr inbounds [0 x i8]* %20, i64 0, i64 0, !dbg !15 ; [#uses=1]
+ store i8 0, i8* %21, align 1, !dbg !15
+ %22 = load [0 x i8]** %str.0, align 8, !dbg !16 ; <[0 x i8]*> [#uses=1]
+ %23 = getelementptr inbounds [0 x i8]* %22, i64 0, i64 0, !dbg !16 ; [#uses=1]
+ %24 = load i8* %23, align 1, !dbg !16 ; [#uses=1]
+ %25 = sext i8 %24 to i32, !dbg !16 ; [#uses=1]
+ store i32 %25, i32* %0, align 4, !dbg !16
+ %26 = load i8** %saved_stack.1, align 8, !dbg !16 ; [#uses=1]
+ call void @llvm.stackrestore(i8* %26), !dbg !16
+ %27 = load i32* %0, align 4, !dbg !16 ; [#uses=1]
+ store i32 %27, i32* %retval, align 4, !dbg !16
+ br label %return, !dbg !16
+
+return: ; preds = %entry
+ %retval1 = load i32* %retval, !dbg !16 ; [#uses=1]
+ %retval12 = trunc i32 %retval1 to i8, !dbg !16 ; [#uses=1]
+ ret i8 %retval12, !dbg !16
}
-declare void @llvm.dbg.func.start({ }*) nounwind
-
-declare void @llvm.dbg.declare({ }*, { }*) nounwind
-
-declare void @llvm.dbg.region.start({ }*) nounwind
-
-declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
+declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
declare i8* @llvm.stacksave() nounwind
+declare i64 @strlen(i8*) nounwind readonly
+
declare void @llvm.stackrestore(i8*) nounwind
-declare void @llvm.dbg.region.end({ }*) nounwind
+!0 = metadata !{i32 459009, metadata !1, metadata !"s1", metadata !2, i32 2, metadata !6} ; [ DW_TAG_arg_variable ]
+!1 = metadata !{i32 458798, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"foo", metadata !2, i32 2, metadata !3, i1 false, i1 true, i32 0, i32 0, null, i1 false} ; [ DW_TAG_subprogram ]
+!2 = metadata !{i32 458769, i32 0, i32 1, metadata !"vla.c", metadata !"/tmp/", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
+!3 = metadata !{i32 458773, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !4, i32 0, null} ; [ DW_TAG_subroutine_type ]
+!4 = metadata !{metadata !5, metadata !6}
+!5 = metadata !{i32 458788, metadata !2, metadata !"char", metadata !2, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ]
+!6 = metadata !{i32 458767, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !5} ; [ DW_TAG_pointer_type ]
+!7 = metadata !{i32 2, i32 0, metadata !1, null}
+!8 = metadata !{i32 459008, metadata !1, metadata !"str.0", metadata !2, i32 3, metadata !9} ; [ DW_TAG_auto_variable ]
+!9 = metadata !{i32 458767, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !10} ; [ DW_TAG_pointer_type ]
+!10 = metadata !{i32 458753, metadata !2, metadata !"", metadata !2, i32 0, i64 8, i64 8, i64 0, i32 0, metadata !5, metadata !11, i32 0, null} ; [ DW_TAG_array_type ]
+!11 = metadata !{metadata !12}
+!12 = metadata !{i32 458785, i64 0, i64 0} ; [ DW_TAG_subrange_type ]
+!13 = metadata !{i32 3, i32 0, metadata !14, null}
+!14 = metadata !{i32 458763, metadata !1, i32 0, i32 0} ; [ DW_TAG_lexical_block ]
+!15 = metadata !{i32 4, i32 0, metadata !14, null}
+!16 = metadata !{i32 5, i32 0, metadata !14, null}
From dpatel at apple.com Mon Mar 1 12:32:27 2010
From: dpatel at apple.com (Devang Patel)
Date: Mon, 01 Mar 2010 18:32:27 -0000
Subject: [llvm-commits] [llvm] r97466 -
/llvm/trunk/test/DebugInfo/2009-02-27-licm.ll
Message-ID: <20100301183227.74EBF2A6C12C@llvm.org>
Author: dpatel
Date: Mon Mar 1 12:32:27 2010
New Revision: 97466
URL: http://llvm.org/viewvc/llvm-project?rev=97466&view=rev
Log:
This test checks whether LICM ignores @llvm.dbg.stoppoint intrinsics appropriately or not. Now, llvm does not use this intrinsic. Remove this test.
Removed:
llvm/trunk/test/DebugInfo/2009-02-27-licm.ll
Removed: llvm/trunk/test/DebugInfo/2009-02-27-licm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-02-27-licm.ll?rev=97465&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/2009-02-27-licm.ll (original)
+++ llvm/trunk/test/DebugInfo/2009-02-27-licm.ll (removed)
@@ -1,83 +0,0 @@
-;RUN: opt < %s -licm -S | grep {load } | count 4
-; ModuleID = '2009-02-27-licm.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i386-pc-linux-gnu"
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 }
- %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }*, i32 }
- %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 }
- at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str = internal constant [12 x i8] c"mt19937ar.c\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1]
- at .str1 = internal constant [58 x i8] c"/developer2/home5/youxiangc/work/project/pr965/test-licm/\00", section "llvm.metadata" ; <[58 x i8]*> [#uses=1]
- at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1]
- at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([58 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
- at mti = internal global i32 625 ; [#uses=7]
- at .str5 = internal constant [18 x i8] c"long unsigned int\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1]
- at llvm.dbg.basictype6 = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([18 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at llvm.dbg.array = internal constant [2 x { }*] [{ }* null, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to { }*)], section "llvm.metadata" ; <[2 x { }*]*> [#uses=1]
- at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([2 x { }*]* @llvm.dbg.array to { }*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str7 = internal constant [13 x i8] c"init_genrand\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1]
- at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([13 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str7, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 13, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at mt = internal global [624 x i32] zeroinitializer, align 32 ; <[624 x i32]*> [#uses=4]
-
-define void @init_genrand(i32 %s) nounwind {
-entry:
- tail call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
- tail call void @llvm.dbg.stoppoint(i32 14, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- store i32 %s, i32* getelementptr ([624 x i32]* @mt, i32 0, i32 0), align 32
- tail call void @llvm.dbg.stoppoint(i32 15, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- store i32 1, i32* @mti
- tail call void @llvm.dbg.stoppoint(i32 15, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- %0 = load i32* @mti, align 4 ; [#uses=1]
- %1 = icmp sgt i32 %0, 623 ; [#uses=1]
- br i1 %1, label %return, label %bb.nph
-
-bb.nph: ; preds = %entry
- br label %bb
-
-bb: ; preds = %bb1, %bb.nph
- %storemerge1 = phi i32 [ %16, %bb1 ], [ 1, %bb.nph ] ; [#uses=0]
- tail call void @llvm.dbg.stoppoint(i32 16, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- %2 = load i32* @mti, align 4 ; [#uses=3]
- %3 = add i32 %2, -1 ; [#uses=1]
- %4 = getelementptr [624 x i32]* @mt, i32 0, i32 %3 ; [#uses=1]
- %5 = load i32* %4, align 4 ; [#uses=1]
- %6 = add i32 %2, -1 ; [#uses=1]
- %7 = getelementptr [624 x i32]* @mt, i32 0, i32 %6 ; [#uses=1]
- %8 = load i32* %7, align 4 ; [#uses=1]
- %9 = lshr i32 %8, 30 ; [#uses=1]
- %10 = xor i32 %9, %5 ; [#uses=1]
- %11 = mul i32 %10, 1812433253 ; [#uses=1]
- %12 = load i32* @mti, align 4 ; [#uses=1]
- %13 = add i32 %11, %12 ; [#uses=1]
- %14 = getelementptr [624 x i32]* @mt, i32 0, i32 %2 ; [#uses=1]
- store i32 %13, i32* %14, align 4
- tail call void @llvm.dbg.stoppoint(i32 15, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- %15 = load i32* @mti, align 4 ; [#uses=1]
- %16 = add i32 %15, 1 ; [#uses=2]
- br label %bb1
-
-bb1: ; preds = %bb
- %storemerge = phi i32 [ %16, %bb ] ; [#uses=1]
- store i32 %storemerge, i32* @mti
- tail call void @llvm.dbg.stoppoint(i32 15, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- %17 = load i32* @mti, align 4 ; [#uses=1]
- %18 = icmp sgt i32 %17, 623 ; [#uses=1]
- br i1 %18, label %bb1.return_crit_edge, label %bb
-
-bb1.return_crit_edge: ; preds = %bb1
- br label %return
-
-return: ; preds = %bb1.return_crit_edge, %entry
- tail call void @llvm.dbg.stoppoint(i32 25, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- tail call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
- ret void
-}
-
-declare void @llvm.dbg.func.start({ }*) nounwind
-
-declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
-
-declare void @llvm.dbg.region.end({ }*) nounwind
From rjmccall at apple.com Mon Mar 1 12:38:46 2010
From: rjmccall at apple.com (John McCall)
Date: Mon, 01 Mar 2010 18:38:46 -0000
Subject: [llvm-commits] [llvm] r97467 - /llvm/trunk/lib/Support/APFloat.cpp
Message-ID: <20100301183846.255C82A6C12C@llvm.org>
Author: rjmccall
Date: Mon Mar 1 12:38:45 2010
New Revision: 97467
URL: http://llvm.org/viewvc/llvm-project?rev=97467&view=rev
Log:
Don't potentially read past the end of the fill data when making a NaN from
an APInt.
Modified:
llvm/trunk/lib/Support/APFloat.cpp
Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=97467&r1=97466&r2=97467&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Mon Mar 1 12:38:45 2010
@@ -638,7 +638,8 @@
if (!fill || fill->getNumWords() < numParts)
APInt::tcSet(significand, 0, numParts);
if (fill) {
- APInt::tcAssign(significand, fill->getRawData(), partCount());
+ APInt::tcAssign(significand, fill->getRawData(),
+ std::min(fill->getNumWords(), numParts));
// Zero out the excess bits of the significand.
unsigned bitsToPreserve = semantics->precision - 1;
From dpatel at apple.com Mon Mar 1 12:45:28 2010
From: dpatel at apple.com (Devang Patel)
Date: Mon, 01 Mar 2010 18:45:28 -0000
Subject: [llvm-commits] [llvm] r97468 - in /llvm/trunk/test/DebugInfo:
2009-03-03-cheapdse.ll 2009-03-05-gvn.ll
Message-ID: <20100301184528.D4EBF2A6C12C@llvm.org>
Author: dpatel
Date: Mon Mar 1 12:45:28 2010
New Revision: 97468
URL: http://llvm.org/viewvc/llvm-project?rev=97468&view=rev
Log:
These two tests check whether oprimizer safely ignores @llvm.dbg.stoppoint intrinsic or not. This intrinsic is not used anymore.
Removed:
llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll
llvm/trunk/test/DebugInfo/2009-03-05-gvn.ll
Removed: llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll?rev=97467&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll (original)
+++ llvm/trunk/test/DebugInfo/2009-03-03-cheapdse.ll (removed)
@@ -1,80 +0,0 @@
-; RUN: opt < %s -instcombine -S | grep store | count 5
-; ModuleID = ''
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i386-apple-darwin9.6"
- type { } ; type %0
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, %0*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 }
- %llvm.dbg.composite.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, %0*, %0*, i32 }
- %llvm.dbg.derivedtype.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, %0* }
- %llvm.dbg.subprogram.type = type { i32, %0*, %0*, i8*, i8*, i8*, %0*, i32, %0*, i1, i1 }
- %struct.Matrix = type { float*, i32, i32, i32, i32 }
- at llvm.dbg.compile_units = internal constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str = internal constant [15 x i8] c"himenobmtxpa.c\00", section "llvm.metadata" ; <[15 x i8]*> [#uses=1]
- at .str1 = internal constant [74 x i8] c"/Volumes/MacOS9/gcc/llvm/projects/llvm-test/SingleSource/Benchmarks/Misc/\00", section "llvm.metadata" ; <[74 x i8]*> [#uses=1]
- at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1]
- at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %0*), i32 1, i8* getelementptr ([15 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([74 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
- at .str3 = internal constant [6 x i8] c"float\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
- at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([6 x i8]* @.str3, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 4 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at .str5 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.basictype6 = internal constant %llvm.dbg.basictype.type { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([4 x i8]* @.str5, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at llvm.dbg.subprograms = internal constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str90 = internal constant [4 x i8] c"Mat\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype92 = internal constant %llvm.dbg.derivedtype.type { i32 458767, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at .str93 = internal constant [2 x i8] c"m\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype94 = internal constant %llvm.dbg.derivedtype.type { i32 458765, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([2 x i8]* @.str93, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 46, i64 32, i64 32, i64 0, i32 0, %0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype92 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at .str95 = internal constant [6 x i8] c"mnums\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype96 = internal constant %llvm.dbg.derivedtype.type { i32 458765, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([6 x i8]* @.str95, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 47, i64 32, i64 32, i64 32, i32 0, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at .str97 = internal constant [6 x i8] c"mrows\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype98 = internal constant %llvm.dbg.derivedtype.type { i32 458765, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([6 x i8]* @.str97, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 48, i64 32, i64 32, i64 64, i32 0, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at .str99 = internal constant [6 x i8] c"mcols\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype100 = internal constant %llvm.dbg.derivedtype.type { i32 458765, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([6 x i8]* @.str99, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 49, i64 32, i64 32, i64 96, i32 0, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at .str101 = internal constant [6 x i8] c"mdeps\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype102 = internal constant %llvm.dbg.derivedtype.type { i32 458765, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([6 x i8]* @.str101, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 50, i64 32, i64 32, i64 128, i32 0, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at llvm.dbg.array103 = internal constant [5 x %0*] [%0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype94 to %0*), %0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype96 to %0*), %0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype98 to %0*), %0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype100 to %0*), %0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype102 to %0*)], section "llvm.metadata" ; <[5 x %0*]*> [#uses=1]
- at llvm.dbg.composite104 = internal constant %llvm.dbg.composite.type { i32 458771, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([4 x i8]* @.str90, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 45, i64 160, i64 32, i64 0, i32 0, %0* null, %0* bitcast ([5 x %0*]* @llvm.dbg.array103 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at .str105 = internal constant [7 x i8] c"Matrix\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype106 = internal constant %llvm.dbg.derivedtype.type { i32 458774, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([7 x i8]* @.str105, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 54, i64 0, i64 0, i64 0, i32 0, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite104 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at llvm.dbg.derivedtype107 = internal constant %llvm.dbg.derivedtype.type { i32 458767, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, %0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype106 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at llvm.dbg.array108 = internal constant [6 x %0*] [%0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*), %0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype107 to %0*), %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*), %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*), %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*), %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*)], section "llvm.metadata" ; <[6 x %0*]*> [#uses=1]
- at llvm.dbg.composite109 = internal constant %llvm.dbg.composite.type { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([6 x %0*]* @llvm.dbg.array108 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at .str110 = internal constant [7 x i8] c"newMat\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1]
- at llvm.dbg.subprogram111 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([7 x i8]* @.str110, i32 0, i32 0), i8* getelementptr ([7 x i8]* @.str110, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 195, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite109 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at llvm.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.Matrix*, i32, i32, i32, i32)* @newMat to i8*)], section "llvm.metadata" ; <[1 x i8*]*> [#uses=0]
-
-define i32 @newMat(%struct.Matrix* %Mat, i32 %mnums, i32 %mrows, i32 %mcols, i32 %mdeps) nounwind {
-entry:
- call void @llvm.dbg.func.start(%0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram111 to %0*))
- call void @llvm.dbg.stoppoint(i32 196, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %0 = getelementptr %struct.Matrix* %Mat, i32 0, i32 1 ; [#uses=1]
- store i32 %mnums, i32* %0, align 4
- call void @llvm.dbg.stoppoint(i32 197, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %1 = getelementptr %struct.Matrix* %Mat, i32 0, i32 2 ; [#uses=1]
- store i32 %mrows, i32* %1, align 4
- call void @llvm.dbg.stoppoint(i32 198, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %2 = getelementptr %struct.Matrix* %Mat, i32 0, i32 3 ; [#uses=1]
- store i32 %mcols, i32* %2, align 4
- call void @llvm.dbg.stoppoint(i32 199, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %3 = getelementptr %struct.Matrix* %Mat, i32 0, i32 4 ; [#uses=1]
- store i32 %mdeps, i32* %3, align 4
- call void @llvm.dbg.stoppoint(i32 201, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %4 = mul i32 %mnums, %mrows ; [#uses=1]
- %5 = mul i32 %4, %mcols ; [#uses=1]
- %6 = mul i32 %5, %mdeps ; [#uses=1]
- %7 = malloc float, i32 %6 ; [#uses=2]
- %8 = getelementptr %struct.Matrix* %Mat, i32 0, i32 0 ; [#uses=1]
- store float* %7, float** %8, align 4
- call void @llvm.dbg.stoppoint(i32 204, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %9 = icmp ne float* %7, null ; [#uses=1]
- %10 = zext i1 %9 to i32 ; [#uses=1]
- call void @llvm.dbg.stoppoint(i32 204, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- call void @llvm.dbg.region.end(%0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram111 to %0*))
- ret i32 %10
-}
-
-declare void @llvm.dbg.func.start(%0*) nounwind readnone
-
-declare void @llvm.dbg.stoppoint(i32, i32, %0*) nounwind readnone
-
-declare void @llvm.dbg.region.end(%0*) nounwind readnone
Removed: llvm/trunk/test/DebugInfo/2009-03-05-gvn.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-03-05-gvn.ll?rev=97467&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/2009-03-05-gvn.ll (original)
+++ llvm/trunk/test/DebugInfo/2009-03-05-gvn.ll (removed)
@@ -1,125 +0,0 @@
-; RUN: opt < %s -gvn -S | grep {load } | count 1
-; ModuleID = 'db2-before.bc'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
-target triple = "i386-pc-linux-gnu"
- type { } ; type %0
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, %0*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 }
- %llvm.dbg.composite.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, %0*, %0*, i32 }
- %llvm.dbg.derivedtype.type = type { i32, %0*, i8*, %0*, i32, i64, i64, i64, i32, %0* }
- %llvm.dbg.subprogram.type = type { i32, %0*, %0*, i8*, i8*, i8*, %0*, i32, %0*, i1, i1 }
- at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str = internal constant [12 x i8] c"mt19937ar.c\00", section "llvm.metadata" ; <[12 x i8]*> [#uses=1]
- at .str1 = internal constant [34 x i8] c"/developer/home2/zsth/test/debug/\00", section "llvm.metadata" ; <[34 x i8]*> [#uses=1]
- at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5641) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1]
- at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %0*), i32 1, i8* getelementptr ([12 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([34 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 -1 }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
- at mti = internal global i32 625 ; [#uses=14]
- at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at .str5 = internal constant [18 x i8] c"long unsigned int\00", section "llvm.metadata" ; <[18 x i8]*> [#uses=1]
- at llvm.dbg.basictype6 = internal constant %llvm.dbg.basictype.type { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([18 x i8]* @.str5, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 7 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at llvm.dbg.array = internal constant [2 x %0*] [%0* null, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*)], section "llvm.metadata" ; <[2 x %0*]*> [#uses=1]
- at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([2 x %0*]* @llvm.dbg.array to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str7 = internal constant [13 x i8] c"init_genrand\00", section "llvm.metadata" ; <[13 x i8]*> [#uses=1]
- at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([13 x i8]* @.str7, i32 0, i32 0), i8* getelementptr ([13 x i8]* @.str7, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 58, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at mt = internal global [624 x i32] zeroinitializer, align 32 ; <[624 x i32]*> [#uses=29]
- at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458767, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at llvm.dbg.array9 = internal constant [3 x %0*] [%0* null, %0* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %0*), %0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*)], section "llvm.metadata" ; <[3 x %0*]*> [#uses=1]
- at llvm.dbg.composite10 = internal constant %llvm.dbg.composite.type { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([3 x %0*]* @llvm.dbg.array9 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at .str11 = internal constant [14 x i8] c"init_by_array\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1]
- at llvm.dbg.subprogram12 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([14 x i8]* @.str11, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str11, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 77, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite10 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at llvm.dbg.array23 = internal constant [1 x %0*] [%0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype6 to %0*)], section "llvm.metadata" ; <[1 x %0*]*> [#uses=1]
- at llvm.dbg.composite24 = internal constant %llvm.dbg.composite.type { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([1 x %0*]* @llvm.dbg.array23 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at .str25 = internal constant [14 x i8] c"genrand_int32\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1]
- at llvm.dbg.subprogram26 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([14 x i8]* @.str25, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str25, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 103, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite24 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at mag01.1661 = internal constant [2 x i32] [i32 0, i32 -1727483681] ; <[2 x i32]*> [#uses=3]
- at .str35 = internal constant [9 x i8] c"long int\00", section "llvm.metadata" ; <[9 x i8]*> [#uses=1]
- at llvm.dbg.basictype36 = internal constant %llvm.dbg.basictype.type { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([9 x i8]* @.str35, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at llvm.dbg.array37 = internal constant [1 x %0*] [%0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype36 to %0*)], section "llvm.metadata" ; <[1 x %0*]*> [#uses=1]
- at llvm.dbg.composite38 = internal constant %llvm.dbg.composite.type { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([1 x %0*]* @llvm.dbg.array37 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at .str39 = internal constant [14 x i8] c"genrand_int31\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1]
- at llvm.dbg.subprogram40 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([14 x i8]* @.str39, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str39, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 141, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite38 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at .str41 = internal constant [7 x i8] c"double\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1]
- at llvm.dbg.basictype42 = internal constant %llvm.dbg.basictype.type { i32 458788, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([7 x i8]* @.str41, i32 0, i32 0), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 64, i64 64, i64 0, i32 0, i32 4 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at llvm.dbg.array43 = internal constant [1 x %0*] [%0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype42 to %0*)], section "llvm.metadata" ; <[1 x %0*]*> [#uses=1]
- at llvm.dbg.composite44 = internal constant %llvm.dbg.composite.type { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([1 x %0*]* @llvm.dbg.array43 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at .str45 = internal constant [14 x i8] c"genrand_real1\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1]
- at llvm.dbg.subprogram46 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([14 x i8]* @.str45, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str45, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 147, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite44 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at .str47 = internal constant [14 x i8] c"genrand_real2\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1]
- at llvm.dbg.subprogram48 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([14 x i8]* @.str47, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str47, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 154, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite44 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at .str49 = internal constant [14 x i8] c"genrand_real3\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1]
- at llvm.dbg.subprogram50 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([14 x i8]* @.str49, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str49, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 161, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite44 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at .str51 = internal constant [14 x i8] c"genrand_res53\00", section "llvm.metadata" ; <[14 x i8]*> [#uses=1]
- at llvm.dbg.subprogram52 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([14 x i8]* @.str51, i32 0, i32 0), i8* getelementptr ([14 x i8]* @.str51, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 168, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite44 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at llvm.dbg.array57 = internal constant [1 x %0*] [%0* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %0*)], section "llvm.metadata" ; <[1 x %0*]*> [#uses=1]
- at llvm.dbg.composite58 = internal constant %llvm.dbg.composite.type { i32 458773, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 0, i64 0, i64 0, i64 0, i32 0, %0* null, %0* bitcast ([1 x %0*]* @llvm.dbg.array57 to %0*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at .str59 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.subprogram60 = internal constant %llvm.dbg.subprogram.type { i32 458798, %0* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %0*), %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i8* getelementptr ([5 x i8]* @.str59, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str59, i32 0, i32 0), i8* null, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*), i32 175, %0* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite58 to %0*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at .str69 = internal constant [32 x i8] c"1000 outputs of genrand_int32()\00" ; <[32 x i8]*> [#uses=1]
- at .str70 = internal constant [7 x i8] c"%10lu \00" ; <[7 x i8]*> [#uses=1]
- at .str71 = internal constant [33 x i8] c"\0A1000 outputs of genrand_real2()\00" ; <[33 x i8]*> [#uses=1]
- at .str72 = internal constant [8 x i8] c"%10.8f \00" ; <[8 x i8]*> [#uses=1]
-
-define void @init_genrand(i32 %s) nounwind {
-entry:
- tail call void @llvm.dbg.func.start(%0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*))
- tail call void @llvm.dbg.stoppoint(i32 59, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- store i32 %s, i32* getelementptr ([624 x i32]* @mt, i32 0, i32 0), align 32
- tail call void @llvm.dbg.stoppoint(i32 60, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- store i32 1, i32* @mti
- tail call void @llvm.dbg.stoppoint(i32 60, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- br i1 false, label %return, label %bb.nph
-
-bb.nph: ; preds = %entry
- %mti.promoted = load i32* @mti ; [#uses=1]
- br label %bb
-
-bb: ; preds = %bb1, %bb.nph
- %indvar = phi i32 [ 0, %bb.nph ], [ %indvar.next, %bb1 ] ; [#uses=2]
- %mti.tmp.0 = add i32 %indvar, %mti.promoted ; [#uses=5]
- tail call void @llvm.dbg.stoppoint(i32 61, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %0 = add i32 %mti.tmp.0, -1 ; [#uses=1]
- %1 = getelementptr [624 x i32]* @mt, i32 0, i32 %0 ; [#uses=1]
- %2 = load i32* %1, align 4 ; [#uses=1]
- %3 = add i32 %mti.tmp.0, -1 ; [#uses=1]
- %4 = getelementptr [624 x i32]* @mt, i32 0, i32 %3 ; [#uses=1]
- %5 = load i32* %4, align 4 ; [#uses=1]
- %6 = lshr i32 %5, 30 ; [#uses=1]
- %7 = xor i32 %6, %2 ; [#uses=1]
- %8 = mul i32 %7, 1812433253 ; [#uses=1]
- %9 = add i32 %8, %mti.tmp.0 ; [#uses=1]
- %10 = getelementptr [624 x i32]* @mt, i32 0, i32 %mti.tmp.0 ; [#uses=1]
- store i32 %9, i32* %10, align 4
- tail call void @llvm.dbg.stoppoint(i32 60, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %11 = add i32 %mti.tmp.0, 1 ; [#uses=2]
- br label %bb1
-
-bb1: ; preds = %bb
- tail call void @llvm.dbg.stoppoint(i32 60, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- %12 = icmp sgt i32 %11, 623 ; [#uses=1]
- %indvar.next = add i32 %indvar, 1 ; [#uses=1]
- br i1 %12, label %bb1.return_crit_edge, label %bb
-
-bb1.return_crit_edge: ; preds = %bb1
- store i32 %11, i32* @mti
- br label %return
-
-return: ; preds = %bb1.return_crit_edge, %entry
- tail call void @llvm.dbg.stoppoint(i32 70, i32 0, %0* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %0*))
- tail call void @llvm.dbg.region.end(%0* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %0*))
- ret void
-}
-
-declare void @llvm.dbg.func.start(%0*) nounwind
-
-declare void @llvm.dbg.stoppoint(i32, i32, %0*) nounwind
-
-declare void @llvm.dbg.region.end(%0*) nounwind
-
-declare i32 @puts(i8* nocapture) nounwind
-
-declare i32 @printf(i8* noalias nocapture, ...) nounwind
-
-declare i32 @putchar(i32) nounwind
From sabre at nondot.org Mon Mar 1 12:47:12 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 01 Mar 2010 18:47:12 -0000
Subject: [llvm-commits] [llvm] r97469 - in /llvm/trunk:
include/llvm/CodeGen/SelectionDAGISel.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Message-ID: <20100301184712.0F8272A6C12C@llvm.org>
Author: lattner
Date: Mon Mar 1 12:47:11 2010
New Revision: 97469
URL: http://llvm.org/viewvc/llvm-project?rev=97469&view=rev
Log:
Accelerate isel dispatch for tables that start with a top-level
OPC_SwitchOpcode to use a table lookup instead of having to go
through the interpreter for this.
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=97469&r1=97468&r2=97469&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Mar 1 12:47:11 2010
@@ -245,6 +245,10 @@
/// one preferred by the target.
///
ScheduleDAGSDNodes *CreateScheduler();
+
+ /// OpcodeOffset - This is a cache used to dispatch efficiently into isel
+ /// state machines that start with a OPC_SwitchOpcode node.
+ std::vector OpcodeOffset;
};
}
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=97469&r1=97468&r2=97469&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Mar 1 12:47:11 2010
@@ -1665,8 +1665,43 @@
NodeToMatch->dump(CurDAG);
errs() << '\n');
- // Interpreter starts at opcode #0.
+ // Determine where to start the interpreter. Normally we start at opcode #0,
+ // but if the state machine starts with an OPC_SwitchOpcode, then we
+ // accelerate the first lookup (which is guaranteed to be hot) with the
+ // OpcodeOffset table.
unsigned MatcherIndex = 0;
+
+ if (!OpcodeOffset.empty()) {
+ // Already computed the OpcodeOffset table, just index into it.
+ if (N.getOpcode() < OpcodeOffset.size())
+ MatcherIndex = OpcodeOffset[N.getOpcode()];
+ DEBUG(errs() << " Initial Opcode index to " << MatcherIndex << "\n");
+
+ } else if (MatcherTable[0] == OPC_SwitchOpcode) {
+ // Otherwise, the table isn't computed, but the state machine does start
+ // with an OPC_SwitchOpcode instruction. Populate the table now, since this
+ // is the first time we're selecting an instruction.
+ unsigned Idx = 1;
+ while (1) {
+ // Get the size of this case.
+ unsigned CaseSize = MatcherTable[Idx++];
+ if (CaseSize & 128)
+ CaseSize = GetVBR(CaseSize, MatcherTable, Idx);
+ if (CaseSize == 0) break;
+
+ // Get the opcode, add the index to the table.
+ unsigned Opc = MatcherTable[Idx++];
+ if (Opc >= OpcodeOffset.size())
+ OpcodeOffset.resize((Opc+1)*2);
+ OpcodeOffset[Opc] = Idx;
+ Idx += CaseSize;
+ }
+
+ // Okay, do the lookup for the first opcode.
+ if (N.getOpcode() < OpcodeOffset.size())
+ MatcherIndex = OpcodeOffset[N.getOpcode()];
+ }
+
while (1) {
assert(MatcherIndex < TableSize && "Invalid index");
BuiltinOpcodes Opcode = (BuiltinOpcodes)MatcherTable[MatcherIndex++];
From edwintorok at gmail.com Mon Mar 1 12:49:10 2010
From: edwintorok at gmail.com (Torok Edwin)
Date: Mon, 01 Mar 2010 18:49:10 -0000
Subject: [llvm-commits] [llvm] r97470 -
/llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
Message-ID: <20100301184910.B53712A6C12C@llvm.org>
Author: edwin
Date: Mon Mar 1 12:49:10 2010
New Revision: 97470
URL: http://llvm.org/viewvc/llvm-project?rev=97470&view=rev
Log:
Add command-line flag to tblgen to turn off generating comments for the new
isel (defaults it to generate comments).
This reduces the size of the generated source file.
Modified:
llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp?rev=97470&r1=97469&r2=97470&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp Mon Mar 1 12:49:10 2010
@@ -17,6 +17,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FormattedStream.h"
using namespace llvm;
@@ -24,6 +25,11 @@
CommentIndent = 30
};
+// To reduce generated source code size.
+static cl::opt
+OmitComments("omit-comments", cl::desc("Do not generate comments"),
+ cl::init(false));
+
namespace {
class MatcherTableEmitter {
StringMap NodePredicateMap, PatternPredicateMap;
@@ -116,7 +122,10 @@
Val >>= 7;
++NumBytes;
}
- OS << Val << "/*" << InVal << "*/, ";
+ OS << Val;
+ if (!OmitComments)
+ OS << "/*" << InVal << "*/";
+ OS << ", ";
return NumBytes+1;
}
@@ -139,9 +148,12 @@
if (i == 0) {
OS << "OPC_Scope, ";
++CurrentIdx;
- } else {
- OS << "/*" << CurrentIdx << "*/";
- OS.PadToColumn(Indent*2) << "/*Scope*/ ";
+ } else {
+ if (!OmitComments) {
+ OS << "/*" << CurrentIdx << "*/";
+ OS.PadToColumn(Indent*2) << "/*Scope*/ ";
+ } else
+ OS.PadToColumn(Indent*2);
}
// We need to encode the child and the offset of the failure code before
@@ -165,35 +177,45 @@
assert(ChildSize != 0 && "Should not have a zero-sized child!");
CurrentIdx += EmitVBRValue(ChildSize, OS);
- OS << "/*->" << CurrentIdx+ChildSize << "*/";
+ if (!OmitComments) {
+ OS << "/*->" << CurrentIdx+ChildSize << "*/";
- if (i == 0)
- OS.PadToColumn(CommentIndent) << "// " << SM->getNumChildren()
- << " children in Scope";
+ if (i == 0)
+ OS.PadToColumn(CommentIndent) << "// " << SM->getNumChildren()
+ << " children in Scope";
+ }
OS << '\n' << TmpBuf.str();
CurrentIdx += ChildSize;
}
// Emit a zero as a sentinel indicating end of 'Scope'.
- OS << "/*" << CurrentIdx << "*/";
- OS.PadToColumn(Indent*2) << "0, /*End of Scope*/\n";
+ if (!OmitComments)
+ OS << "/*" << CurrentIdx << "*/";
+ OS.PadToColumn(Indent*2) << "0, ";
+ if (!OmitComments)
+ OS << "/*End of Scope*/";
+ OS << '\n';
return CurrentIdx - StartIdx + 1;
}
case Matcher::RecordNode:
OS << "OPC_RecordNode,";
- OS.PadToColumn(CommentIndent) << "// #"
- << cast(N)->getResultNo() << " = "
- << cast(N)->getWhatFor() << '\n';
+ if (!OmitComments)
+ OS.PadToColumn(CommentIndent) << "// #"
+ << cast(N)->getResultNo() << " = "
+ << cast(N)->getWhatFor();
+ OS << '\n';
return 1;
case Matcher::RecordChild:
OS << "OPC_RecordChild" << cast(N)->getChildNo()
<< ',';
- OS.PadToColumn(CommentIndent) << "// #"
- << cast(N)->getResultNo() << " = "
- << cast(N)->getWhatFor() << '\n';
+ if (!OmitComments)
+ OS.PadToColumn(CommentIndent) << "// #"
+ << cast(N)->getResultNo() << " = "
+ << cast(N)->getWhatFor();
+ OS << '\n';
return 1;
case Matcher::RecordMemRef:
@@ -220,13 +242,17 @@
case Matcher::CheckPatternPredicate: {
StringRef Pred = cast(N)->getPredicate();
OS << "OPC_CheckPatternPredicate, " << getPatternPredicate(Pred) << ',';
- OS.PadToColumn(CommentIndent) << "// " << Pred << '\n';
+ if (!OmitComments)
+ OS.PadToColumn(CommentIndent) << "// " << Pred;
+ OS << '\n';
return 2;
}
case Matcher::CheckPredicate: {
StringRef Pred = cast(N)->getPredicateName();
OS << "OPC_CheckPredicate, " << getNodePredicate(Pred) << ',';
- OS.PadToColumn(CommentIndent) << "// " << Pred << '\n';
+ if (!OmitComments)
+ OS.PadToColumn(CommentIndent) << "// " << Pred;
+ OS << '\n';
return 2;
}
@@ -238,7 +264,10 @@
case Matcher::SwitchOpcode: {
unsigned StartIdx = CurrentIdx;
const SwitchOpcodeMatcher *SOM = cast(N);
- OS << "OPC_SwitchOpcode /*" << SOM->getNumCases() << " cases */, ";
+ OS << "OPC_SwitchOpcode ";
+ if (!OmitComments)
+ OS << "/*" << SOM->getNumCases() << " cases */";
+ OS << ", ";
++CurrentIdx;
// For each case we emit the size, then the opcode, then the matcher.
@@ -263,21 +292,28 @@
assert(ChildSize != 0 && "Should not have a zero-sized child!");
- if (i != 0)
- OS.PadToColumn(Indent*2) << "/*SwitchOpcode*/ ";
+ if (i != 0) {
+ OS.PadToColumn(Indent*2);
+ if (!OmitComments)
+ OS << "/*SwitchOpcode*/ ";
+ }
// Emit the VBR.
CurrentIdx += EmitVBRValue(ChildSize, OS);
OS << " " << SOM->getCaseOpcode(i).getEnumName() << ",";
- OS << "// ->" << CurrentIdx+ChildSize+1 << '\n';
+ if (!OmitComments)
+ OS << "// ->" << CurrentIdx+ChildSize+1;
+ OS << '\n';
++CurrentIdx;
OS << TmpBuf.str();
CurrentIdx += ChildSize;
}
// Emit the final zero to terminate the switch.
- OS.PadToColumn(Indent*2) << "0, // EndSwitchOpcode\n";
+ OS.PadToColumn(Indent*2) << "0, ";
+ if (!OmitComments)
+ OS << "// EndSwitchOpcode";
++CurrentIdx;
return CurrentIdx-StartIdx;
}
@@ -309,10 +345,12 @@
const ComplexPattern &Pattern =
cast(N)->getPattern();
OS << "OPC_CheckComplexPat, " << getComplexPat(Pattern) << ',';
- OS.PadToColumn(CommentIndent) << "// " << Pattern.getSelectFunc();
- OS << ": " << Pattern.getNumOperands() << " operands";
- if (Pattern.hasProperty(SDNPHasChain))
- OS << " + chain result and input";
+ if (!OmitComments) {
+ OS.PadToColumn(CommentIndent) << "// " << Pattern.getSelectFunc();
+ OS << ": " << Pattern.getNumOperands() << " operands";
+ if (Pattern.hasProperty(SDNPHasChain))
+ OS << " + chain result and input";
+ }
OS << '\n';
return 2;
}
@@ -353,8 +391,12 @@
<< getEnumName(cast(N)->getVT()) << ", ";
if (Record *R = cast(N)->getReg())
OS << getQualifiedName(R) << ",\n";
- else
- OS << "0 /*zero_reg*/,\n";
+ else {
+ OS << "0 ";
+ if (!OmitComments)
+ OS << "/*zero_reg*/";
+ OS << ",\n";
+ }
return 3;
case Matcher::EmitConvertToTarget:
@@ -381,7 +423,9 @@
const EmitNodeXFormMatcher *XF = cast(N);
OS << "OPC_EmitNodeXForm, " << getNodeXFormID(XF->getNodeXForm()) << ", "
<< XF->getSlot() << ',';
- OS.PadToColumn(CommentIndent) << "// "<getNodeXForm()->getName()<<'\n';
+ if (!OmitComments)
+ OS.PadToColumn(CommentIndent) << "// "<getNodeXForm()->getName();
+ OS <<'\n';
return 3;
}
@@ -399,11 +443,17 @@
OS << "|OPFL_Variadic" << EN->getNumFixedArityOperands();
OS << ",\n";
- OS.PadToColumn(Indent*2+4) << EN->getNumVTs() << "/*#VTs*/, ";
+ OS.PadToColumn(Indent*2+4) << EN->getNumVTs();
+ if (!OmitComments)
+ OS << "/*#VTs*/";
+ OS << ", ";
for (unsigned i = 0, e = EN->getNumVTs(); i != e; ++i)
OS << getEnumName(EN->getVT(i)) << ", ";
- OS << EN->getNumOperands() << "/*#Ops*/, ";
+ OS << EN->getNumOperands();
+ if (!OmitComments)
+ OS << "/*#Ops*/";
+ OS << ", ";
unsigned NumOperandBytes = 0;
for (unsigned i = 0, e = EN->getNumOperands(); i != e; ++i) {
// We emit the operand numbers in VBR encoded format, in case the number
@@ -411,24 +461,26 @@
NumOperandBytes += EmitVBRValue(EN->getOperand(i), OS);
}
- // Print the result #'s for EmitNode.
- if (const EmitNodeMatcher *E = dyn_cast(EN)) {
- if (unsigned NumResults = EN->getNumVTs()) {
- OS.PadToColumn(CommentIndent) << "// Results = ";
- unsigned First = E->getFirstResultSlot();
- for (unsigned i = 0; i != NumResults; ++i)
- OS << "#" << First+i << " ";
+ if (!OmitComments) {
+ // Print the result #'s for EmitNode.
+ if (const EmitNodeMatcher *E = dyn_cast(EN)) {
+ if (unsigned NumResults = EN->getNumVTs()) {
+ OS.PadToColumn(CommentIndent) << "// Results = ";
+ unsigned First = E->getFirstResultSlot();
+ for (unsigned i = 0; i != NumResults; ++i)
+ OS << "#" << First+i << " ";
+ }
}
- }
- OS << '\n';
-
- if (const MorphNodeToMatcher *SNT = dyn_cast(N)) {
- OS.PadToColumn(Indent*2) << "// Src: "
- << *SNT->getPattern().getSrcPattern() << '\n';
- OS.PadToColumn(Indent*2) << "// Dst: "
- << *SNT->getPattern().getDstPattern() << '\n';
-
- }
+ OS << '\n';
+
+ if (const MorphNodeToMatcher *SNT = dyn_cast(N)) {
+ OS.PadToColumn(Indent*2) << "// Src: "
+ << *SNT->getPattern().getSrcPattern() << '\n';
+ OS.PadToColumn(Indent*2) << "// Dst: "
+ << *SNT->getPattern().getDstPattern() << '\n';
+ }
+ } else
+ OS << '\n';
return 6+EN->getNumVTs()+NumOperandBytes;
}
@@ -448,10 +500,13 @@
for (unsigned i = 0, e = CM->getNumResults(); i != e; ++i)
NumResultBytes += EmitVBRValue(CM->getResult(i), OS);
OS << '\n';
- OS.PadToColumn(Indent*2) << "// Src: "
- << *CM->getPattern().getSrcPattern() << '\n';
- OS.PadToColumn(Indent*2) << "// Dst: "
- << *CM->getPattern().getDstPattern() << '\n';
+ if (!OmitComments) {
+ OS.PadToColumn(Indent*2) << "// Src: "
+ << *CM->getPattern().getSrcPattern() << '\n';
+ OS.PadToColumn(Indent*2) << "// Dst: "
+ << *CM->getPattern().getDstPattern();
+ }
+ OS << '\n';
return 2 + NumResultBytes;
}
}
@@ -468,8 +523,8 @@
if (unsigned(N->getKind()) >= Histogram.size())
Histogram.resize(N->getKind()+1);
Histogram[N->getKind()]++;
-
- OS << "/*" << CurrentIdx << "*/";
+ if (!OmitComments)
+ OS << "/*" << CurrentIdx << "*/";
unsigned MatcherSize = EmitMatcher(N, Indent, CurrentIdx, OS);
Size += MatcherSize;
CurrentIdx += MatcherSize;
@@ -581,7 +636,10 @@
Record *SDNode = Entry.first;
const std::string &Code = Entry.second;
- OS << " case " << i << ": { // " << NodeXForms[i]->getName() << '\n';
+ OS << " case " << i << ": { ";
+ if (!OmitComments)
+ OS << "// " << NodeXForms[i]->getName();
+ OS << '\n';
std::string ClassName = CGP.getSDNodeInfo(SDNode).getSDClassName();
if (ClassName == "SDNode")
@@ -597,6 +655,8 @@
}
void MatcherTableEmitter::EmitHistogram(formatted_raw_ostream &OS) {
+ if (OmitComments)
+ return;
OS << " // Opcode Histogram:\n";
for (unsigned i = 0, e = Histogram.size(); i != e; ++i) {
OS << " // #";
@@ -663,7 +723,7 @@
OS << " #undef TARGET_OPCODE\n";
OS << " return SelectCodeCommon(N, MatcherTable,sizeof(MatcherTable));\n}\n";
- OS << "\n";
+ OS << '\n';
// Next up, emit the function for node and pattern predicates:
MatcherEmitter.EmitPredicateFunctions(CGP, OS);
From edwintorok at gmail.com Mon Mar 1 13:00:55 2010
From: edwintorok at gmail.com (Torok Edwin)
Date: Mon, 01 Mar 2010 19:00:55 -0000
Subject: [llvm-commits] [llvm] r97472 -
/llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
Message-ID: <20100301190055.490C22A6C12C@llvm.org>
Author: edwin
Date: Mon Mar 1 13:00:55 2010
New Revision: 97472
URL: http://llvm.org/viewvc/llvm-project?rev=97472&view=rev
Log:
Missed a \n in previous commit.
Modified:
llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp?rev=97472&r1=97471&r2=97472&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp Mon Mar 1 13:00:55 2010
@@ -314,6 +314,7 @@
OS.PadToColumn(Indent*2) << "0, ";
if (!OmitComments)
OS << "// EndSwitchOpcode";
+ OS << '\n';
++CurrentIdx;
return CurrentIdx-StartIdx;
}
From dpatel at apple.com Mon Mar 1 13:02:51 2010
From: dpatel at apple.com (Devang Patel)
Date: Mon, 01 Mar 2010 19:02:51 -0000
Subject: [llvm-commits] [llvm] r97473 - in /llvm/trunk/test/DebugInfo:
deaddebuglabel.ll inheritance.ll
Message-ID: <20100301190251.CBE6A2A6C12C@llvm.org>
Author: dpatel
Date: Mon Mar 1 13:02:51 2010
New Revision: 97473
URL: http://llvm.org/viewvc/llvm-project?rev=97473&view=rev
Log:
Replace test case that uses @llvm.dbg.* intrinsic with a test that uses metadata.
Added:
llvm/trunk/test/DebugInfo/inheritance.ll
Removed:
llvm/trunk/test/DebugInfo/deaddebuglabel.ll
Removed: llvm/trunk/test/DebugInfo/deaddebuglabel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/deaddebuglabel.ll?rev=97472&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/deaddebuglabel.ll (original)
+++ llvm/trunk/test/DebugInfo/deaddebuglabel.ll (removed)
@@ -1,62 +0,0 @@
-; RUN: llc %s -o - -O0 | grep "label" | count 8
-; PR2614
-; XFAIL: *
-
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-f80:32:32-v64:64:64-v128:128:128-a0:0:64"
-target triple = "i686-pc-linux-gnu"
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
- %llvm.dbg.compositetype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }* }
- %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }* }
- %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* }
- %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 }
- %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
- at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=0]
- at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str = internal constant [17 x i8] c"deaddebuglabel.d\00", section "llvm.metadata" ; <[17 x i8]*> [#uses=1]
- at .str1 = internal constant [50 x i8] c"/home/kamm/eigenes/projekte/llvmdc/llvmdc/mytests\00", section "llvm.metadata" ; <[50 x i8]*> [#uses=1]
- at .str2 = internal constant [48 x i8] c"LLVMDC (http://www.dsource.org/projects/llvmdc)\00", section "llvm.metadata" ; <[48 x i8]*> [#uses=1]
- at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
- i32 393233,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*),
- i32 2,
- i8* getelementptr ([17 x i8]* @.str, i32 0, i32 0),
- i8* getelementptr ([50 x i8]* @.str1, i32 0, i32 0),
- i8* getelementptr ([48 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
- at .str5 = internal constant [20 x i8] c"deaddebuglabel.main\00", section "llvm.metadata" ; <[20 x i8]*> [#uses=1]
- at .str6 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.subprogram7 = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([20 x i8]* @.str5, i32 0, i32 0),
- i8* getelementptr ([20 x i8]* @.str5, i32 0, i32 0),
- i8* getelementptr ([5 x i8]* @.str6, i32 0, i32 0),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 3,
- { }* null,
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
-
-declare void @llvm.dbg.func.start({ }*) nounwind
-
-declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
-
-declare void @llvm.dbg.region.end({ }*) nounwind
-
-define fastcc i32 @main() {
-entry.main:
- call void @llvm.dbg.func.start( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram7 to { }*) )
- br i1 true, label %reachable, label %unreachable
-
-reachable: ; preds = %entry.main
- call void @llvm.dbg.region.end( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram7 to { }*) )
- ret i32 1
-
-unreachable: ; preds = %entry.main
- call void @llvm.dbg.stoppoint( i32 7, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- call void @llvm.dbg.region.end( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram7 to { }*) )
- ret i32 0
-}
Added: llvm/trunk/test/DebugInfo/inheritance.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/inheritance.ll?rev=97473&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/inheritance.ll (added)
+++ llvm/trunk/test/DebugInfo/inheritance.ll Mon Mar 1 13:02:51 2010
@@ -0,0 +1,151 @@
+; RUN: llc %s -o /dev/null
+; PR 2613.
+
+%struct.__class_type_info_pseudo = type { %struct.__type_info_pseudo }
+%struct.__type_info_pseudo = type { i8*, i8* }
+%struct.test1 = type { i32 (...)** }
+
+ at _ZTV5test1 = weak_odr constant [4 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__class_type_info_pseudo* @_ZTI5test1 to i32 (...)*), i32 (...)* bitcast (void (%struct.test1*)* @_ZN5test1D1Ev to i32 (...)*), i32 (...)* bitcast (void (%struct.test1*)* @_ZN5test1D0Ev to i32 (...)*)], align 32 ; <[4 x i32 (...)*]*> [#uses=1]
+ at _ZTI5test1 = weak_odr constant %struct.__class_type_info_pseudo { %struct.__type_info_pseudo { i8* inttoptr (i64 add (i64 ptrtoint ([0 x i32 (...)*]* @_ZTVN10__cxxabiv117__class_type_infoE to i64), i64 16) to i8*), i8* getelementptr inbounds ([7 x i8]* @_ZTS5test1, i64 0, i64 0) } }, align 16 ; <%struct.__class_type_info_pseudo*> [#uses=1]
+ at _ZTVN10__cxxabiv117__class_type_infoE = external constant [0 x i32 (...)*] ; <[0 x i32 (...)*]*> [#uses=1]
+ at _ZTS5test1 = weak_odr constant [7 x i8] c"5test1\00" ; <[7 x i8]*> [#uses=2]
+
+define i32 @main() nounwind ssp {
+entry:
+ %retval = alloca i32 ; [#uses=2]
+ %0 = alloca i32 ; [#uses=2]
+ %tst = alloca %struct.test1 ; <%struct.test1*> [#uses=1]
+ %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
+ call void @llvm.dbg.declare(metadata !{%struct.test1* %tst}, metadata !0), !dbg !21
+ call void @_ZN5test1C1Ev(%struct.test1* %tst) nounwind, !dbg !22
+ store i32 0, i32* %0, align 4, !dbg !23
+ %1 = load i32* %0, align 4, !dbg !23 ; [#uses=1]
+ store i32 %1, i32* %retval, align 4, !dbg !23
+ br label %return, !dbg !23
+
+return: ; preds = %entry
+ %retval1 = load i32* %retval, !dbg !23 ; [#uses=1]
+ ret i32 %retval1, !dbg !23
+}
+
+define linkonce_odr void @_ZN5test1C1Ev(%struct.test1* %this) nounwind ssp align 2 {
+entry:
+ %this_addr = alloca %struct.test1* ; <%struct.test1**> [#uses=2]
+ %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
+ call void @llvm.dbg.declare(metadata !{%struct.test1** %this_addr}, metadata !24), !dbg !28
+ store %struct.test1* %this, %struct.test1** %this_addr
+ %0 = load %struct.test1** %this_addr, align 8, !dbg !28 ; <%struct.test1*> [#uses=1]
+ %1 = getelementptr inbounds %struct.test1* %0, i32 0, i32 0, !dbg !28 ; [#uses=1]
+ store i32 (...)** getelementptr inbounds ([4 x i32 (...)*]* @_ZTV5test1, i64 0, i64 2), i32 (...)*** %1, align 8, !dbg !28
+ br label %return, !dbg !28
+
+return: ; preds = %entry
+ ret void, !dbg !29
+}
+
+declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
+
+define linkonce_odr void @_ZN5test1D1Ev(%struct.test1* %this) nounwind ssp align 2 {
+entry:
+ %this_addr = alloca %struct.test1* ; <%struct.test1**> [#uses=3]
+ %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
+ call void @llvm.dbg.declare(metadata !{%struct.test1** %this_addr}, metadata !32), !dbg !34
+ store %struct.test1* %this, %struct.test1** %this_addr
+ %0 = load %struct.test1** %this_addr, align 8, !dbg !35 ; <%struct.test1*> [#uses=1]
+ %1 = getelementptr inbounds %struct.test1* %0, i32 0, i32 0, !dbg !35 ; [#uses=1]
+ store i32 (...)** getelementptr inbounds ([4 x i32 (...)*]* @_ZTV5test1, i64 0, i64 2), i32 (...)*** %1, align 8, !dbg !35
+ br label %bb, !dbg !37
+
+bb: ; preds = %entry
+ %2 = trunc i32 0 to i8, !dbg !37 ; [#uses=1]
+ %toBool = icmp ne i8 %2, 0, !dbg !37 ; [#uses=1]
+ br i1 %toBool, label %bb1, label %bb2, !dbg !37
+
+bb1: ; preds = %bb
+ %3 = load %struct.test1** %this_addr, align 8, !dbg !37 ; <%struct.test1*> [#uses=1]
+ %4 = bitcast %struct.test1* %3 to i8*, !dbg !37 ; [#uses=1]
+ call void @_ZdlPv(i8* %4) nounwind, !dbg !37
+ br label %bb2, !dbg !37
+
+bb2: ; preds = %bb1, %bb
+ br label %return, !dbg !37
+
+return: ; preds = %bb2
+ ret void, !dbg !37
+}
+
+define linkonce_odr void @_ZN5test1D0Ev(%struct.test1* %this) nounwind ssp align 2 {
+entry:
+ %this_addr = alloca %struct.test1* ; <%struct.test1**> [#uses=3]
+ %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
+ call void @llvm.dbg.declare(metadata !{%struct.test1** %this_addr}, metadata !38), !dbg !40
+ store %struct.test1* %this, %struct.test1** %this_addr
+ %0 = load %struct.test1** %this_addr, align 8, !dbg !41 ; <%struct.test1*> [#uses=1]
+ %1 = getelementptr inbounds %struct.test1* %0, i32 0, i32 0, !dbg !41 ; [#uses=1]
+ store i32 (...)** getelementptr inbounds ([4 x i32 (...)*]* @_ZTV5test1, i64 0, i64 2), i32 (...)*** %1, align 8, !dbg !41
+ br label %bb, !dbg !43
+
+bb: ; preds = %entry
+ %2 = trunc i32 1 to i8, !dbg !43 ; [#uses=1]
+ %toBool = icmp ne i8 %2, 0, !dbg !43 ; [#uses=1]
+ br i1 %toBool, label %bb1, label %bb2, !dbg !43
+
+bb1: ; preds = %bb
+ %3 = load %struct.test1** %this_addr, align 8, !dbg !43 ; <%struct.test1*> [#uses=1]
+ %4 = bitcast %struct.test1* %3 to i8*, !dbg !43 ; [#uses=1]
+ call void @_ZdlPv(i8* %4) nounwind, !dbg !43
+ br label %bb2, !dbg !43
+
+bb2: ; preds = %bb1, %bb
+ br label %return, !dbg !43
+
+return: ; preds = %bb2
+ ret void, !dbg !43
+}
+
+declare void @_ZdlPv(i8*) nounwind
+
+!0 = metadata !{i32 459008, metadata !1, metadata !"tst", metadata !4, i32 13, metadata !8} ; [ DW_TAG_auto_variable ]
+!1 = metadata !{i32 458763, metadata !2, i32 0, i32 0} ; [ DW_TAG_lexical_block ]
+!2 = metadata !{i32 458763, metadata !3, i32 0, i32 0} ; [ DW_TAG_lexical_block ]
+!3 = metadata !{i32 458798, i32 0, metadata !4, metadata !"main", metadata !"main", metadata !"main", metadata !4, i32 11, metadata !5, i1 false, i1 true, i32 0, i32 0, null, i1 false} ; [ DW_TAG_subprogram ]
+!4 = metadata !{i32 458769, i32 0, i32 4, metadata !"inheritance.cpp", metadata !"/tmp/", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
+!5 = metadata !{i32 458773, metadata !4, metadata !"", metadata !4, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !6, i32 0, null} ; [ DW_TAG_subroutine_type ]
+!6 = metadata !{metadata !7}
+!7 = metadata !{i32 458788, metadata !4, metadata !"int", metadata !4, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
+!8 = metadata !{i32 458771, metadata !4, metadata !"test1", metadata !4, i32 1, i64 64, i64 64, i64 0, i32 0, null, metadata !9, i32 0, metadata !8} ; [ DW_TAG_structure_type ]
+!9 = metadata !{metadata !10, metadata !14, metadata !18}
+!10 = metadata !{i32 458765, metadata !8, metadata !"_vptr$test1", metadata !4, i32 1, i64 64, i64 64, i64 0, i32 0, metadata !11} ; [ DW_TAG_member ]
+!11 = metadata !{i32 458767, metadata !4, metadata !"", metadata !4, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !12} ; [ DW_TAG_pointer_type ]
+!12 = metadata !{i32 458767, metadata !4, metadata !"__vtbl_ptr_type", metadata !13, i32 0, i64 0, i64 0, i64 0, i32 0, metadata !5} ; [ DW_TAG_pointer_type ]
+!13 = metadata !{i32 458769, i32 0, i32 4, metadata !"", metadata !"/tmp/", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 false, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
+!14 = metadata !{i32 458798, i32 0, metadata !8, metadata !"test1", metadata !"test1", metadata !"", metadata !4, i32 1, metadata !15, i1 false, i1 false, i32 0, i32 0, null, i1 true} ; [ DW_TAG_subprogram ]
+!15 = metadata !{i32 458773, metadata !4, metadata !"", metadata !4, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !16, i32 0, null} ; [ DW_TAG_subroutine_type ]
+!16 = metadata !{null, metadata !17}
+!17 = metadata !{i32 458767, metadata !4, metadata !"", metadata !4, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !8} ; [ DW_TAG_pointer_type ]
+!18 = metadata !{i32 458798, i32 0, metadata !8, metadata !"~test1", metadata !"~test1", metadata !"", metadata !4, i32 4, metadata !19, i1 false, i1 false, i32 1, i32 0, metadata !8, i1 false} ; [ DW_TAG_subprogram ]
+!19 = metadata !{i32 458773, metadata !4, metadata !"", metadata !4, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !20, i32 0, null} ; [ DW_TAG_subroutine_type ]
+!20 = metadata !{null, metadata !17, metadata !7}
+!21 = metadata !{i32 11, i32 0, metadata !1, null}
+!22 = metadata !{i32 13, i32 0, metadata !1, null}
+!23 = metadata !{i32 14, i32 0, metadata !1, null}
+!24 = metadata !{i32 459009, metadata !25, metadata !"this", metadata !4, i32 13, metadata !26} ; [ DW_TAG_arg_variable ]
+!25 = metadata !{i32 458798, i32 0, metadata !4, metadata !"test1", metadata !"test1", metadata !"_ZN5test1C1Ev", metadata !4, i32 1, metadata !15, i1 false, i1 true, i32 0, i32 0, null, i1 false} ; [ DW_TAG_subprogram ]
+!26 = metadata !{i32 458790, metadata !4, metadata !"", metadata !4, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !27} ; [ DW_TAG_const_type ]
+!27 = metadata !{i32 458767, metadata !4, metadata !"", metadata !4, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !8} ; [ DW_TAG_pointer_type ]
+!28 = metadata !{i32 1, i32 0, metadata !25, null}
+!29 = metadata !{i32 1, i32 0, metadata !30, null}
+!30 = metadata !{i32 458763, metadata !31, i32 0, i32 0} ; [ DW_TAG_lexical_block ]
+!31 = metadata !{i32 458763, metadata !25, i32 0, i32 0} ; [ DW_TAG_lexical_block ]
+!32 = metadata !{i32 459009, metadata !33, metadata !"this", metadata !4, i32 4, metadata !26} ; [ DW_TAG_arg_variable ]
+!33 = metadata !{i32 458798, i32 0, metadata !8, metadata !"~test1", metadata !"~test1", metadata !"_ZN5test1D1Ev", metadata !4, i32 4, metadata !15, i1 false, i1 true, i32 1, i32 0, metadata !8, i1 false} ; [ DW_TAG_subprogram ]
+!34 = metadata !{i32 4, i32 0, metadata !33, null}
+!35 = metadata !{i32 5, i32 0, metadata !36, null}
+!36 = metadata !{i32 458763, metadata !33, i32 0, i32 0} ; [ DW_TAG_lexical_block ]
+!37 = metadata !{i32 6, i32 0, metadata !36, null}
+!38 = metadata !{i32 459009, metadata !39, metadata !"this", metadata !4, i32 4, metadata !26} ; [ DW_TAG_arg_variable ]
+!39 = metadata !{i32 458798, i32 0, metadata !8, metadata !"~test1", metadata !"~test1", metadata !"_ZN5test1D0Ev", metadata !4, i32 4, metadata !15, i1 false, i1 true, i32 1, i32 1, metadata !8, i1 false} ; [ DW_TAG_subprogram ]
+!40 = metadata !{i32 4, i32 0, metadata !39, null}
+!41 = metadata !{i32 5, i32 0, metadata !42, null}
+!42 = metadata !{i32 458763, metadata !39, i32 0, i32 0} ; [ DW_TAG_lexical_block ]
+!43 = metadata !{i32 6, i32 0, metadata !42, null}
From dpatel at apple.com Mon Mar 1 13:04:23 2010
From: dpatel at apple.com (Devang Patel)
Date: Mon, 01 Mar 2010 19:04:23 -0000
Subject: [llvm-commits] [llvm] r97474 -
/llvm/trunk/test/DebugInfo/funccall.ll
Message-ID: <20100301190423.7F1632A6C12C@llvm.org>
Author: dpatel
Date: Mon Mar 1 13:04:23 2010
New Revision: 97474
URL: http://llvm.org/viewvc/llvm-project?rev=97474&view=rev
Log:
Remove dead test.
Removed:
llvm/trunk/test/DebugInfo/funccall.ll
Removed: llvm/trunk/test/DebugInfo/funccall.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/funccall.ll?rev=97473&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/funccall.ll (original)
+++ llvm/trunk/test/DebugInfo/funccall.ll (removed)
@@ -1,147 +0,0 @@
-;; RUN: llc < %s
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8* }
- %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* }
- %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 }
- %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
- at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([4 x i8]* @str, i32 0, i32 0),
- i8* getelementptr ([4 x i8]* @str, i32 0, i32 0),
- i8* null,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 4,
- { }* null,
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at str = internal constant [4 x i8] c"foo\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
- i32 393233,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*),
- i32 1,
- i8* getelementptr ([11 x i8]* @str1, i32 0, i32 0),
- i8* getelementptr ([50 x i8]* @str2, i32 0, i32 0),
- i8* getelementptr ([45 x i8]* @str3, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
- at str1 = internal constant [11 x i8] c"funccall.c\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1]
- at str2 = internal constant [50 x i8] c"/Volumes/Big2/llvm/llvm/test/Regression/Debugger/\00", section "llvm.metadata" ; <[50 x i8]*> [#uses=1]
- at str3 = internal constant [45 x i8] c"4.0.1 LLVM (Apple Computer, Inc. build 5421)\00", section "llvm.metadata" ; <[45 x i8]*> [#uses=1]
- at llvm.dbg.variable = internal constant %llvm.dbg.variable.type {
- i32 393472,
- { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*),
- i8* getelementptr ([2 x i8]* @str4, i32 0, i32 0),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 5,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
- at str4 = internal constant [2 x i8] c"t\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
- at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
- i32 393252,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([4 x i8]* @str15, i32 0, i32 0),
- { }* null,
- i32 0,
- i64 32,
- i64 32,
- i64 0,
- i32 0,
- i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at str15 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.subprogram2 = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([5 x i8]* @str6, i32 0, i32 0),
- i8* getelementptr ([5 x i8]* @str6, i32 0, i32 0),
- i8* null,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 8,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*),
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at str6 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.variable3 = internal constant %llvm.dbg.variable.type {
- i32 393474,
- { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram2 to { }*),
- i8* getelementptr ([7 x i8]* @str7, i32 0, i32 0),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 8,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
- at str7 = internal constant [7 x i8] c"retval\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1]
- at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
- i32 393268,
- { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*),
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i8* getelementptr ([2 x i8]* @str4, i32 0, i32 0),
- i8* getelementptr ([2 x i8]* @str4, i32 0, i32 0),
- i8* null,
- { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*),
- i32 2,
- { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*),
- i1 true,
- i1 true,
- { }* bitcast (i32* @q to { }*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
- at str4.upgrd.1 = internal constant [2 x i8] c"q\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=0]
- at q = internal global i32 0 ; [#uses=7]
-
-declare void @llvm.dbg.func.start({ }*)
-
-declare void @llvm.dbg.stoppoint(i32, i32, { }*)
-
-declare void @llvm.dbg.declare({ }*, { }*)
-
-declare void @llvm.dbg.region.start({ }*)
-
-declare void @llvm.dbg.region.end({ }*)
-
-define void @foo() {
-entry:
- %t = alloca i32, align 4 ; [#uses=3]
- %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
- call void @llvm.dbg.func.start( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) )
- call void @llvm.dbg.stoppoint( i32 4, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %t.upgrd.2 = bitcast i32* %t to { }* ; <{ }*> [#uses=1]
- call void @llvm.dbg.declare( { }* %t.upgrd.2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*) )
- call void @llvm.dbg.stoppoint( i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %tmp = load i32* @q ; [#uses=1]
- store i32 %tmp, i32* %t
- call void @llvm.dbg.stoppoint( i32 6, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %tmp1 = load i32* %t ; [#uses=1]
- %tmp2 = add i32 %tmp1, 1 ; [#uses=1]
- store i32 %tmp2, i32* @q
- call void @llvm.dbg.stoppoint( i32 7, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- call void @llvm.dbg.region.end( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) )
- ret void
-}
-
-define i32 @main() {
-entry:
- %retval = alloca i32, align 4 ; [#uses=3]
- %tmp = alloca i32, align 4 ; [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
- call void @llvm.dbg.func.start( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram2 to { }*) )
- call void @llvm.dbg.stoppoint( i32 8, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %retval.upgrd.3 = bitcast i32* %retval to { }* ; <{ }*> [#uses=1]
- call void @llvm.dbg.declare( { }* %retval.upgrd.3, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable3 to { }*) )
- call void @llvm.dbg.stoppoint( i32 9, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- store i32 0, i32* @q
- call void @llvm.dbg.stoppoint( i32 10, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- call void (...)* bitcast (void ()* @foo to void (...)*)( )
- call void @llvm.dbg.stoppoint( i32 11, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %tmp.upgrd.4 = load i32* @q ; [#uses=1]
- %tmp1 = sub i32 %tmp.upgrd.4, 1 ; [#uses=1]
- store i32 %tmp1, i32* @q
- call void @llvm.dbg.stoppoint( i32 13, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- %tmp2 = load i32* @q ; [#uses=1]
- store i32 %tmp2, i32* %tmp
- %tmp3 = load i32* %tmp ; [#uses=1]
- store i32 %tmp3, i32* %retval
- %retval.upgrd.5 = load i32* %retval ; [#uses=1]
- call void @llvm.dbg.stoppoint( i32 14, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
- call void @llvm.dbg.region.end( { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram2 to { }*) )
- ret i32 %retval.upgrd.5
-}
From sabre at nondot.org Mon Mar 1 13:05:25 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 01 Mar 2010 19:05:25 -0000
Subject: [llvm-commits] [llvm] r97475 -
/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Message-ID: <20100301190525.F12082A6C12C@llvm.org>
Author: lattner
Date: Mon Mar 1 13:05:25 2010
New Revision: 97475
URL: http://llvm.org/viewvc/llvm-project?rev=97475&view=rev
Log:
Turn on the new isel by default. Here are some fun numbers
with a release-asserts build on x86-64-darwin10:
LLC Size:
Old: 15,426,852
New: 12,759,140 (down 2.7M)
LLI Size:
Old: 9,926,876
New: 8,864,292 (down 1.1M)
X86ISelDAGToDAG.o size:
Old: 1,401,232
New: 162,868 (down 1.3M)
Time to build X86ISelDAGToDAG.o:
Old: 67.147u 2.060s 1:09.78
New: 4.234u 0.387s 0:04.77
Modified:
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=97475&r1=97474&r2=97475&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Mon Mar 1 13:05:25 2010
@@ -24,7 +24,7 @@
#include
using namespace llvm;
-//#define ENABLE_NEW_ISEL
+#define ENABLE_NEW_ISEL
static cl::opt
From dpatel at apple.com Mon Mar 1 13:09:55 2010
From: dpatel at apple.com (Devang Patel)
Date: Mon, 01 Mar 2010 19:09:55 -0000
Subject: [llvm-commits] [llvm] r97477 -
/llvm/trunk/test/DebugInfo/globalGetElementPtr.ll
Message-ID: <20100301190955.91F112A6C12C@llvm.org>
Author: dpatel
Date: Mon Mar 1 13:09:55 2010
New Revision: 97477
URL: http://llvm.org/viewvc/llvm-project?rev=97477&view=rev
Log:
Remove test to check bugfix in handing debug info for global variables using intrinsics. Now, debug info for global variable is encoded using metadata. The old code path is now history and there is no need to have a test to check a bug fix in old code path.
Removed:
llvm/trunk/test/DebugInfo/globalGetElementPtr.ll
Removed: llvm/trunk/test/DebugInfo/globalGetElementPtr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/globalGetElementPtr.ll?rev=97476&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/globalGetElementPtr.ll (original)
+++ llvm/trunk/test/DebugInfo/globalGetElementPtr.ll (removed)
@@ -1,264 +0,0 @@
-; RUN: llc < %s
-; ModuleID = 'foo.c'
-target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
-target triple = "i686-apple-darwin8"
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, %struct.anon*, i32, i8*, i8*, i8* }
- %llvm.dbg.compositetype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, %struct.anon*, %struct.anon* }
- %llvm.dbg.derivedtype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, %struct.anon* }
- %llvm.dbg.global_variable.type = type { i32, %struct.anon*, %struct.anon*, i8*, i8*, i8*, %struct.anon*, i32, %struct.anon*, i1, i1, %struct.anon* }
- %llvm.dbg.subprogram.type = type { i32, %struct.anon*, %struct.anon*, i8*, i8*, i8*, %struct.anon*, i32, %struct.anon*, i1, i1 }
- %llvm.dbg.subrange.type = type { i32, i64, i64 }
- %llvm.dbg.variable.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, %struct.anon* }
- %struct.S271 = type { [0 x %struct.anon], %struct.anon }
- %struct.anon = type { }
- at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %struct.anon*),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0),
- i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 2,
- %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %struct.anon*),
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type {
- i32 393233,
- %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %struct.anon*),
- i32 1,
- i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0),
- i8* getelementptr ([23 x i8]* @.str1, i32 0, i32 0),
- i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
- at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str = internal constant [6 x i8] c"foo.c\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
- at .str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1]
- at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5546) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1]
- at .str3 = internal constant [4 x i8] c"var\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type {
- i32 393231,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* null,
- i32 0,
- i64 32,
- i64 32,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type {
- i32 393252,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0),
- %struct.anon* null,
- i32 0,
- i64 8,
- i64 8,
- i64 0,
- i32 0,
- i32 6 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at .str4 = internal constant [5 x i8] c"char\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.variable = internal constant %llvm.dbg.variable.type {
- i32 393474,
- %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*),
- i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 2,
- %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
- at .str5 = internal constant [7 x i8] c"retval\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1]
- at a271 = weak global [0 x %struct.S271] zeroinitializer ; <[0 x %struct.S271]*> [#uses=3]
- at llvm.dbg.subprogram6 = internal constant %llvm.dbg.subprogram.type {
- i32 393262,
- %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %struct.anon*),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0),
- i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 3,
- %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype8 to %struct.anon*),
- i1 false,
- i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at .str7 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.basictype8 = internal constant %llvm.dbg.basictype.type {
- i32 393252,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([4 x i8]* @.str9, i32 0, i32 0),
- %struct.anon* null,
- i32 0,
- i64 32,
- i64 32,
- i64 0,
- i32 0,
- i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at .str9 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.variable10 = internal constant %llvm.dbg.variable.type {
- i32 393474,
- %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*),
- i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 3,
- %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype8 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1]
- at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type {
- i32 393268,
- %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to %struct.anon*),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([5 x i8]* @.str11, i32 0, i32 0),
- i8* getelementptr ([5 x i8]* @.str11, i32 0, i32 0),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to %struct.anon*),
- i1 false,
- i1 true,
- %struct.anon* getelementptr ([0 x %struct.S271]* @a271, i32 0, i32 0, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
- at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str11 = internal constant [5 x i8] c"a271\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type {
- i32 393217,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 0,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype12 to %struct.anon*),
- %struct.anon* bitcast ([1 x %struct.anon*]* @llvm.dbg.array25 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
- at llvm.dbg.compositetype12 = internal constant %llvm.dbg.compositetype.type {
- i32 393235,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* getelementptr ([5 x i8]* @.str13, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* null,
- %struct.anon* bitcast ([2 x %struct.anon*]* @llvm.dbg.array23 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
- at .str13 = internal constant [5 x i8] c"S271\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.derivedtype14 = internal constant %llvm.dbg.derivedtype.type {
- i32 393229,
- %struct.anon* null,
- i8* getelementptr ([2 x i8]* @.str15, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype16 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at .str15 = internal constant [2 x i8] c"a\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
- at llvm.dbg.compositetype16 = internal constant %llvm.dbg.compositetype.type {
- i32 393217,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 0,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype17 to %struct.anon*),
- %struct.anon* bitcast ([1 x %struct.anon*]* @llvm.dbg.array18 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
- at llvm.dbg.compositetype17 = internal constant %llvm.dbg.compositetype.type {
- i32 393235,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* null,
- %struct.anon* bitcast ([0 x %struct.anon*]* @llvm.dbg.array to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
- at llvm.dbg.array = internal constant [0 x %struct.anon*] zeroinitializer, section "llvm.metadata" ; <[0 x %struct.anon*]*> [#uses=1]
- at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type {
- i32 393249,
- i64 0,
- i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1]
- at llvm.dbg.array18 = internal constant [1 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to %struct.anon*) ], section "llvm.metadata" ; <[1 x %struct.anon*]*> [#uses=1]
- at llvm.dbg.derivedtype19 = internal constant %llvm.dbg.derivedtype.type {
- i32 393229,
- %struct.anon* null,
- i8* getelementptr ([2 x i8]* @.str20, i32 0, i32 0),
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype21 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at .str20 = internal constant [2 x i8] c"b\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1]
- at llvm.dbg.compositetype21 = internal constant %llvm.dbg.compositetype.type {
- i32 393235,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i8* null,
- %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*),
- i32 1,
- i64 0,
- i64 8,
- i64 0,
- i32 0,
- %struct.anon* null,
- %struct.anon* bitcast ([0 x %struct.anon*]* @llvm.dbg.array22 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1]
- at llvm.dbg.array22 = internal constant [0 x %struct.anon*] zeroinitializer, section "llvm.metadata" ; <[0 x %struct.anon*]*> [#uses=1]
- at llvm.dbg.array23 = internal constant [2 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype14 to %struct.anon*), %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype19 to %struct.anon*) ], section "llvm.metadata" ; <[2 x %struct.anon*]*> [#uses=1]
- at llvm.dbg.subrange24 = internal constant %llvm.dbg.subrange.type {
- i32 393249,
- i64 0,
- i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1]
- at llvm.dbg.array25 = internal constant [1 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange24 to %struct.anon*) ], section "llvm.metadata" ; <[1 x %struct.anon*]*> [#uses=1]
-
-define i8* @var() {
-entry:
- %retval = alloca i8* ; [#uses=3]
- %tmp = alloca i8* ; [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
- call void @llvm.dbg.func.start( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*) )
- call void @llvm.dbg.stoppoint( i32 2, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
- %retval1 = bitcast i8** %retval to %struct.anon* ; <%struct.anon*> [#uses=1]
- call void @llvm.dbg.declare( %struct.anon* %retval1, %struct.anon* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to %struct.anon*) )
- bitcast %struct.S271* getelementptr ([0 x %struct.S271]* @a271, i32 0, i32 0) to i8* ; :0 [#uses=0]
- store i8* bitcast ([0 x %struct.S271]* @a271 to i8*), i8** %tmp, align 4
- %tmp2 = load i8** %tmp, align 4 ; [#uses=1]
- store i8* %tmp2, i8** %retval, align 4
- br label %return
-
-return: ; preds = %entry
- %retval3 = load i8** %retval ; [#uses=1]
- call void @llvm.dbg.stoppoint( i32 2, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
- call void @llvm.dbg.region.end( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*) )
- ret i8* %retval3
-}
-
-declare void @llvm.dbg.func.start(%struct.anon*) nounwind
-
-declare void @llvm.dbg.stoppoint(i32, i32, %struct.anon*) nounwind
-
-declare void @llvm.dbg.declare(%struct.anon*, %struct.anon*) nounwind
-
-declare void @llvm.dbg.region.end(%struct.anon*) nounwind
-
-define i32 @main() {
-entry:
- %retval = alloca i32 ; [#uses=2]
- %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
- call void @llvm.dbg.func.start( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*) )
- call void @llvm.dbg.stoppoint( i32 3, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
- %retval1 = bitcast i32* %retval to %struct.anon* ; <%struct.anon*> [#uses=1]
- call void @llvm.dbg.declare( %struct.anon* %retval1, %struct.anon* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable10 to %struct.anon*) )
- br label %return
-
-return: ; preds = %entry
- %retval2 = load i32* %retval ; [#uses=1]
- call void @llvm.dbg.stoppoint( i32 3, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) )
- call void @llvm.dbg.region.end( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*) )
- ret i32 %retval2
-}
From dpatel at apple.com Mon Mar 1 13:14:25 2010
From: dpatel at apple.com (Devang Patel)
Date: Mon, 01 Mar 2010 19:14:25 -0000
Subject: [llvm-commits] [llvm] r97480 -
/llvm/trunk/test/Transforms/GlobalOpt/2009-03-03-dbg.ll
Message-ID: <20100301191425.E13DB2A6C12C@llvm.org>
Author: dpatel
Date: Mon Mar 1 13:14:25 2010
New Revision: 97480
URL: http://llvm.org/viewvc/llvm-project?rev=97480&view=rev
Log:
Remove this test because it checks wheter optimizer handled @llvm.dbg.global_variable appropriately or not. LLVM does not use this scheme to encode debug info for global variables any more.
Removed:
llvm/trunk/test/Transforms/GlobalOpt/2009-03-03-dbg.ll
Removed: llvm/trunk/test/Transforms/GlobalOpt/2009-03-03-dbg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/2009-03-03-dbg.ll?rev=97479&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GlobalOpt/2009-03-03-dbg.ll (original)
+++ llvm/trunk/test/Transforms/GlobalOpt/2009-03-03-dbg.ll (removed)
@@ -1,54 +0,0 @@
-; RUN: opt < %s -globalopt -S | not grep global_variable42
-; XFAIL: *
-
- %llvm.dbg.anchor.type = type { i32, i32 }
- %llvm.dbg.basictype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, i32 }
- %llvm.dbg.compile_unit.type = type { i32, { }*, i32, i8*, i8*, i8*, i1, i1, i8*, i32 }
- %llvm.dbg.composite.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }*, { }*, i32 }
- %llvm.dbg.derivedtype.type = type { i32, { }*, i8*, { }*, i32, i64, i64, i64, i32, { }* }
- %llvm.dbg.global_variable.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1, { }* }
- %llvm.dbg.subprogram.type = type { i32, { }*, { }*, i8*, i8*, i8*, { }*, i32, { }*, i1, i1 }
- %llvm.dbg.subrange.type = type { i32, i64, i64 }
- %llvm.dbg.variable.type = type { i32, { }*, i8*, { }*, i32, { }* }
- at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str = internal constant [4 x i8] c"a.c\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at .str1 = internal constant [5 x i8] c"/tmp\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at .str2 = internal constant [57 x i8] c"4.2.1 (Based on Apple Inc. build 5636) (LLVM build 2099)\00", section "llvm.metadata" ; <[57 x i8]*> [#uses=1]
- at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { i32 458769, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to { }*), i32 1, i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str1, i32 0, i32 0), i8* getelementptr ([57 x i8]* @.str2, i32 0, i32 0), i1 true, i1 false, i8* null, i32 0 }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1]
- at .str3 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1]
- at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { i32 458788, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1]
- at llvm.dbg.array = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1]
- at llvm.dbg.composite = internal constant %llvm.dbg.composite.type { i32 458773, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 0, i64 0, i64 0, i32 0, { }* null, { }* bitcast ([1 x { }*]* @llvm.dbg.array to { }*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str4 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1]
- at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { i32 458798, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 3, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite to { }*), i1 false, i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1]
- at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { i32 458767, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 32, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1]
- at .str5 = internal constant [6 x i8] c"i_ptr\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1]
- at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { i32 459008, { }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*), i8* getelementptr ([6 x i8]* @.str5, i32 0, i32 0), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 5, { }* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to { }*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=0]
- at sillyArray.1433 = internal global [8 x i32] [ i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19 ] ; <[8 x i32]*> [#uses=1]
- at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type { i32 458785, i64 0, i64 7 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1]
- at llvm.dbg.array6 = internal constant [1 x { }*] [ { }* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to { }*) ], section "llvm.metadata" ; <[1 x { }*]*> [#uses=1]
- at llvm.dbg.composite7 = internal constant %llvm.dbg.composite.type { i32 458753, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 0, i64 256, i64 32, i64 0, i32 0, { }* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to { }*), { }* bitcast ([1 x { }*]* @llvm.dbg.array6 to { }*), i32 0 }, section "llvm.metadata" ; <%llvm.dbg.composite.type*> [#uses=1]
- at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 458752, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1]
- at .str8 = internal constant [16 x i8] c"sillyArray.1433\00", section "llvm.metadata" ; <[16 x i8]*> [#uses=1]
- at .str9 = internal constant [11 x i8] c"sillyArray\00", section "llvm.metadata" ; <[11 x i8]*> [#uses=1]
- at llvm.dbg.global_variable42 = internal constant %llvm.dbg.global_variable.type { i32 458804, { }* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to { }*), { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i8* getelementptr ([16 x i8]* @.str8, i32 0, i32 0), i8* getelementptr ([11 x i8]* @.str9, i32 0, i32 0), i8* null, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*), i32 4, { }* bitcast (%llvm.dbg.composite.type* @llvm.dbg.composite7 to { }*), i1 true, i1 true, { }* bitcast ([8 x i32]* @sillyArray.1433 to { }*) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0]
-
-define i32 @main() nounwind {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
- call void @llvm.dbg.func.start({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
- call void @llvm.dbg.stoppoint(i32 5, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- call void @llvm.dbg.stoppoint(i32 6, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- call void @llvm.dbg.stoppoint(i32 6, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*))
- call void @llvm.dbg.region.end({ }* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*))
- ret i32 0
-}
-
-declare void @llvm.dbg.func.start({ }*) nounwind
-
-declare void @llvm.dbg.declare({ }*, { }*) nounwind
-
-declare void @llvm.dbg.stoppoint(i32, i32, { }*) nounwind
-
-declare void @llvm.dbg.region.end({ }*) nounwind
From johnny.chen at apple.com Mon Mar 1 13:22:00 2010
From: johnny.chen at apple.com (Johnny Chen)
Date: Mon, 01 Mar 2010 19:22:00 -0000
Subject: [llvm-commits] [llvm] r97481 - in /llvm/trunk/lib/Target/ARM:
ARMInstrFormats.td ARMInstrInfo.td
Message-ID: <20100301192200.BC8282A6C12C@llvm.org>
Author: johnny
Date: Mon Mar 1 13:22:00 2010
New Revision: 97481
URL: http://llvm.org/viewvc/llvm-project?rev=97481&view=rev
Log:
Added STRHT for disassembly only and fixed a bug in AI3sthpo class where the W
bit should be set to 0 instead of 1.
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrFormats.td?rev=97481&r1=97480&r2=97481&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrFormats.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrFormats.td Mon Mar 1 13:22:00 2010
@@ -815,7 +815,7 @@
let Inst{6} = 0; // S bit
let Inst{7} = 1;
let Inst{20} = 0; // L bit
- let Inst{21} = 1; // W bit
+ let Inst{21} = 0; // W bit
let Inst{24} = 0; // P bit
let Inst{27-25} = 0b000;
}
Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=97481&r1=97480&r2=97481&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Mon Mar 1 13:22:00 2010
@@ -1260,7 +1260,7 @@
"strd", "\t$src1, $src2, [$base], $offset",
"$base = $base_wb", []>;
-// STRT and STRBT are for disassembly only.
+// STRT, STRBT, and STRHT are for disassembly only.
def STRT : AI2stwpo<(outs GPR:$base_wb),
(ins GPR:$src, GPR:$base,am2offset:$offset),
@@ -1278,6 +1278,14 @@
let Inst{21} = 1; // overwrite
}
+def STRHT: AI3sthpo<(outs GPR:$base_wb),
+ (ins GPR:$src, GPR:$base,am3offset:$offset),
+ StMiscFrm, IIC_iStoreru,
+ "strht", "\t$src, [$base], $offset", "$base = $base_wb",
+ [/* For disassembly only; pattern left blank */]> {
+ let Inst{21} = 1; // overwrite
+}
+
//===----------------------------------------------------------------------===//
// Load / store multiple Instructions.
//
From sabre at nondot.org Mon Mar 1 13:24:18 2010
From: sabre at nondot.org (Chris Lattner)
Date: Mon, 01 Mar 2010 19:24:18 -0000
Subject: [llvm-commits] [llvm] r97483 - in /llvm/trunk:
docs/AliasAnalysis.html docs/Passes.html docs/ReleaseNotes.html
include/llvm/Analysis/Passes.h include/llvm/LinkAllPasses.h
lib/Analysis/IPA/Andersens.cpp
Message-ID: <20100301192418.388FE2A6C12C@llvm.org>
Author: lattner
Date: Mon Mar 1 13:24:17 2010
New Revision: 97483
URL: http://llvm.org/viewvc/llvm-project?rev=97483&view=rev
Log:
remove anders-aa from mainline, it isn't maintained and is
tantalyzing enough that people keep trying to use it.
Removed:
llvm/trunk/lib/Analysis/IPA/Andersens.cpp
Modified:
llvm/trunk/docs/AliasAnalysis.html
llvm/trunk/docs/Passes.html
llvm/trunk/docs/ReleaseNotes.html
llvm/trunk/include/llvm/Analysis/Passes.h
llvm/trunk/include/llvm/LinkAllPasses.h
Modified: llvm/trunk/docs/AliasAnalysis.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AliasAnalysis.html?rev=97483&r1=97482&r2=97483&view=diff
==============================================================================
--- llvm/trunk/docs/AliasAnalysis.html (original)
+++ llvm/trunk/docs/AliasAnalysis.html Mon Mar 1 13:24:17 2010
@@ -403,7 +403,7 @@
href="#basic-aa">basicaa and no-aa
passes) every alias analysis pass chains to another alias analysis
implementation (for example, the user can specify "-basicaa -ds-aa
--anders-aa -licm" to get the maximum benefit from the three alias
+-licm" to get the maximum benefit from both alias
analyses). The alias analysis class automatically takes care of most of this
for methods that you don't override. For methods that you do override, in code
paths that return a conservative MayAlias or Mod/Ref result, simply return
@@ -705,25 +705,6 @@
-
-
-
-
The -anders-aa pass implements the well-known "Andersen's algorithm"
-for interprocedural alias analysis. This algorithm is a subset-based,
-flow-insensitive, context-insensitive, and field-insensitive alias analysis that
-is widely believed to be fairly precise. Unfortunately, this algorithm is also
-O(N3). The LLVM implementation currently does not implement any of
-the refinements (such as "online cycle elimination" or "offline variable
-substitution") to improve its efficiency, so it can be quite slow in common
-cases.
-
-
-
-
-
-
@@ -855,7 +836,7 @@
These passes are useful for evaluating the various alias analysis
-implementations. You can use them with commands like 'opt -anders-aa -ds-aa
+implementations. You can use them with commands like 'opt -ds-aa
-aa-eval foo.bc -disable-output -stats'.
Modified: llvm/trunk/docs/Passes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Passes.html?rev=97483&r1=97482&r2=97483&view=diff
==============================================================================
--- llvm/trunk/docs/Passes.html (original)
+++ llvm/trunk/docs/Passes.html Mon Mar 1 13:24:17 2010
@@ -75,7 +75,6 @@
| ANALYSIS PASSES |
| Option | Name |
| -aa-eval | Exhaustive Alias Analysis Precision Evaluator |
-| -anders-aa | Andersen's Interprocedural Alias Analysis |
| -basicaa | Basic Alias Analysis (default AA impl) |
| -basiccg | Basic CallGraph Construction |
| -codegenprepare | Optimize for code generation |
@@ -204,80 +203,6 @@
-
-
- This is an implementation of Andersen's interprocedural alias
- analysis
-
-
-
- In pointer analysis terms, this is a subset-based, flow-insensitive,
- field-sensitive, and context-insensitive algorithm pointer algorithm.
-
-
-
- This algorithm is implemented as three stages:
-
-
-
- - Object identification.
- - Inclusion constraint identification.
- - Offline constraint graph optimization.
- - Inclusion constraint solving.
-
-
-
- The object identification stage identifies all of the memory objects in the
- program, which includes globals, heap allocated objects, and stack allocated
- objects.
-
-
-
- The inclusion constraint identification stage finds all inclusion constraints
- in the program by scanning the program, looking for pointer assignments and
- other statements that effect the points-to graph. For a statement like
- A = B, this statement is processed to
- indicate that A can point to anything that B can point
- to. Constraints can handle copies, loads, and stores, and address taking.
-
-
-
- The offline constraint graph optimization portion includes offline variable
- substitution algorithms intended to computer pointer and location
- equivalences. Pointer equivalences are those pointers that will have the
- same points-to sets, and location equivalences are those variables that
- always appear together in points-to sets.
-
-
-
- The inclusion constraint solving phase iteratively propagates the inclusion
- constraints until a fixed point is reached. This is an O(n??)
- algorithm.
-
-
-
- Function constraints are handled as if they were structs with X
- fields. Thus, an access to argument X of function Y is
- an access to node index getNode(Y) + X.
- This representation allows handling of indirect calls without any issues. To
- wit, an indirect call Y(a,b) is
- equivalent to *(Y + 1) = a, *(Y + 2) =
- b. The return node for a function F is always
- located at getNode(F) + CallReturnPos. The arguments
- start at getNode(F) + CallArgPos.
-
-
-
- Please keep in mind that the current andersen's pass has many known
- problems and bugs. It should be considered "research quality".
-
-
-
-
-
-
Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=97483&r1=97482&r2=97483&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Mon Mar 1 13:24:17 2010
@@ -66,7 +66,6 @@
llvm/Analysis/PointerTracking.h => Edwin wants this, consider for 2.8.
ABCD, SCCVN, GEPSplitterPass
MSIL backend?
- AndersAA -> Unsupported, zap after branch.
-->
@@ -734,7 +733,6 @@
experimental.
- The llc "-filetype=asm" (the default) is the only
supported value for this option. The ELF writer is experimental.
-- The implementation of Andersen's Alias Analysis has many known bugs.
Modified: llvm/trunk/include/llvm/Analysis/Passes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/Passes.h?rev=97483&r1=97482&r2=97483&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/Passes.h (original)
+++ llvm/trunk/include/llvm/Analysis/Passes.h Mon Mar 1 13:24:17 2010
@@ -81,13 +81,6 @@
//===--------------------------------------------------------------------===//
//
- // createAndersensPass - This pass implements Andersen's interprocedural alias
- // analysis.
- //
- ModulePass *createAndersensPass();
-
- //===--------------------------------------------------------------------===//
- //
// createProfileLoaderPass - This pass loads information from a profile dump
// file.
//
Modified: llvm/trunk/include/llvm/LinkAllPasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LinkAllPasses.h?rev=97483&r1=97482&r2=97483&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LinkAllPasses.h (original)
+++ llvm/trunk/include/llvm/LinkAllPasses.h Mon Mar 1 13:24:17 2010
@@ -46,7 +46,6 @@
(void) llvm::createAggressiveDCEPass();
(void) llvm::createAliasAnalysisCounterPass();
(void) llvm::createAliasDebugger();
- (void) llvm::createAndersensPass();
(void) llvm::createArgumentPromotionPass();
(void) llvm::createStructRetPromotionPass();
(void) llvm::createBasicAliasAnalysisPass();
Removed: llvm/trunk/lib/Analysis/IPA/Andersens.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=97482&view=auto
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp (removed)
@@ -1,2868 +0,0 @@
-//===- Andersens.cpp - Andersen's Interprocedural Alias Analysis ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines an implementation of Andersen's interprocedural alias
-// analysis
-//
-// In pointer analysis terms, this is a subset-based, flow-insensitive,
-// field-sensitive, and context-insensitive algorithm pointer algorithm.
-//
-// This algorithm is implemented as three stages:
-// 1. Object identification.
-// 2. Inclusion constraint identification.
-// 3. Offline constraint graph optimization
-// 4. Inclusion constraint solving.
-//
-// The object identification stage identifies all of the memory objects in the
-// program, which includes globals, heap allocated objects, and stack allocated
-// objects.
-//
-// The inclusion constraint identification stage finds all inclusion constraints
-// in the program by scanning the program, looking for pointer assignments and
-// other statements that effect the points-to graph. For a statement like "A =
-// B", this statement is processed to indicate that A can point to anything that
-// B can point to. Constraints can handle copies, loads, and stores, and
-// address taking.
-//
-// The offline constraint graph optimization portion includes offline variable
-// substitution algorithms intended to compute pointer and location
-// equivalences. Pointer equivalences are those pointers that will have the
-// same points-to sets, and location equivalences are those variables that
-// always appear together in points-to sets. It also includes an offline
-// cycle detection algorithm that allows cycles to be collapsed sooner
-// during solving.
-//
-// The inclusion constraint solving phase iteratively propagates the inclusion
-// constraints until a fixed point is reached. This is an O(N^3) algorithm.
-//
-// Function constraints are handled as if they were structs with X fields.
-// Thus, an access to argument X of function Y is an access to node index
-// getNode(Y) + X. This representation allows handling of indirect calls
-// without any issues. To wit, an indirect call Y(a,b) is equivalent to
-// *(Y + 1) = a, *(Y + 2) = b.
-// The return node for a function is always located at getNode(F) +
-// CallReturnPos. The arguments start at getNode(F) + CallArgPos.
-//
-// Future Improvements:
-// Use of BDD's.
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "anders-aa"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/Support/InstVisitor.h"
-#include "llvm/Analysis/AliasAnalysis.h"
-#include "llvm/Analysis/MemoryBuiltins.h"
-#include "llvm/Analysis/Passes.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/System/Atomic.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/SparseBitVector.h"
-#include "llvm/ADT/DenseSet.h"
-#include
-#include
-#include
-#include