From eli.friedman at gmail.com Mon Apr 18 00:02:31 2011 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 18 Apr 2011 05:02:31 -0000 Subject: [llvm-commits] [llvm] r129687 - in /llvm/trunk: include/llvm/MC/MCContext.h lib/MC/MCContext.cpp Message-ID: <20110418050231.B648C2A6C12C@llvm.org> Author: efriedma Date: Mon Apr 18 00:02:31 2011 New Revision: 129687 URL: http://llvm.org/viewvc/llvm-project?rev=129687&view=rev Log: Make the StringMaps attached to MCContext use the MCContext's allocator; reduces the number of calls to malloc(). Modified: llvm/trunk/include/llvm/MC/MCContext.h llvm/trunk/lib/MC/MCContext.cpp Modified: llvm/trunk/include/llvm/MC/MCContext.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCContext.h?rev=129687&r1=129686&r2=129687&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCContext.h (original) +++ llvm/trunk/include/llvm/MC/MCContext.h Mon Apr 18 00:02:31 2011 @@ -45,12 +45,18 @@ const TargetAsmInfo *TAI; + /// Allocator - Allocator object used for creating machine code objects. + /// + /// We use a bump pointer allocator to avoid the need to track all allocated + /// objects. + BumpPtrAllocator Allocator; + /// Symbols - Bindings of names to symbols. - StringMap Symbols; + StringMap Symbols; /// UsedNames - Keeps tracks of names that were used both for used declared /// and artificial symbols. - StringMap UsedNames; + StringMap UsedNames; /// NextUniqueID - The next ID to dole out to an unnamed assembler temporary /// symbol. @@ -96,12 +102,6 @@ /// the elements were added. std::vector MCLineSectionOrder; - /// Allocator - Allocator object used for creating machine code objects. - /// - /// We use a bump pointer allocator to avoid the need to track all allocated - /// objects. - BumpPtrAllocator Allocator; - void *MachOUniquingMap, *ELFUniquingMap, *COFFUniquingMap; MCSymbol *CreateSymbol(StringRef Name); Modified: llvm/trunk/lib/MC/MCContext.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=129687&r1=129686&r2=129687&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCContext.cpp (original) +++ llvm/trunk/lib/MC/MCContext.cpp Mon Apr 18 00:02:31 2011 @@ -27,7 +27,9 @@ MCContext::MCContext(const MCAsmInfo &mai, const TargetAsmInfo *tai) : - MAI(mai), TAI(tai), NextUniqueID(0), + MAI(mai), TAI(tai), + Allocator(), Symbols(Allocator), UsedNames(Allocator), + NextUniqueID(0), CurrentDwarfLoc(0,0,0,DWARF2_FLAG_IS_STMT,0,0), AllowTemporaryLabels(true) { MachOUniquingMap = 0; From eli.friedman at gmail.com Mon Apr 18 00:38:58 2011 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 18 Apr 2011 05:38:58 -0000 Subject: [llvm-commits] [llvm] r129688 - /llvm/trunk/lib/MC/MCObjectStreamer.cpp Message-ID: <20110418053858.8A5092A6C12C@llvm.org> Author: efriedma Date: Mon Apr 18 00:38:58 2011 New Revision: 129688 URL: http://llvm.org/viewvc/llvm-project?rev=129688&view=rev Log: More malloc elimination: it's a bad idea to use raw_svector_ostream on a small heap-allocated SmallString because it unconditionally forces a malloc. Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=129688&r1=129687&r2=129688&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Mon Apr 18 00:38:58 2011 @@ -191,8 +191,10 @@ void MCObjectStreamer::EmitInstToFragment(const MCInst &Inst) { MCInstFragment *IF = new MCInstFragment(Inst, getCurrentSectionData()); - raw_svector_ostream VecOS(IF->getCode()); + SmallString<128> Code; + raw_svector_ostream VecOS(Code); getAssembler().getEmitter().EncodeInstruction(Inst, VecOS, IF->getFixups()); + IF->getCode().append(Code.begin(), Code.end()); } static const MCExpr *BuildSymbolDiff(MCContext &Context, From eli.friedman at gmail.com Mon Apr 18 00:54:54 2011 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 18 Apr 2011 05:54:54 -0000 Subject: [llvm-commits] [llvm] r129689 - /llvm/trunk/lib/MC/MCObjectStreamer.cpp Message-ID: <20110418055454.AA2752A6C12C@llvm.org> Author: efriedma Date: Mon Apr 18 00:54:54 2011 New Revision: 129689 URL: http://llvm.org/viewvc/llvm-project?rev=129689&view=rev Log: Revert r129688; it's breaking buildbots. Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=129689&r1=129688&r2=129689&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Mon Apr 18 00:54:54 2011 @@ -191,10 +191,8 @@ void MCObjectStreamer::EmitInstToFragment(const MCInst &Inst) { MCInstFragment *IF = new MCInstFragment(Inst, getCurrentSectionData()); - SmallString<128> Code; - raw_svector_ostream VecOS(Code); + raw_svector_ostream VecOS(IF->getCode()); getAssembler().getEmitter().EncodeInstruction(Inst, VecOS, IF->getFixups()); - IF->getCode().append(Code.begin(), Code.end()); } static const MCExpr *BuildSymbolDiff(MCContext &Context, From sabre at nondot.org Mon Apr 18 01:15:35 2011 From: sabre at nondot.org (Chris Lattner) Date: Mon, 18 Apr 2011 06:15:35 -0000 Subject: [llvm-commits] [llvm] r129690 - /llvm/trunk/test/CodeGen/X86/lock-inst-encoding.ll Message-ID: <20110418061535.7F2782A6C12C@llvm.org> Author: lattner Date: Mon Apr 18 01:15:35 2011 New Revision: 129690 URL: http://llvm.org/viewvc/llvm-project?rev=129690&view=rev Log: relax this test to just check that the lock prefix is encoded properly, and to not rely on the register allocator's arbitrary operand choices. Modified: llvm/trunk/test/CodeGen/X86/lock-inst-encoding.ll Modified: llvm/trunk/test/CodeGen/X86/lock-inst-encoding.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/lock-inst-encoding.ll?rev=129690&r1=129689&r2=129690&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/lock-inst-encoding.ll (original) +++ llvm/trunk/test/CodeGen/X86/lock-inst-encoding.ll Mon Apr 18 01:15:35 2011 @@ -4,8 +4,7 @@ target triple = "x86_64-apple-darwin10.0.0" ; CHECK: f0: -; CHECK: addq %rcx, (%rdi) -; CHECK: # encoding: [0xf0,0x48,0x01,0x0f] +; CHECK: addq %{{.*}}, ({{.*}}){{.*}}encoding: [0xf0, ; CHECK: ret define void @f0(i64* %a0) nounwind { %t0 = and i64 1, 1 From sabre at nondot.org Mon Apr 18 01:22:33 2011 From: sabre at nondot.org (Chris Lattner) Date: Mon, 18 Apr 2011 06:22:33 -0000 Subject: [llvm-commits] [llvm] r129691 - in /llvm/trunk: test/CodeGen/X86/fast-isel-x86-64.ll utils/TableGen/CodeGenDAGPatterns.h utils/TableGen/FastISelEmitter.cpp Message-ID: <20110418062234.14A202A6C12C@llvm.org> Author: lattner Date: Mon Apr 18 01:22:33 2011 New Revision: 129691 URL: http://llvm.org/viewvc/llvm-project?rev=129691&view=rev Log: Implement major new fastisel functionality: the matcher can now handle immediates with value constraints on them (when defined as ImmLeaf's). This is particularly important for X86-64, where almost all reg/imm instructions take a i64immSExt32 immediate operand, which has a value constraint. Before this patch we ended up iseling the examples into such amazing code as: movabsq $7, %rax imulq %rax, %rdi movq %rdi, %rax ret now we produce: imulq $7, %rdi, %rax ret This dramatically shrinks the generated code at -O0 on x86-64. Modified: llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h llvm/trunk/utils/TableGen/FastISelEmitter.cpp Modified: llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll?rev=129691&r1=129690&r2=129691&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll Mon Apr 18 01:22:33 2011 @@ -93,3 +93,21 @@ ; CHECK: leal (,%rdi,8), %eax } + +; rdar://9289507 - folding of immediates into 64-bit operations. +define i64 @test8(i64 %x) nounwind ssp { +entry: + %add = add nsw i64 %x, 7 + ret i64 %add + +; CHECK: test8: +; CHECK: addq $7, %rdi +} + +define i64 @test9(i64 %x) nounwind ssp { +entry: + %add = mul nsw i64 %x, 7 + ret i64 %add +; CHECK: test9: +; CHECK: imulq $7, %rdi, %rax +} Modified: llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h?rev=129691&r1=129690&r2=129691&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h (original) +++ llvm/trunk/utils/TableGen/CodeGenDAGPatterns.h Mon Apr 18 01:22:33 2011 @@ -257,6 +257,17 @@ /// isAlwaysTrue - Return true if this is a noop predicate. bool isAlwaysTrue() const; + bool isImmediatePattern() const { return !getImmCode().empty(); } + + /// getImmediatePredicateCode - Return the code that evaluates this pattern if + /// this is an immediate predicate. It is an error to call this on a + /// non-immediate pattern. + std::string getImmediatePredicateCode() const { + std::string Result = getImmCode(); + assert(!Result.empty() && "Isn't an immediate pattern!"); + return Result; + } + bool operator==(const TreePredicateFn &RHS) const { return PatFragRec == RHS.PatFragRec; Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=129691&r1=129690&r2=129691&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Mon Apr 18 01:22:33 2011 @@ -35,6 +35,33 @@ std::string SubRegNo; std::vector* PhysRegs; }; + +/// ImmPredicateSet - This uniques predicates (represented as a string) and +/// gives them unique (small) integer ID's that start at 0. +class ImmPredicateSet { + DenseMap ImmIDs; + std::vector PredsByName; +public: + + unsigned getIDFor(TreePredicateFn Pred) { + unsigned &Entry = ImmIDs[Pred.getOrigPatFragRecord()]; + if (Entry == 0) { + PredsByName.push_back(Pred); + Entry = PredsByName.size(); + } + return Entry-1; + } + + const TreePredicateFn &getPredicate(unsigned i) { + assert(i < PredsByName.size()); + return PredsByName[i]; + } + + typedef std::vector::const_iterator iterator; + iterator begin() const { return PredsByName.begin(); } + iterator end() const { return PredsByName.end(); } + +}; /// OperandsSignature - This class holds a description of a list of operand /// types. It has utility methods for emitting text based on the operands. @@ -48,49 +75,110 @@ OpKind() : Repr(OK_Invalid) {} bool operator<(OpKind RHS) const { return Repr < RHS.Repr; } + bool operator==(OpKind RHS) const { return Repr == RHS.Repr; } static OpKind getReg() { OpKind K; K.Repr = OK_Reg; return K; } static OpKind getFP() { OpKind K; K.Repr = OK_FP; return K; } - static OpKind getImm() { OpKind K; K.Repr = OK_Imm; return K; } + static OpKind getImm(unsigned V) { + assert((unsigned)OK_Imm+V < 128 && + "Too many integer predicates for the 'Repr' char"); + OpKind K; K.Repr = OK_Imm+V; return K; + } bool isReg() const { return Repr == OK_Reg; } bool isFP() const { return Repr == OK_FP; } - bool isImm() const { return Repr == OK_Imm; } + bool isImm() const { return Repr >= OK_Imm; } + + unsigned getImmCode() const { assert(isImm()); return Repr-OK_Imm; } - void printManglingSuffix(raw_ostream &OS) const { + void printManglingSuffix(raw_ostream &OS, ImmPredicateSet &ImmPredicates, + bool StripImmCodes) const { if (isReg()) OS << 'r'; else if (isFP()) OS << 'f'; - else + else { OS << 'i'; + if (!StripImmCodes) + if (unsigned Code = getImmCode()) + OS << "_" << ImmPredicates.getPredicate(Code-1).getFnName(); + } } }; + SmallVector Operands; bool operator<(const OperandsSignature &O) const { return Operands < O.Operands; } + bool operator==(const OperandsSignature &O) const { + return Operands == O.Operands; + } bool empty() const { return Operands.empty(); } + bool hasAnyImmediateCodes() const { + for (unsigned i = 0, e = Operands.size(); i != e; ++i) + if (Operands[i].isImm() && Operands[i].getImmCode() != 0) + return true; + return false; + } + + /// getWithoutImmCodes - Return a copy of this with any immediate codes forced + /// to zero. + OperandsSignature getWithoutImmCodes() const { + OperandsSignature Result; + for (unsigned i = 0, e = Operands.size(); i != e; ++i) + if (!Operands[i].isImm()) + Result.Operands.push_back(Operands[i]); + else + Result.Operands.push_back(OpKind::getImm(0)); + return Result; + } + + void emitImmediatePredicate(raw_ostream &OS, ImmPredicateSet &ImmPredicates) { + bool EmittedAnything = false; + for (unsigned i = 0, e = Operands.size(); i != e; ++i) { + if (!Operands[i].isImm()) continue; + + unsigned Code = Operands[i].getImmCode(); + if (Code == 0) continue; + + if (EmittedAnything) + OS << " &&\n "; + + TreePredicateFn PredFn = ImmPredicates.getPredicate(Code-1); + + // Emit the type check. + OS << "VT == " + << getEnumName(PredFn.getOrigPatFragRecord()->getTree(0)->getType(0)) + << " && "; + + + OS << PredFn.getFnName() << "(imm" << i <<')'; + EmittedAnything = true; + } + } + /// initialize - Examine the given pattern and initialize the contents /// of the Operands array accordingly. Return true if all the operands /// are supported, false otherwise. /// bool initialize(TreePatternNode *InstPatNode, const CodeGenTarget &Target, - MVT::SimpleValueType VT) { - - if (!InstPatNode->isLeaf()) { - if (InstPatNode->getOperator()->getName() == "imm") { - Operands.push_back(OpKind::getImm()); - return true; - } - if (InstPatNode->getOperator()->getName() == "fpimm") { - Operands.push_back(OpKind::getFP()); - return true; - } + MVT::SimpleValueType VT, + ImmPredicateSet &ImmediatePredicates) { + if (InstPatNode->isLeaf()) + return false; + + if (InstPatNode->getOperator()->getName() == "imm") { + Operands.push_back(OpKind::getImm(0)); + return true; + } + + if (InstPatNode->getOperator()->getName() == "fpimm") { + Operands.push_back(OpKind::getFP()); + return true; } const CodeGenRegisterClass *DstRC = 0; @@ -98,17 +186,36 @@ for (unsigned i = 0, e = InstPatNode->getNumChildren(); i != e; ++i) { TreePatternNode *Op = InstPatNode->getChild(i); + // Handle imm operands specially. + if (!Op->isLeaf() && Op->getOperator()->getName() == "imm") { + unsigned PredNo = 0; + if (!Op->getPredicateFns().empty()) { + // If there is more than one predicate weighing in on this operand + // then we don't handle it. This doesn't typically happen for + // immediates anyway. + if (Op->getPredicateFns().size() > 1 || + !Op->getPredicateFns()[0].isImmediatePattern()) + return false; + + PredNo = ImmediatePredicates.getIDFor(Op->getPredicateFns()[0])+1; + } + + // Handle unmatched immediate sizes here. + //if (Op->getType(0) != VT) + // return false; + + Operands.push_back(OpKind::getImm(PredNo)); + continue; + } + + // For now, filter out any operand with a predicate. // For now, filter out any operand with multiple values. if (!Op->getPredicateFns().empty() || Op->getNumTypes() != 1) return false; if (!Op->isLeaf()) { - if (Op->getOperator()->getName() == "imm") { - Operands.push_back(OpKind::getImm()); - continue; - } - if (Op->getOperator()->getName() == "fpimm") { + if (Op->getOperator()->getName() == "fpimm") { Operands.push_back(OpKind::getFP()); continue; } @@ -216,8 +323,9 @@ } - void PrintManglingSuffix(raw_ostream &OS, - const std::vector &PR) const { + void PrintManglingSuffix(raw_ostream &OS, const std::vector &PR, + ImmPredicateSet &ImmPredicates, + bool StripImmCodes = false) const { for (unsigned i = 0, e = Operands.size(); i != e; ++i) { if (PR[i] != "") // Implicit physical register operand. e.g. Instruction::Mul expect to @@ -226,13 +334,14 @@ // like a binary instruction except for the very inner FastEmitInst_* // call. continue; - Operands[i].printManglingSuffix(OS); + Operands[i].printManglingSuffix(OS, ImmPredicates, StripImmCodes); } } - void PrintManglingSuffix(raw_ostream &OS) const { + void PrintManglingSuffix(raw_ostream &OS, ImmPredicateSet &ImmPredicates, + bool StripImmCodes = false) const { for (unsigned i = 0, e = Operands.size(); i != e; ++i) - Operands[i].printManglingSuffix(OS); + Operands[i].printManglingSuffix(OS, ImmPredicates, StripImmCodes); } }; @@ -246,13 +355,17 @@ OperandsOpcodeTypeRetPredMap SimplePatterns; + std::map > + SignaturesWithConstantForms; + std::string InstNS; - + ImmPredicateSet ImmediatePredicates; public: explicit FastISelMap(std::string InstNS); - void CollectPatterns(CodeGenDAGPatterns &CGP); - void PrintFunctionDefinitions(raw_ostream &OS); + void collectPatterns(CodeGenDAGPatterns &CGP); + void printImmediatePredicates(raw_ostream &OS); + void printFunctionDefinitions(raw_ostream &OS); }; } @@ -272,7 +385,7 @@ : InstNS(instns) { } -void FastISelMap::CollectPatterns(CodeGenDAGPatterns &CGP) { +void FastISelMap::collectPatterns(CodeGenDAGPatterns &CGP) { const CodeGenTarget &Target = CGP.getTargetInfo(); // Determine the target's namespace name. @@ -361,7 +474,7 @@ // Check all the operands. OperandsSignature Operands; - if (!Operands.initialize(InstPatNode, Target, VT)) + if (!Operands.initialize(InstPatNode, Target, VT, ImmediatePredicates)) continue; std::vector* PhysRegInputs = new std::vector(); @@ -409,15 +522,39 @@ SubRegNo, PhysRegInputs }; - if (SimplePatterns[Operands][OpcodeName][VT][RetVT] - .count(PredicateCheck)) - throw TGError(Pattern.getSrcRecord()->getLoc(), "Duplicate record!"); + + if (SimplePatterns[Operands][OpcodeName][VT][RetVT].count(PredicateCheck)) + throw TGError(Pattern.getSrcRecord()->getLoc(), + "Duplicate record in FastISel table!"); SimplePatterns[Operands][OpcodeName][VT][RetVT][PredicateCheck] = Memo; + + // If any of the operands were immediates with predicates on them, strip + // them down to a signature that doesn't have predicates so that we can + // associate them with the stripped predicate version. + if (Operands.hasAnyImmediateCodes()) { + SignaturesWithConstantForms[Operands.getWithoutImmCodes()] + .push_back(Operands); + } } } -void FastISelMap::PrintFunctionDefinitions(raw_ostream &OS) { +void FastISelMap::printImmediatePredicates(raw_ostream &OS) { + if (ImmediatePredicates.begin() == ImmediatePredicates.end()) + return; + + OS << "\n// FastEmit Immediate Predicate functions.\n"; + for (ImmPredicateSet::iterator I = ImmediatePredicates.begin(), + E = ImmediatePredicates.end(); I != E; ++I) { + OS << "static bool " << I->getFnName() << "(int64_t Imm) {\n"; + OS << I->getImmediatePredicateCode() << "\n}\n"; + } + + OS << "\n\n"; +} + + +void FastISelMap::printFunctionDefinitions(raw_ostream &OS) { // Now emit code for all the patterns that we collected. for (OperandsOpcodeTypeRetPredMap::const_iterator OI = SimplePatterns.begin(), OE = SimplePatterns.end(); OI != OE; ++OI) { @@ -448,7 +585,7 @@ << getLegalCName(Opcode) << "_" << getLegalCName(getName(VT)) << "_" << getLegalCName(getName(RetVT)) << "_"; - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "("; Operands.PrintParameters(OS); OS << ") {\n"; @@ -479,7 +616,8 @@ OS << " return FastEmitInst_"; if (Memo.SubRegNo.empty()) { - Operands.PrintManglingSuffix(OS, *Memo.PhysRegs); + Operands.PrintManglingSuffix(OS, *Memo.PhysRegs, + ImmediatePredicates, true); OS << "(" << InstNS << Memo.Name << ", "; OS << InstNS << Memo.RC->getName() << "RegisterClass"; if (!Operands.empty()) @@ -488,9 +626,7 @@ OS << ");\n"; } else { OS << "extractsubreg(" << getName(RetVT); - OS << ", Op0, Op0IsKill, "; - OS << Memo.SubRegNo; - OS << ");\n"; + OS << ", Op0, Op0IsKill, " << Memo.SubRegNo << ");\n"; } if (HasPred) @@ -508,7 +644,7 @@ OS << "unsigned FastEmit_" << getLegalCName(Opcode) << "_" << getLegalCName(getName(VT)) << "_"; - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "(MVT RetVT"; if (!Operands.empty()) OS << ", "; @@ -520,7 +656,7 @@ OS << " case " << getName(RetVT) << ": return FastEmit_" << getLegalCName(Opcode) << "_" << getLegalCName(getName(VT)) << "_" << getLegalCName(getName(RetVT)) << "_"; - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "("; Operands.PrintArguments(OS); OS << ");\n"; @@ -532,7 +668,7 @@ OS << "unsigned FastEmit_" << getLegalCName(Opcode) << "_" << getLegalCName(getName(VT)) << "_"; - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "(MVT RetVT"; if (!Operands.empty()) OS << ", "; @@ -572,7 +708,8 @@ OS << " return FastEmitInst_"; if (Memo.SubRegNo.empty()) { - Operands.PrintManglingSuffix(OS, *Memo.PhysRegs); + Operands.PrintManglingSuffix(OS, *Memo.PhysRegs, + ImmediatePredicates, true); OS << "(" << InstNS << Memo.Name << ", "; OS << InstNS << Memo.RC->getName() << "RegisterClass"; if (!Operands.empty()) @@ -600,7 +737,7 @@ // Emit one function for the opcode that demultiplexes based on the type. OS << "unsigned FastEmit_" << getLegalCName(Opcode) << "_"; - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "(MVT VT, MVT RetVT"; if (!Operands.empty()) OS << ", "; @@ -613,7 +750,7 @@ std::string TypeName = getName(VT); OS << " case " << TypeName << ": return FastEmit_" << getLegalCName(Opcode) << "_" << getLegalCName(TypeName) << "_"; - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "(RetVT"; if (!Operands.empty()) OS << ", "; @@ -632,12 +769,44 @@ // Emit one function for the operand signature that demultiplexes based // on opcode and type. OS << "unsigned FastEmit_"; - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "(MVT VT, MVT RetVT, unsigned Opcode"; if (!Operands.empty()) OS << ", "; Operands.PrintParameters(OS); OS << ") {\n"; + + // If there are any forms of this signature available that operand on + // constrained forms of the immediate (e.g. 32-bit sext immediate in a + // 64-bit operand), check them first. + + std::map >::iterator MI + = SignaturesWithConstantForms.find(Operands); + if (MI != SignaturesWithConstantForms.end()) { + // Unique any duplicates out of the list. + std::sort(MI->second.begin(), MI->second.end()); + MI->second.erase(std::unique(MI->second.begin(), MI->second.end()), + MI->second.end()); + + // Check each in order it was seen. It would be nice to have a good + // relative ordering between them, but we're not going for optimality + // here. + for (unsigned i = 0, e = MI->second.size(); i != e; ++i) { + OS << " if ("; + MI->second[i].emitImmediatePredicate(OS, ImmediatePredicates); + OS << ")\n if (unsigned Reg = FastEmit_"; + MI->second[i].PrintManglingSuffix(OS, ImmediatePredicates); + OS << "(VT, RetVT, Opcode"; + if (!MI->second[i].empty()) + OS << ", "; + MI->second[i].PrintArguments(OS); + OS << "))\n return Reg;\n\n"; + } + + // Done with this, remove it. + SignaturesWithConstantForms.erase(MI); + } + OS << " switch (Opcode) {\n"; for (OpcodeTypeRetPredMap::const_iterator I = OTM.begin(), E = OTM.end(); I != E; ++I) { @@ -645,7 +814,7 @@ OS << " case " << Opcode << ": return FastEmit_" << getLegalCName(Opcode) << "_"; - Operands.PrintManglingSuffix(OS); + Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "(VT, RetVT"; if (!Operands.empty()) OS << ", "; @@ -657,6 +826,8 @@ OS << "}\n"; OS << "\n"; } + + // TODO: SignaturesWithConstantForms should be empty here. } void FastISelEmitter::run(raw_ostream &OS) { @@ -670,12 +841,12 @@ Target.getName() + " target", OS); FastISelMap F(InstNS); - F.CollectPatterns(CGP); - F.PrintFunctionDefinitions(OS); + F.collectPatterns(CGP); + F.printImmediatePredicates(OS); + F.printFunctionDefinitions(OS); } FastISelEmitter::FastISelEmitter(RecordKeeper &R) - : Records(R), - CGP(R) { + : Records(R), CGP(R) { } From sabre at nondot.org Mon Apr 18 01:36:55 2011 From: sabre at nondot.org (Chris Lattner) Date: Mon, 18 Apr 2011 06:36:55 -0000 Subject: [llvm-commits] [llvm] r129692 - in /llvm/trunk: include/llvm/Target/TargetSelectionDAG.td lib/Target/X86/X86InstrInfo.td utils/TableGen/FastISelEmitter.cpp Message-ID: <20110418063655.9B00F2A6C12C@llvm.org> Author: lattner Date: Mon Apr 18 01:36:55 2011 New Revision: 129692 URL: http://llvm.org/viewvc/llvm-project?rev=129692&view=rev Log: Add a new bit that ImmLeaf's can opt into, which allows them to duck out of the generated FastISel. X86 doesn't need to generate code to match ADD16ri8 since ADD16ri will do just fine. This is a small codesize win in the generated instruction selector. Modified: llvm/trunk/include/llvm/Target/TargetSelectionDAG.td llvm/trunk/lib/Target/X86/X86InstrInfo.td llvm/trunk/utils/TableGen/FastISelEmitter.cpp Modified: llvm/trunk/include/llvm/Target/TargetSelectionDAG.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelectionDAG.td?rev=129692&r1=129691&r2=129692&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetSelectionDAG.td (original) +++ llvm/trunk/include/llvm/Target/TargetSelectionDAG.td Mon Apr 18 01:36:55 2011 @@ -539,8 +539,14 @@ // this is a more convenient form to match 'imm' nodes in than PatLeaf and also // is preferred over using PatLeaf because it allows the code generator to // reason more about the constraint. -class ImmLeaf : PatFrag<(ops), (vt imm)> { +// +// If FastIsel should ignore all instructions that have an operand of this type, +// the FastIselShouldIgnore flag can be set. This is an optimization to reduce +// the code size of the generated fast instruction selector. +class ImmLeaf + : PatFrag<(ops), (vt imm)> { let ImmediateCode = pred; + bit FastIselShouldIgnore = 0; } Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=129692&r1=129691&r2=129692&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Mon Apr 18 01:36:55 2011 @@ -481,9 +481,12 @@ def X86_COND_P : PatLeaf<(i8 14)>; // alt. COND_PE def X86_COND_S : PatLeaf<(i8 15)>; -def i16immSExt8 : ImmLeaf; -def i32immSExt8 : ImmLeaf; -def i64immSExt8 : ImmLeaf; +let FastIselShouldIgnore = 1 in { // FastIsel should ignore all simm8 instrs. + def i16immSExt8 : ImmLeaf; + def i32immSExt8 : ImmLeaf; + def i64immSExt8 : ImmLeaf; +} + def i64immSExt32 : ImmLeaf; Modified: llvm/trunk/utils/TableGen/FastISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FastISelEmitter.cpp?rev=129692&r1=129691&r2=129692&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/FastISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/FastISelEmitter.cpp Mon Apr 18 01:36:55 2011 @@ -190,14 +190,22 @@ if (!Op->isLeaf() && Op->getOperator()->getName() == "imm") { unsigned PredNo = 0; if (!Op->getPredicateFns().empty()) { + TreePredicateFn PredFn = Op->getPredicateFns()[0]; // If there is more than one predicate weighing in on this operand // then we don't handle it. This doesn't typically happen for // immediates anyway. if (Op->getPredicateFns().size() > 1 || - !Op->getPredicateFns()[0].isImmediatePattern()) + !PredFn.isImmediatePattern()) + return false; + // Ignore any instruction with 'FastIselShouldIgnore', these are + // not needed and just bloat the fast instruction selector. For + // example, X86 doesn't need to generate code to match ADD16ri8 since + // ADD16ri will do just fine. + Record *Rec = PredFn.getOrigPatFragRecord()->getRecord(); + if (Rec->getValueAsBit("FastIselShouldIgnore")) return false; - PredNo = ImmediatePredicates.getIDFor(Op->getPredicateFns()[0])+1; + PredNo = ImmediatePredicates.getIDFor(PredFn)+1; } // Handle unmatched immediate sizes here. From sabre at nondot.org Mon Apr 18 01:55:52 2011 From: sabre at nondot.org (Chris Lattner) Date: Mon, 18 Apr 2011 06:55:52 -0000 Subject: [llvm-commits] [llvm] r129693 - in /llvm/trunk: lib/CodeGen/SelectionDAG/FastISel.cpp test/CodeGen/X86/fast-isel-x86-64.ll Message-ID: <20110418065552.2AB9F2A6C12C@llvm.org> Author: lattner Date: Mon Apr 18 01:55:51 2011 New Revision: 129693 URL: http://llvm.org/viewvc/llvm-project?rev=129693&view=rev Log: fix rdar://9297011 - udiv by power of two causing fast-isel rejects Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=129693&r1=129692&r2=129693&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Apr 18 01:55:51 2011 @@ -990,6 +990,10 @@ if (Opcode == ISD::MUL && isPowerOf2_64(Imm)) { Opcode = ISD::SHL; Imm = Log2_64(Imm); + } else if (Opcode == ISD::UDIV && isPowerOf2_64(Imm)) { + // div x, 8 -> srl x, 3 + Opcode = ISD::SRL; + Imm = Log2_64(Imm); } // Horrible hack (to be removed), check to make sure shift amounts are Modified: llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll?rev=129693&r1=129692&r2=129693&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll Mon Apr 18 01:55:51 2011 @@ -1,4 +1,4 @@ -; RUN: llc < %s -fast-isel -O0 -regalloc=fast -asm-verbose=0 | FileCheck %s +; RUN: llc < %s -fast-isel -O0 -regalloc=fast -asm-verbose=0 -fast-isel-abort | FileCheck %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-darwin10.0.0" @@ -111,3 +111,11 @@ ; CHECK: test9: ; CHECK: imulq $7, %rdi, %rax } + +; rdar://9297011 - Don't reject udiv by a power of 2. +define i32 @test10(i32 %X) nounwind { + %Y = udiv i32 %X, 8 + ret i32 %Y +; CHECK: test10: +; CHECK: shrl $3, +} From sabre at nondot.org Mon Apr 18 02:00:41 2011 From: sabre at nondot.org (Chris Lattner) Date: Mon, 18 Apr 2011 07:00:41 -0000 Subject: [llvm-commits] [llvm] r129694 - in /llvm/trunk: lib/CodeGen/SelectionDAG/FastISel.cpp test/CodeGen/X86/fast-isel-x86-64.ll Message-ID: <20110418070041.2313F2A6C12C@llvm.org> Author: lattner Date: Mon Apr 18 02:00:40 2011 New Revision: 129694 URL: http://llvm.org/viewvc/llvm-project?rev=129694&view=rev Log: while we're at it, handle 'sdiv exact' of a power of 2 also, this fixes a few rejects on c++ iterator loops. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=129694&r1=129693&r2=129694&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Mon Apr 18 02:00:40 2011 @@ -360,6 +360,14 @@ if (ConstantInt *CI = dyn_cast(I->getOperand(1))) { uint64_t Imm = CI->getZExtValue(); + // Transform "sdiv exact X, 8" -> "sra X, 3". + if (ISDOpcode == ISD::SDIV && isa(I) && + cast(I)->isExact() && + isPowerOf2_64(Imm)) { + Imm = Log2_64(Imm); + ISDOpcode = ISD::SRA; + } + unsigned ResultReg = FastEmit_ri_(VT.getSimpleVT(), ISDOpcode, Op0, Op0IsKill, Imm, VT.getSimpleVT()); if (ResultReg == 0) return false; Modified: llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll?rev=129694&r1=129693&r2=129694&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll (original) +++ llvm/trunk/test/CodeGen/X86/fast-isel-x86-64.ll Mon Apr 18 02:00:40 2011 @@ -119,3 +119,11 @@ ; CHECK: test10: ; CHECK: shrl $3, } + +define i32 @test11(i32 %X) nounwind { + %Y = sdiv exact i32 %X, 8 + ret i32 %Y +; CHECK: test11: +; CHECK: sarl $3, +} + From andersca at mac.com Mon Apr 18 09:02:06 2011 From: andersca at mac.com (Anders Carlsson) Date: Mon, 18 Apr 2011 14:02:06 -0000 Subject: [llvm-commits] [llvm] r129696 - /llvm/trunk/include/llvm/DerivedTypes.h Message-ID: <20110418140207.5716E2A6C12E@llvm.org> Author: andersca Date: Mon Apr 18 09:02:06 2011 New Revision: 129696 URL: http://llvm.org/viewvc/llvm-project?rev=129696&view=rev Log: Make the empty StructType::get overload use an empty ArrayRef. Modified: llvm/trunk/include/llvm/DerivedTypes.h Modified: llvm/trunk/include/llvm/DerivedTypes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DerivedTypes.h?rev=129696&r1=129695&r2=129696&view=diff ============================================================================== --- llvm/trunk/include/llvm/DerivedTypes.h (original) +++ llvm/trunk/include/llvm/DerivedTypes.h Mon Apr 18 09:02:06 2011 @@ -250,7 +250,7 @@ /// StructType::get - Create an empty structure type. /// static StructType *get(LLVMContext &Context, bool isPacked=false) { - return get(Context, std::vector(), isPacked); + return get(Context, llvm::ArrayRef(), isPacked); } /// StructType::get - This static method is a convenience method for From peter at pcc.me.uk Mon Apr 18 11:29:17 2011 From: peter at pcc.me.uk (Peter Collingbourne) Date: Mon, 18 Apr 2011 17:29:17 +0100 Subject: [llvm-commits] [PATCH] Phi node folding improvements In-Reply-To: <20101014022345.GA10505@pcc.me.uk> References: <20100730201530.GA1396@pcc.me.uk> <043636EC-FCA5-4AB2-AA18-1AA510C4412F@apple.com> <20101014022345.GA10505@pcc.me.uk> Message-ID: <20110418162917.GA23954@pcc.me.uk> On Thu, Oct 14, 2010 at 03:23:45AM +0100, Peter Collingbourne wrote: > Hi Chris, > > On Sun, Sep 05, 2010 at 01:16:25PM -0700, Chris Lattner wrote: > > > > On Jul 30, 2010, at 1:15 PM, Peter Collingbourne wrote: > > > > > Hi, > > > > > > The attached patches improve the flexibility of the phi node folding > > > mechanism by assigning a cost to each non-trapping instruction and > > > allowing the user to specify a maximum cost threshold. By increasing > > > the threshold the user can apply phi node folding to more complex > > > expressions. > > > > > > I developed this patch as part of my work with the Klee symbolic > > > virtual machine, which can handle symbolic expressions containing > > > selects more efficiently than branches conditional on symbolic > > > expressions. However I imagine it could also provide an advantage on > > > architectures with relatively expensive branch operations (I haven't > > > done any experiments to determine if this is the case though). > > > > > > The patches should not contain any changes to default functionality, > > > except for adding more instructions to the list of "cheap" (folded > > > by default) instructions. > > > > Hi Peter, > > > > Sorry for the delay on this. The first patch certainly looks ok, but we need testcases for each of these changes. > > I've now revised the patch series. The main difference versus the > previous series is that the supplied cost threshold applies to both > predecessors independently of each other rather than taking the > combined cost (which is why the default is now 1). The threshold > now roughly represents the maximum potential amount of 'wasted' work, > which I imagine could be a factor that would be weighed against the > cost of branching on a specific architecture. > > I have also added test cases, which include test cases to ensure > that the changes do not in fact change default functionality. Ping. I've also refreshed the patches against trunk. Thanks, -- Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-Trunc-ZExt-and-SExt-to-the-list-of-cheap-instruc.patch Type: text/x-diff Size: 2210 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20110418/d186aa40/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Add-CostRemaining-parameter-to-DominatesMergePoint.patch Type: text/x-diff Size: 5531 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20110418/d186aa40/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Expose-phi-node-folding-cost-threshold-as-command-li.patch Type: text/x-diff Size: 2952 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20110418/d186aa40/attachment-0002.bin From stoklund at 2pi.dk Mon Apr 18 12:14:15 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 18 Apr 2011 17:14:15 -0000 Subject: [llvm-commits] [test-suite] r129702 - /test-suite/trunk/TEST.nightly.Makefile Message-ID: <20110418171415.E65622A6C12C@llvm.org> Author: stoklund Date: Mon Apr 18 12:14:15 2011 New Revision: 129702 URL: http://llvm.org/viewvc/llvm-project?rev=129702&view=rev Log: The build target should also build the llc-beta executables for TEST=nightly ENABLE_LLCBETA=1. Modified: test-suite/trunk/TEST.nightly.Makefile Modified: test-suite/trunk/TEST.nightly.Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/TEST.nightly.Makefile?rev=129702&r1=129701&r2=129702&view=diff ============================================================================== --- test-suite/trunk/TEST.nightly.Makefile (original) +++ test-suite/trunk/TEST.nightly.Makefile Mon Apr 18 12:14:15 2011 @@ -150,6 +150,12 @@ test.$(TEST).%: Output/%.$(TEST).report.txt @-cat $< +ifdef ENABLE_LLCBETA +$(PROGRAMS_TO_TEST:%=build.$(TEST).%): \ +build.$(TEST).%: Output/%.llc Output/%.llc-beta + @echo "Finished Building: $<" +else $(PROGRAMS_TO_TEST:%=build.$(TEST).%): \ build.$(TEST).%: Output/%.llc @echo "Finished Building: $<" +endif From aggarwa4 at illinois.edu Mon Apr 18 13:21:20 2011 From: aggarwa4 at illinois.edu (Arushi Aggarwal) Date: Mon, 18 Apr 2011 18:21:20 -0000 Subject: [llvm-commits] [poolalloc] r129705 - /poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp Message-ID: <20110418182120.B5C8E2A6C12C@llvm.org> Author: aggarwa4 Date: Mon Apr 18 13:21:20 2011 New Revision: 129705 URL: http://llvm.org/viewvc/llvm-project?rev=129705&view=rev Log: Ensure that the uses we replace are all call insts. Also, if the original function was varargs, this one should be too. Modified: poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp Modified: poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp?rev=129705&r1=129704&r2=129705&view=diff ============================================================================== --- poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp (original) +++ poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp Mon Apr 18 13:21:20 2011 @@ -74,7 +74,7 @@ TP.push_back(ii->getType()); } - const FunctionType *NFTy = FunctionType::get(F->getReturnType(), TP, false); + const FunctionType *NFTy = FunctionType::get(F->getReturnType(), TP, F->isVarArg()); // Create the new function body and insert it into the module. Function *NF = Function::Create(NFTy, F->getLinkage(), F->getName(), &M); @@ -111,6 +111,10 @@ for(Value::use_iterator ui = F->use_begin(), ue = F->use_end(); ui != ue; ) { CallInst *CI = dyn_cast(ui++); + if(!CI) + continue; + if(CI->getCalledFunction() != F) + continue; AllocaInst *AllocaNew = new AllocaInst(F->getReturnType(), 0, "", CI); SmallVector Args; @@ -123,7 +127,8 @@ CI->replaceAllUsesWith(LI); CI->eraseFromParent(); } - F->eraseFromParent(); + if(F->use_empty()) + F->eraseFromParent(); } return true; } From resistor at mac.com Mon Apr 18 13:42:26 2011 From: resistor at mac.com (Owen Anderson) Date: Mon, 18 Apr 2011 18:42:26 -0000 Subject: [llvm-commits] [llvm] r129708 - /llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp Message-ID: <20110418184226.B0E912A6C12C@llvm.org> Author: resistor Date: Mon Apr 18 13:42:26 2011 New Revision: 129708 URL: http://llvm.org/viewvc/llvm-project?rev=129708&view=rev Log: Enhance the fixed-length disassembler to support the callbacks necessary for symbolic disassembly. Modified: llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp Modified: llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp?rev=129708&r1=129707&r2=129708&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp Mon Apr 18 13:42:26 2011 @@ -611,7 +611,8 @@ o << '\n'; o.indent(Indentation) << - "static bool decodeInstruction(MCInst &MI, field_t insn) {\n"; + "static bool decodeInstruction(MCInst &MI, field_t insn, " + "uint64_t Address, const void *Decoder) {\n"; o.indent(Indentation) << " unsigned tmp = 0;\n"; ++Indentation; ++Indentation; @@ -795,7 +796,8 @@ I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) { // If a custom instruction decoder was specified, use that. if (I->FieldBase == ~0U && I->FieldLength == ~0U) { - o.indent(Indentation) << " " << I->Decoder << "(MI, insn);\n"; + o.indent(Indentation) << " " << I->Decoder + << "(MI, insn, Address, Decoder);\n"; break; } @@ -803,7 +805,8 @@ << " tmp = fieldFromInstruction(insn, " << I->FieldBase << ", " << I->FieldLength << ");\n"; if (I->Decoder != "") { - o.indent(Indentation) << " " << I->Decoder << "(MI, tmp);\n"; + o.indent(Indentation) << " " << I->Decoder + << "(MI, tmp, Address, Decoder);\n"; } else { o.indent(Indentation) << " MI.addOperand(MCOperand::CreateImm(tmp));\n"; @@ -846,7 +849,8 @@ I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) { // If a custom instruction decoder was specified, use that. if (I->FieldBase == ~0U && I->FieldLength == ~0U) { - o.indent(Indentation) << " " << I->Decoder << "(MI, insn);\n"; + o.indent(Indentation) << " " << I->Decoder + << "(MI, insn, Address, Decoder);\n"; break; } @@ -854,7 +858,8 @@ << " tmp = fieldFromInstruction(insn, " << I->FieldBase << ", " << I->FieldLength << ");\n"; if (I->Decoder != "") { - o.indent(Indentation) << " " << I->Decoder << "(MI, tmp);\n"; + o.indent(Indentation) << " " << I->Decoder + << "(MI, tmp, Address, Decoder);\n"; } else { o.indent(Indentation) << " MI.addOperand(MCOperand::CreateImm(tmp));\n"; From chandlerc at gmail.com Mon Apr 18 13:49:44 2011 From: chandlerc at gmail.com (Chandler Carruth) Date: Mon, 18 Apr 2011 18:49:44 -0000 Subject: [llvm-commits] [llvm] r129709 - in /llvm/trunk/lib: Analysis/LazyValueInfo.cpp Transforms/Instrumentation/PathProfiling.cpp Message-ID: <20110418184944.583B32A6C12C@llvm.org> Author: chandlerc Date: Mon Apr 18 13:49:44 2011 New Revision: 129709 URL: http://llvm.org/viewvc/llvm-project?rev=129709&view=rev Log: Mark some functions as used which are used within debug-only code. This silences Clang's -Wunused-function when building in release mode. Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=129709&r1=129708&r2=129709&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original) +++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Mon Apr 18 13:49:44 2011 @@ -268,6 +268,8 @@ } // end anonymous namespace. namespace llvm { +raw_ostream &operator<<(raw_ostream &OS, const LVILatticeVal &Val) + LLVM_ATTRIBUTE_USED; raw_ostream &operator<<(raw_ostream &OS, const LVILatticeVal &Val) { if (Val.isUndefined()) return OS << "undefined"; Modified: llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp?rev=129709&r1=129708&r2=129709&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp (original) +++ llvm/trunk/lib/Transforms/Instrumentation/PathProfiling.cpp Mon Apr 18 13:49:44 2011 @@ -389,6 +389,9 @@ // BallLarusEdge << operator overloading raw_ostream& operator<<(raw_ostream& os, + const BLInstrumentationEdge& edge) + LLVM_ATTRIBUTE_USED; + raw_ostream& operator<<(raw_ostream& os, const BLInstrumentationEdge& edge) { os << "[" << edge.getSource()->getName() << " -> " << edge.getTarget()->getName() << "] init: " From echristo at apple.com Mon Apr 18 14:26:26 2011 From: echristo at apple.com (Eric Christopher) Date: Mon, 18 Apr 2011 19:26:26 -0000 Subject: [llvm-commits] [llvm] r129711 - in /llvm/trunk: lib/CodeGen/RegAllocFast.cpp test/CodeGen/ARM/2011-04-12-FastRegAlloc.ll Message-ID: <20110418192626.285822A6C12C@llvm.org> Author: echristo Date: Mon Apr 18 14:26:25 2011 New Revision: 129711 URL: http://llvm.org/viewvc/llvm-project?rev=129711&view=rev Log: Fix a bug where we were counting the alias sets as completely used registers for fast allocation a different way. This has us updating used registers only when we're using that exact register. Fixes rdar://9207598 Added: llvm/trunk/test/CodeGen/ARM/2011-04-12-FastRegAlloc.ll Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp Modified: llvm/trunk/lib/CodeGen/RegAllocFast.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocFast.cpp?rev=129711&r1=129710&r2=129711&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocFast.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocFast.cpp Mon Apr 18 14:26:25 2011 @@ -396,7 +396,6 @@ PhysRegState[PhysReg] = NewState; for (const unsigned *AS = TRI->getAliasSet(PhysReg); unsigned Alias = *AS; ++AS) { - UsedInInstr.set(Alias); switch (unsigned VirtReg = PhysRegState[Alias]) { case regDisabled: break; @@ -734,10 +733,6 @@ if (!Reg || !TargetRegisterInfo::isPhysicalRegister(Reg)) continue; DEBUG(dbgs() << "\tSetting reg " << Reg << " as used in instr\n"); UsedInInstr.set(Reg); - for (const unsigned *AS = TRI->getAliasSet(Reg); *AS; ++AS) { - DEBUG(dbgs() << "\tSetting alias reg " << *AS << " as used in instr\n"); - UsedInInstr.set(*AS); - } } // Also mark PartialDefs as used to avoid reallocation. Added: llvm/trunk/test/CodeGen/ARM/2011-04-12-FastRegAlloc.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2011-04-12-FastRegAlloc.ll?rev=129711&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/ARM/2011-04-12-FastRegAlloc.ll (added) +++ llvm/trunk/test/CodeGen/ARM/2011-04-12-FastRegAlloc.ll Mon Apr 18 14:26:25 2011 @@ -0,0 +1,15 @@ +; RUN: llc < %s -O0 -verify-machineinstrs -regalloc=fast +; Previously we'd crash as out of registers on this input by clobbering all of +; the aliases. +target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:64-v128:32:128-a0:0:32-n32" +target triple = "thumbv7-apple-darwin10.0.0" + +define void @_Z8TestCasev() nounwind ssp { +entry: + %a = alloca float, align 4 + %tmp = load float* %a, align 4 + call void asm sideeffect "", "w,~{s0},~{s16}"(float %tmp) nounwind, !srcloc !0 + ret void +} + +!0 = metadata !{i32 109} From scallanan at apple.com Mon Apr 18 15:20:44 2011 From: scallanan at apple.com (Sean Callanan) Date: Mon, 18 Apr 2011 20:20:44 -0000 Subject: [llvm-commits] [llvm] r129713 - /llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Message-ID: <20110418202044.967EC2A6C12C@llvm.org> Author: spyffe Date: Mon Apr 18 15:20:44 2011 New Revision: 129713 URL: http://llvm.org/viewvc/llvm-project?rev=129713&view=rev Log: Small fix to the ARM AsmParser to ensure that a superclass variable is instantiated properly. Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=129713&r1=129712&r2=129713&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original) +++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Mon Apr 18 15:20:44 2011 @@ -114,6 +114,7 @@ public: ARMAsmParser(const Target &T, MCAsmParser &_Parser, TargetMachine &_TM) : TargetAsmParser(T), Parser(_Parser), TM(_TM) { + MCAsmParserExtension::Initialize(_Parser); // Initialize the set of available features. setAvailableFeatures(ComputeAvailableFeatures( &TM.getSubtarget())); From stoklund at 2pi.dk Mon Apr 18 15:23:27 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Mon, 18 Apr 2011 20:23:27 -0000 Subject: [llvm-commits] [llvm] r129714 - /llvm/trunk/lib/CodeGen/InlineSpiller.cpp Message-ID: <20110418202327.77C652A6C12C@llvm.org> Author: stoklund Date: Mon Apr 18 15:23:27 2011 New Revision: 129714 URL: http://llvm.org/viewvc/llvm-project?rev=129714&view=rev Log: Handle spilling around an instruction that has an early-clobber re-definition of the spilled register. This is quite common on ARM now that some stores have early-clobber defines. Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=129714&r1=129713&r2=129714&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original) +++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Mon Apr 18 15:23:27 2011 @@ -134,9 +134,10 @@ bool foldMemoryOperand(MachineBasicBlock::iterator MI, const SmallVectorImpl &Ops, MachineInstr *LoadMI = 0); - void insertReload(LiveInterval &NewLI, MachineBasicBlock::iterator MI); + void insertReload(LiveInterval &NewLI, SlotIndex, + MachineBasicBlock::iterator MI); void insertSpill(LiveInterval &NewLI, const LiveInterval &OldLI, - MachineBasicBlock::iterator MI); + SlotIndex, MachineBasicBlock::iterator MI); void spillAroundUses(unsigned Reg); void spillAll(); @@ -780,9 +781,9 @@ /// insertReload - Insert a reload of NewLI.reg before MI. void InlineSpiller::insertReload(LiveInterval &NewLI, + SlotIndex Idx, MachineBasicBlock::iterator MI) { MachineBasicBlock &MBB = *MI->getParent(); - SlotIndex Idx = LIS.getInstructionIndex(MI).getDefIndex(); TII.loadRegFromStackSlot(MBB, MI, NewLI.reg, StackSlot, MRI.getRegClass(NewLI.reg), &TRI); --MI; // Point to load instruction. @@ -796,15 +797,8 @@ /// insertSpill - Insert a spill of NewLI.reg after MI. void InlineSpiller::insertSpill(LiveInterval &NewLI, const LiveInterval &OldLI, - MachineBasicBlock::iterator MI) { + SlotIndex Idx, MachineBasicBlock::iterator MI) { MachineBasicBlock &MBB = *MI->getParent(); - - // Get the defined value. It could be an early clobber so keep the def index. - SlotIndex Idx = LIS.getInstructionIndex(MI).getDefIndex(); - VNInfo *VNI = OldLI.getVNInfoAt(Idx); - assert(VNI && VNI->def.getDefIndex() == Idx && "Inconsistent VNInfo"); - Idx = VNI->def; - TII.storeRegToStackSlot(MBB, ++MI, NewLI.reg, true, StackSlot, MRI.getRegClass(NewLI.reg), &TRI); --MI; // Point to store instruction. @@ -854,6 +848,13 @@ SmallVector Ops; tie(Reads, Writes) = MI->readsWritesVirtualRegister(Reg, &Ops); + // Find the slot index where this instruction reads and writes OldLI. + // This is usually the def slot, except for tied early clobbers. + SlotIndex Idx = LIS.getInstructionIndex(MI).getDefIndex(); + if (VNInfo *VNI = OldLI.getVNInfoAt(Idx.getUseIndex())) + if (SlotIndex::isSameInstr(Idx, VNI->def)) + Idx = VNI->def; + // Check for a sibling copy. unsigned SibReg = isFullCopyOf(MI, Reg); if (SibReg && isSibling(SibReg)) { @@ -867,7 +868,6 @@ } } else { // This is a reload for a sib-reg copy. Drop spills downstream. - SlotIndex Idx = LIS.getInstructionIndex(MI).getDefIndex(); LiveInterval &SibLI = LIS.getInterval(SibReg); eliminateRedundantSpills(SibLI, SibLI.getVNInfoAt(Idx)); // The COPY will fold to a reload below. @@ -884,7 +884,7 @@ NewLI.markNotSpillable(); if (Reads) - insertReload(NewLI, MI); + insertReload(NewLI, Idx, MI); // Rewrite instruction operands. bool hasLiveDef = false; @@ -899,10 +899,11 @@ hasLiveDef = true; } } + DEBUG(dbgs() << "\trewrite: " << Idx << '\t' << *MI); // FIXME: Use a second vreg if instruction has no tied ops. if (Writes && hasLiveDef) - insertSpill(NewLI, OldLI, MI); + insertSpill(NewLI, OldLI, Idx, MI); DEBUG(dbgs() << "\tinterval: " << NewLI << '\n'); } From dpatel at apple.com Mon Apr 18 15:26:49 2011 From: dpatel at apple.com (Devang Patel) Date: Mon, 18 Apr 2011 20:26:49 -0000 Subject: [llvm-commits] [llvm] r129715 - in /llvm/trunk: include/llvm/MC/MCStreamer.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/MC/MCAsmStreamer.cpp lib/MC/MCLoggingStreamer.cpp lib/MC/MCNullStreamer.cpp lib/MC/MCParser/AsmParser.cpp lib/MC/MCStreamer.cpp Message-ID: <20110418202649.C23462A6C12C@llvm.org> Author: dpatel Date: Mon Apr 18 15:26:49 2011 New Revision: 129715 URL: http://llvm.org/viewvc/llvm-project?rev=129715&view=rev Log: Reduce clutter in asm output. Do not emit source location as comment for each instruction. Modified: llvm/trunk/include/llvm/MC/MCStreamer.h llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/trunk/lib/MC/MCAsmStreamer.cpp llvm/trunk/lib/MC/MCLoggingStreamer.cpp llvm/trunk/lib/MC/MCNullStreamer.cpp llvm/trunk/lib/MC/MCParser/AsmParser.cpp llvm/trunk/lib/MC/MCStreamer.cpp Modified: llvm/trunk/include/llvm/MC/MCStreamer.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=129715&r1=129714&r2=129715&view=diff ============================================================================== --- llvm/trunk/include/llvm/MC/MCStreamer.h (original) +++ llvm/trunk/include/llvm/MC/MCStreamer.h Mon Apr 18 15:26:49 2011 @@ -422,7 +422,8 @@ virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, - unsigned Discriminator); + unsigned Discriminator, + StringRef FileName); virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel, Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=129715&r1=129714&r2=129715&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Apr 18 15:26:49 2011 @@ -486,39 +486,11 @@ } -static void EmitDebugLoc(DebugLoc DL, const MachineFunction *MF, - raw_ostream &CommentOS) { - const LLVMContext &Ctx = MF->getFunction()->getContext(); - if (!DL.isUnknown()) { // Print source line info. - DIScope Scope(DL.getScope(Ctx)); - // Omit the directory, because it's likely to be long and uninteresting. - if (Scope.Verify()) - CommentOS << Scope.getFilename(); - else - CommentOS << ""; - CommentOS << ':' << DL.getLine(); - if (DL.getCol() != 0) - CommentOS << ':' << DL.getCol(); - DebugLoc InlinedAtDL = DebugLoc::getFromDILocation(DL.getInlinedAt(Ctx)); - if (!InlinedAtDL.isUnknown()) { - CommentOS << "[ "; - EmitDebugLoc(InlinedAtDL, MF, CommentOS); - CommentOS << " ]"; - } - } -} - /// EmitComments - Pretty-print comments for instructions. static void EmitComments(const MachineInstr &MI, raw_ostream &CommentOS) { const MachineFunction *MF = MI.getParent()->getParent(); const TargetMachine &TM = MF->getTarget(); - DebugLoc DL = MI.getDebugLoc(); - if (!DL.isUnknown()) { // Print source line info. - EmitDebugLoc(DL, MF, CommentOS); - CommentOS << '\n'; - } - // Check for spills and reloads int FI; Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=129715&r1=129714&r2=129715&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Apr 18 15:26:49 2011 @@ -2146,9 +2146,8 @@ Src = GetOrCreateSourceID(Fn, Dir); } - Asm->OutStreamer.EmitDwarfLocDirective(Src, Line, Col, DWARF2_FLAG_IS_STMT, - 0, 0); + 0, 0, Fn); } //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=129715&r1=129714&r2=129715&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Mon Apr 18 15:26:49 2011 @@ -182,7 +182,8 @@ virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Filename); virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, - unsigned Isa, unsigned Discriminator); + unsigned Isa, unsigned Discriminator, + StringRef FileName); virtual void EmitCFIStartProc(); virtual void EmitCFIEndProc(); @@ -689,9 +690,10 @@ void MCAsmStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, - unsigned Discriminator) { + unsigned Discriminator, + StringRef FileName) { this->MCStreamer::EmitDwarfLocDirective(FileNo, Line, Column, Flags, - Isa, Discriminator); + Isa, Discriminator, FileName); if (!UseLoc) return; @@ -717,6 +719,12 @@ OS << "isa " << Isa; if (Discriminator) OS << "discriminator " << Discriminator; + + if (IsVerboseAsm) { + OS.PadToColumn(MAI.getCommentColumn()); + OS << MAI.getCommentString() << ' ' << FileName << ':' + << Line << ':' << Column; + } EmitEOL(); } Modified: llvm/trunk/lib/MC/MCLoggingStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCLoggingStreamer.cpp?rev=129715&r1=129714&r2=129715&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCLoggingStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCLoggingStreamer.cpp Mon Apr 18 15:26:49 2011 @@ -215,13 +215,14 @@ virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, - unsigned Isa, unsigned Discriminator) { + unsigned Isa, unsigned Discriminator, + StringRef FileName) { LogCall("EmitDwarfLocDirective", "FileNo:" + Twine(FileNo) + " Line:" + Twine(Line) + " Column:" + Twine(Column) + " Flags:" + Twine(Flags) + " Isa:" + Twine(Isa) + " Discriminator:" + Twine(Discriminator)); return Child->EmitDwarfLocDirective(FileNo, Line, Column, Flags, - Isa, Discriminator); + Isa, Discriminator, FileName); } virtual void EmitInstruction(const MCInst &Inst) { Modified: llvm/trunk/lib/MC/MCNullStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCNullStreamer.cpp?rev=129715&r1=129714&r2=129715&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCNullStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCNullStreamer.cpp Mon Apr 18 15:26:49 2011 @@ -89,7 +89,8 @@ } virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, - unsigned Isa, unsigned Discriminator) {} + unsigned Isa, unsigned Discriminator, + StringRef FileName) {} virtual void EmitInstruction(const MCInst &Inst) {} virtual void Finish() {} Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=129715&r1=129714&r2=129715&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original) +++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Mon Apr 18 15:26:49 2011 @@ -2253,7 +2253,7 @@ } getStreamer().EmitDwarfLocDirective(FileNumber, LineNumber, ColumnPos, Flags, - Isa, Discriminator); + Isa, Discriminator, StringRef()); return false; } Modified: llvm/trunk/lib/MC/MCStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCStreamer.cpp?rev=129715&r1=129714&r2=129715&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCStreamer.cpp Mon Apr 18 15:26:49 2011 @@ -135,7 +135,8 @@ void MCStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, - unsigned Discriminator) { + unsigned Discriminator, + StringRef FileName) { getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa, Discriminator); } From eli.friedman at gmail.com Mon Apr 18 15:54:46 2011 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 18 Apr 2011 20:54:46 -0000 Subject: [llvm-commits] [llvm] r129716 - /llvm/trunk/lib/MC/MCObjectStreamer.cpp Message-ID: <20110418205446.68DC02A6C12C@llvm.org> Author: efriedma Date: Mon Apr 18 15:54:46 2011 New Revision: 129716 URL: http://llvm.org/viewvc/llvm-project?rev=129716&view=rev Log: malloc elimination: it's a bad idea to use raw_svector_ostream on a small heap-allocated SmallString because it unconditionally forces a malloc. (Revised version of r129688, with the necessary flush() call.) Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp Modified: llvm/trunk/lib/MC/MCObjectStreamer.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectStreamer.cpp?rev=129716&r1=129715&r2=129716&view=diff ============================================================================== --- llvm/trunk/lib/MC/MCObjectStreamer.cpp (original) +++ llvm/trunk/lib/MC/MCObjectStreamer.cpp Mon Apr 18 15:54:46 2011 @@ -191,8 +191,11 @@ void MCObjectStreamer::EmitInstToFragment(const MCInst &Inst) { MCInstFragment *IF = new MCInstFragment(Inst, getCurrentSectionData()); - raw_svector_ostream VecOS(IF->getCode()); + SmallString<128> Code; + raw_svector_ostream VecOS(Code); getAssembler().getEmitter().EncodeInstruction(Inst, VecOS, IF->getFixups()); + VecOS.flush(); + IF->getCode().append(Code.begin(), Code.end()); } static const MCExpr *BuildSymbolDiff(MCContext &Context, From eli.friedman at gmail.com Mon Apr 18 16:21:37 2011 From: eli.friedman at gmail.com (Eli Friedman) Date: Mon, 18 Apr 2011 21:21:37 -0000 Subject: [llvm-commits] [llvm] r129720 - /llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Message-ID: <20110418212137.765862A6C12C@llvm.org> Author: efriedma Date: Mon Apr 18 16:21:37 2011 New Revision: 129720 URL: http://llvm.org/viewvc/llvm-project?rev=129720&view=rev Log: Simplify declarations slightly by using typedefs. Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=129720&r1=129719&r2=129720&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Mon Apr 18 16:21:37 2011 @@ -363,8 +363,7 @@ } void MachineBasicBlock::removePredecessor(MachineBasicBlock *pred) { - std::vector::iterator I = - std::find(Predecessors.begin(), Predecessors.end(), pred); + pred_iterator I = std::find(Predecessors.begin(), Predecessors.end(), pred); assert(I != Predecessors.end() && "Pred is not a predecessor of this block!"); Predecessors.erase(I); } @@ -402,8 +401,7 @@ } bool MachineBasicBlock::isSuccessor(const MachineBasicBlock *MBB) const { - std::vector::const_iterator I = - std::find(Successors.begin(), Successors.end(), MBB); + const_succ_iterator I = std::find(Successors.begin(), Successors.end(), MBB); return I != Successors.end(); } From echristo at apple.com Mon Apr 18 16:28:11 2011 From: echristo at apple.com (Eric Christopher) Date: Mon, 18 Apr 2011 21:28:11 -0000 Subject: [llvm-commits] [llvm] r129722 - in /llvm/trunk: lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp lib/Target/X86/InstPrinter/X86ATTInstPrinter.h utils/TableGen/AsmWriterEmitter.cpp Message-ID: <20110418212811.716D52A6C12C@llvm.org> Author: echristo Date: Mon Apr 18 16:28:11 2011 New Revision: 129722 URL: http://llvm.org/viewvc/llvm-project?rev=129722&view=rev Log: Invert the meaning of printAliasInstr's return value. It now returns true on success and false on failure. Update callers. Modified: llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Modified: llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp?rev=129722&r1=129721&r2=129722&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp (original) +++ llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp Mon Apr 18 16:28:11 2011 @@ -42,7 +42,8 @@ } void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS) { - if (printAliasInstr(MI, OS)) + // Try to print any aliases first. + if (!printAliasInstr(MI, OS)) printInstruction(MI, OS); // If verbose assembly is enabled, we can print some informative comments. Modified: llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h?rev=129722&r1=129721&r2=129722&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h (original) +++ llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h Mon Apr 18 16:28:11 2011 @@ -31,6 +31,8 @@ // Methods used to print the alias of an instruction. unsigned ComputeAvailableFeatures(const X86Subtarget *Subtarget) const; + // Autogenerated by tblgen, returns true if we successfully printed an + // alias. bool printAliasInstr(const MCInst *MI, raw_ostream &OS); // Autogenerated by tblgen. Modified: llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp?rev=129722&r1=129721&r2=129722&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Mon Apr 18 16:28:11 2011 @@ -975,11 +975,11 @@ CasesO << '\n'; } - CasesO.indent(4) << "return true;\n"; + CasesO.indent(4) << "return false;\n"; } if (CasesO.str().empty() || !isMC) { - O << " return true;\n"; + O << " return false;\n"; O << "}\n\n"; O << "#endif // PRINT_ALIAS_INSTR\n"; return; @@ -990,7 +990,7 @@ if (NeedAvailableFeatures) O.indent(2) << "unsigned AvailableFeatures = getAvailableFeatures();\n\n"; O.indent(2) << "switch (MI->getOpcode()) {\n"; - O.indent(2) << "default: return true;\n"; + O.indent(2) << "default: return false;\n"; O << CasesO.str(); O.indent(2) << "}\n\n"; @@ -1019,7 +1019,7 @@ O << " }\n"; O << " }\n\n"; - O << " return false;\n"; + O << " return true;\n"; O << "}\n\n"; O << "#endif // PRINT_ALIAS_INSTR\n"; From echristo at apple.com Mon Apr 18 16:33:27 2011 From: echristo at apple.com (Eric Christopher) Date: Mon, 18 Apr 2011 14:33:27 -0700 Subject: [llvm-commits] [llvm] r129497 - in /llvm/trunk: lib/Target/X86/ lib/Target/X86/InstPrinter/ test/CodeGen/X86/ test/MC/X86/ In-Reply-To: <1B9F1F5D-5149-4CB4-BD63-73B98F6412A4@gmail.com> References: <20110414011151.BBACC2A6C12C@llvm.org> <1B9F1F5D-5149-4CB4-BD63-73B98F6412A4@gmail.com> Message-ID: <43B652AF-DA3E-485D-819E-7D51577B8011@apple.com> On Apr 13, 2011, at 6:43 PM, Bill Wendling wrote: > On Apr 13, 2011, at 6:38 PM, Eric Christopher wrote: > >> Awesome. >> >> One thing... >> >> On Apr 13, 2011, at 6:11 PM, Bill Wendling wrote: >> >>> void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS) { >>> - printInstruction(MI, OS); >>> + if (printAliasInstr(MI, OS)) >>> + printInstruction(MI, OS); >> >> This looks... awkward? >> > Maybe...but it's similar to the style used in the parser where a function that returns 'true' didn't succeed in doing what it was supposed to do (like parse a statement or something). > > I'm open to ideas, though. :) I just inverted it. In the parser it makes more sense, but in the printer it leads to awkward looking logic. -eric From grosbach at apple.com Mon Apr 18 16:35:54 2011 From: grosbach at apple.com (Jim Grosbach) Date: Mon, 18 Apr 2011 21:35:54 -0000 Subject: [llvm-commits] [llvm] r129723 - in /llvm/trunk/lib/Target/ARM: ARMRegisterInfo.cpp Thumb1RegisterInfo.cpp Thumb2RegisterInfo.cpp Message-ID: <20110418213554.42A2A2A6C12C@llvm.org> Author: grosbach Date: Mon Apr 18 16:35:54 2011 New Revision: 129723 URL: http://llvm.org/viewvc/llvm-project?rev=129723&view=rev Log: Trim a few unneeded includes. Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp llvm/trunk/lib/Target/ARM/Thumb2RegisterInfo.cpp Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp?rev=129723&r1=129722&r2=129723&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.cpp Mon Apr 18 16:35:54 2011 @@ -12,26 +12,8 @@ //===----------------------------------------------------------------------===// #include "ARM.h" -#include "ARMAddressingModes.h" #include "ARMBaseInstrInfo.h" -#include "ARMInstrInfo.h" -#include "ARMMachineFunctionInfo.h" #include "ARMRegisterInfo.h" -#include "ARMSubtarget.h" -#include "llvm/Constants.h" -#include "llvm/DerivedTypes.h" -#include "llvm/CodeGen/MachineConstantPool.h" -#include "llvm/CodeGen/MachineFrameInfo.h" -#include "llvm/CodeGen/MachineFunction.h" -#include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/CodeGen/MachineLocation.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/CodeGen/RegisterScavenging.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetOptions.h" -#include "llvm/ADT/BitVector.h" -#include "llvm/ADT/SmallVector.h" using namespace llvm; ARMRegisterInfo::ARMRegisterInfo(const ARMBaseInstrInfo &tii, Modified: llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp?rev=129723&r1=129722&r2=129723&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp Mon Apr 18 16:35:54 2011 @@ -31,8 +31,6 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/Target/TargetFrameLowering.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/ADT/BitVector.h" -#include "llvm/ADT/SmallVector.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" Modified: llvm/trunk/lib/Target/ARM/Thumb2RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2RegisterInfo.cpp?rev=129723&r1=129722&r2=129723&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/Thumb2RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/ARM/Thumb2RegisterInfo.cpp Mon Apr 18 16:35:54 2011 @@ -13,26 +13,15 @@ //===----------------------------------------------------------------------===// #include "ARM.h" -#include "ARMAddressingModes.h" -#include "ARMBaseInstrInfo.h" -#include "ARMMachineFunctionInfo.h" #include "ARMSubtarget.h" #include "Thumb2InstrInfo.h" #include "Thumb2RegisterInfo.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Function.h" -#include "llvm/LLVMContext.h" #include "llvm/CodeGen/MachineConstantPool.h" -#include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" -#include "llvm/CodeGen/MachineLocation.h" -#include "llvm/CodeGen/MachineRegisterInfo.h" -#include "llvm/Target/TargetMachine.h" -#include "llvm/ADT/BitVector.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/ErrorHandling.h" using namespace llvm; Thumb2RegisterInfo::Thumb2RegisterInfo(const ARMBaseInstrInfo &tii, From dpatel at apple.com Mon Apr 18 17:27:20 2011 From: dpatel at apple.com (Devang Patel) Date: Mon, 18 Apr 2011 22:27:20 -0000 Subject: [llvm-commits] [llvm] r129725 - /llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp Message-ID: <20110418222720.D804A2A6C12C@llvm.org> Author: dpatel Date: Mon Apr 18 17:27:20 2011 New Revision: 129725 URL: http://llvm.org/viewvc/llvm-project?rev=129725&view=rev Log: Remove test to check line numbers. There are other numerous tests in our test harness to check line number information. Removed: llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp Removed: llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2009-07-15-LineNumbers.cpp?rev=129724&view=auto ============================================================================== --- llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp (original) +++ llvm/trunk/test/FrontendC++/2009-07-15-LineNumbers.cpp (removed) @@ -1,27 +0,0 @@ -// This is a regression test on debug info to make sure that we can -// print line numbers in asm. -// RUN: %llvmgcc -S -O0 -g %s -o - | \ -// RUN: llc --disable-fp-elim -O0 -relocation-model=pic | grep {2009-07-15-LineNumbers.cpp:25$} - -#include - -class DeepStack { - int seedVal; -public: - DeepStack(int seed) : seedVal(seed) {} - - int shallowest( int x ) { return shallower(x + 1); } - int shallower ( int x ) { return shallow(x + 2); } - int shallow ( int x ) { return deep(x + 3); } - int deep ( int x ) { return deeper(x + 4); } - int deeper ( int x ) { return deepest(x + 6); } - int deepest ( int x ) { return x + 7; } - - int runit() { return shallowest(seedVal); } -}; - -int main ( int argc, char** argv) { - - DeepStack DS9( (argc > 1 ? atoi(argv[1]) : 0) ); - return DS9.runit(); -} From isanbard at gmail.com Mon Apr 18 17:32:57 2011 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 18 Apr 2011 22:32:57 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r129726 - /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/torture/pr18582-1.c Message-ID: <20110418223258.0942E2A6C12C@llvm.org> Author: void Date: Mon Apr 18 17:32:57 2011 New Revision: 129726 URL: http://llvm.org/viewvc/llvm-project?rev=129726&view=rev Log: Clang has a native way of specifying loads like these and doesn't use the builtin calls. Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/torture/pr18582-1.c Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/torture/pr18582-1.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/torture/pr18582-1.c?rev=129726&r1=129725&r2=129726&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/torture/pr18582-1.c (original) +++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.dg/torture/pr18582-1.c Mon Apr 18 17:32:57 2011 @@ -18,7 +18,10 @@ cva[0] = __builtin_ia32_loaddqu (ca); cva[0] = __builtin_ia32_lddqu (ca); + /* LLVM LOCAL begin: - disable for clang */ +#ifndef __clang__ fva[0] = __builtin_ia32_loadups (fa); - dva[0] = __builtin_ia32_loadupd (da); +#endif + /* LLVM LOCAL end: - disable for clang */ } From kremenek at apple.com Mon Apr 18 17:44:46 2011 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 18 Apr 2011 22:44:46 -0000 Subject: [llvm-commits] [llvm] r129727 - in /llvm/trunk: include/llvm/Support/Allocator.h lib/Support/Allocator.cpp Message-ID: <20110418224446.AFF712A6C12C@llvm.org> Author: kremenek Date: Mon Apr 18 17:44:46 2011 New Revision: 129727 URL: http://llvm.org/viewvc/llvm-project?rev=129727&view=rev Log: Add BumpPtrAllocator::getTotalMemory() to allow clients to query how much memory a BumpPtrAllocator allocated. Modified: llvm/trunk/include/llvm/Support/Allocator.h llvm/trunk/lib/Support/Allocator.cpp Modified: llvm/trunk/include/llvm/Support/Allocator.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Allocator.h?rev=129727&r1=129726&r2=129727&view=diff ============================================================================== --- llvm/trunk/include/llvm/Support/Allocator.h (original) +++ llvm/trunk/include/llvm/Support/Allocator.h Mon Apr 18 17:44:46 2011 @@ -177,6 +177,9 @@ unsigned GetNumSlabs() const; void PrintStats() const; + + /// Compute the total physical memory allocated by this allocator. + size_t getTotalMemory() const; }; /// SpecificBumpPtrAllocator - Same as BumpPtrAllocator but allows only Modified: llvm/trunk/lib/Support/Allocator.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Allocator.cpp?rev=129727&r1=129726&r2=129727&view=diff ============================================================================== --- llvm/trunk/lib/Support/Allocator.cpp (original) +++ llvm/trunk/lib/Support/Allocator.cpp Mon Apr 18 17:44:46 2011 @@ -136,6 +136,14 @@ return NumSlabs; } +size_t BumpPtrAllocator::getTotalMemory() const { + size_t TotalMemory = 0; + for (MemSlab *Slab = CurSlab; Slab != 0; Slab = Slab->NextPtr) { + TotalMemory += Slab->Size; + } + return TotalMemory; +} + void BumpPtrAllocator::PrintStats() const { unsigned NumSlabs = 0; size_t TotalMemory = 0; From dpatel at apple.com Mon Apr 18 18:51:03 2011 From: dpatel at apple.com (Devang Patel) Date: Mon, 18 Apr 2011 23:51:03 -0000 Subject: [llvm-commits] [llvm] r129735 - /llvm/trunk/lib/Analysis/DIBuilder.cpp Message-ID: <20110418235103.6EFFC2A6C12C@llvm.org> Author: dpatel Date: Mon Apr 18 18:51:03 2011 New Revision: 129735 URL: http://llvm.org/viewvc/llvm-project?rev=129735&view=rev Log: Use ArrayRef variants. Modified: llvm/trunk/lib/Analysis/DIBuilder.cpp Modified: llvm/trunk/lib/Analysis/DIBuilder.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DIBuilder.cpp?rev=129735&r1=129734&r2=129735&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/DIBuilder.cpp (original) +++ llvm/trunk/lib/Analysis/DIBuilder.cpp Mon Apr 18 18:51:03 2011 @@ -50,7 +50,7 @@ MDString::get(VMContext, Flags), ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer) }; - TheCU = DICompileUnit(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + TheCU = DICompileUnit(MDNode::get(VMContext, Elts)); } /// createFile - Create a file descriptor to hold debugging information @@ -63,7 +63,7 @@ MDString::get(VMContext, Directory), TheCU }; - return DIFile(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIFile(MDNode::get(VMContext, Elts)); } /// createEnumerator - Create a single enumerator value. @@ -73,7 +73,7 @@ MDString::get(VMContext, Name), ConstantInt::get(Type::getInt64Ty(VMContext), Val) }; - return DIEnumerator(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIEnumerator(MDNode::get(VMContext, Elts)); } /// createBasicType - Create debugging information entry for a basic @@ -95,7 +95,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags; ConstantInt::get(Type::getInt32Ty(VMContext), Encoding) }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createQaulifiedType - Create debugging information entry for a qualified @@ -114,7 +114,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags FromTy }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createPointerType - Create debugging information entry for a pointer. @@ -133,7 +133,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags PointeeTy }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createReferenceType - Create debugging information entry for a reference. @@ -151,7 +151,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags RTy }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createTypedef - Create debugging information entry for a typedef. @@ -171,7 +171,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags Ty }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createFriend - Create debugging information entry for a 'friend'. @@ -191,7 +191,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags FriendTy }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createInheritance - Create debugging information entry to establish @@ -211,7 +211,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), Flags), BaseTy }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createMemberType - Create debugging information entry for a member. @@ -233,7 +233,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), Flags), Ty }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createObjCIVar - Create debugging information entry for Objective-C @@ -262,7 +262,7 @@ MDString::get(VMContext, SetterName), ConstantInt::get(Type::getInt32Ty(VMContext), PropertyAttributes) }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createClassType - Create debugging information entry for a class. @@ -289,7 +289,7 @@ VTableHoder, TemplateParams }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createTemplateTypeParameter - Create debugging information for template @@ -307,8 +307,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), ConstantInt::get(Type::getInt32Ty(VMContext), ColumnNo) }; - return DITemplateTypeParameter(MDNode::get(VMContext, &Elts[0], - array_lengthof(Elts))); + return DITemplateTypeParameter(MDNode::get(VMContext, Elts)); } /// createTemplateValueParameter - Create debugging information for template @@ -328,8 +327,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), LineNo), ConstantInt::get(Type::getInt32Ty(VMContext), ColumnNo) }; - return DITemplateValueParameter(MDNode::get(VMContext, &Elts[0], - array_lengthof(Elts))); + return DITemplateValueParameter(MDNode::get(VMContext, Elts)); } /// createStructType - Create debugging information entry for a struct. @@ -354,7 +352,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang), llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createUnionType - Create debugging information entry for an union. @@ -379,7 +377,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang), llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createSubroutineType - Create subroutine type. @@ -400,7 +398,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createEnumerationType - Create debugging information entry for an @@ -425,7 +423,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), }; - MDNode *Node = MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)); + MDNode *Node = MDNode::get(VMContext, Elts); NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.enum"); NMD->addOperand(Node); return DIType(Node); @@ -450,7 +448,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createVectorType - Create debugging information entry for a vector. @@ -472,7 +470,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 0), llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)), }; - return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DIType(MDNode::get(VMContext, Elts)); } /// createArtificialType - Create a new DIType with "artificial" flag set. @@ -496,7 +494,7 @@ // Flags are stored at this slot. Elts[8] = ConstantInt::get(Type::getInt32Ty(VMContext), CurFlags); - return DIType(MDNode::get(VMContext, Elts.data(), Elts.size())); + return DIType(MDNode::get(VMContext, Elts)); } /// retainType - Retain DIType in a module even if it is not referenced @@ -512,7 +510,7 @@ Value *Elts[] = { GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_parameters) }; - return DIDescriptor(MDNode::get(VMContext, &Elts[0], 1)); + return DIDescriptor(MDNode::get(VMContext, Elts)); } /// createTemporaryType - Create a temporary forward-declared type. @@ -520,7 +518,7 @@ // Give the temporary MDNode a tag. It doesn't matter what tag we // use here as long as DIType accepts it. Value *Elts[] = { GetTagConstant(VMContext, DW_TAG_base_type) }; - MDNode *Node = MDNode::getTemporary(VMContext, Elts, array_lengthof(Elts)); + MDNode *Node = MDNode::getTemporary(VMContext, Elts, 1); return DIType(Node); } @@ -556,7 +554,7 @@ ConstantInt::get(Type::getInt64Ty(VMContext), Hi) }; - return DISubrange(MDNode::get(VMContext, &Elts[0], 3)); + return DISubrange(MDNode::get(VMContext, Elts)); } /// createGlobalVariable - Create a new descriptor for the specified global. @@ -577,7 +575,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 1), /* isDefinition*/ Val }; - MDNode *Node = MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)); + MDNode *Node = MDNode::get(VMContext, Elts); // Create a named metadata so that we do not lose this mdnode. NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.gv"); NMD->addOperand(Node); @@ -604,7 +602,7 @@ ConstantInt::get(Type::getInt32Ty(VMContext), 1), /* isDefinition*/ Val }; - MDNode *Node = MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)); + MDNode *Node = MDNode::get(VMContext, Elts); // Create a named metadata so that we do not lose this mdnode. NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.gv"); NMD->addOperand(Node); @@ -626,7 +624,7 @@ Ty, ConstantInt::get(Type::getInt32Ty(VMContext), Flags) }; - MDNode *Node = MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)); + MDNode *Node = MDNode::get(VMContext, Elts); if (AlwaysPreserve) { // The optimizer may remove local variable. If there is an interest // to preserve variable info in such situation then stash it in a @@ -660,7 +658,7 @@ Elts.push_back(Ty); Elts.append(Addr, Addr+NumAddr); - return DIVariable(MDNode::get(VMContext, Elts.data(), Elts.size())); + return DIVariable(MDNode::get(VMContext, Elts)); } /// createFunction - Create a new descriptor for the specified function. @@ -693,7 +691,7 @@ Fn, TParams }; - MDNode *Node = MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)); + MDNode *Node = MDNode::get(VMContext, Elts); // Create a named metadata so that we do not lose this mdnode. NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.sp"); @@ -735,7 +733,7 @@ Fn, TParam, }; - MDNode *Node = MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)); + MDNode *Node = MDNode::get(VMContext, Elts); // Create a named metadata so that we do not lose this mdnode. NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.sp"); @@ -754,7 +752,7 @@ File, ConstantInt::get(Type::getInt32Ty(VMContext), LineNo) }; - return DINameSpace(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DINameSpace(MDNode::get(VMContext, Elts)); } DILexicalBlock DIBuilder::createLexicalBlock(DIDescriptor Scope, DIFile File, @@ -769,7 +767,7 @@ File, ConstantInt::get(Type::getInt32Ty(VMContext), unique_id++) }; - return DILexicalBlock(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts))); + return DILexicalBlock(MDNode::get(VMContext, Elts)); } /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call. From geek4civic at gmail.com Mon Apr 18 18:59:50 2011 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Mon, 18 Apr 2011 23:59:50 -0000 Subject: [llvm-commits] [llvm] r129736 - in /llvm/trunk/docs: ./ CommandGuide/ tutorial/ Message-ID: <20110418235951.CA7AA2A6C12C@llvm.org> Author: chapuni Date: Mon Apr 18 18:59:50 2011 New Revision: 129736 URL: http://llvm.org/viewvc/llvm-project?rev=129736&view=rev Log: docs: Use as Heading elements instead of
. H1 ... doc_title H2 ... doc_section H3 ... doc_subsection H4 ... doc_subsubsection Modified: llvm/trunk/docs/AliasAnalysis.html llvm/trunk/docs/BitCodeFormat.html llvm/trunk/docs/Bugpoint.html llvm/trunk/docs/CMake.html llvm/trunk/docs/CodeGenerator.html llvm/trunk/docs/CodingStandards.html llvm/trunk/docs/CommandGuide/index.html llvm/trunk/docs/CommandLine.html llvm/trunk/docs/CompilerWriterInfo.html llvm/trunk/docs/DebuggingJITedCode.html llvm/trunk/docs/DeveloperPolicy.html llvm/trunk/docs/ExceptionHandling.html llvm/trunk/docs/ExtendingLLVM.html llvm/trunk/docs/FAQ.html llvm/trunk/docs/GCCFEBuildInstrs.html llvm/trunk/docs/GarbageCollection.html llvm/trunk/docs/GetElementPtr.html llvm/trunk/docs/GettingStarted.html llvm/trunk/docs/GettingStartedVS.html llvm/trunk/docs/GoldPlugin.html llvm/trunk/docs/HowToReleaseLLVM.html llvm/trunk/docs/HowToSubmitABug.html llvm/trunk/docs/LangRef.html llvm/trunk/docs/Lexicon.html llvm/trunk/docs/LinkTimeOptimization.html llvm/trunk/docs/MakefileGuide.html llvm/trunk/docs/Packaging.html llvm/trunk/docs/Passes.html llvm/trunk/docs/ProgrammersManual.html llvm/trunk/docs/Projects.html llvm/trunk/docs/SourceLevelDebugging.html llvm/trunk/docs/SystemLibrary.html llvm/trunk/docs/TableGenFundamentals.html llvm/trunk/docs/TestingGuide.html llvm/trunk/docs/UsingLibraries.html llvm/trunk/docs/WritingAnLLVMBackend.html llvm/trunk/docs/WritingAnLLVMPass.html llvm/trunk/docs/index.html llvm/trunk/docs/tutorial/LangImpl1.html llvm/trunk/docs/tutorial/LangImpl2.html llvm/trunk/docs/tutorial/LangImpl3.html llvm/trunk/docs/tutorial/LangImpl4.html llvm/trunk/docs/tutorial/LangImpl5.html llvm/trunk/docs/tutorial/LangImpl6.html llvm/trunk/docs/tutorial/LangImpl7.html llvm/trunk/docs/tutorial/LangImpl8.html llvm/trunk/docs/tutorial/OCamlLangImpl1.html llvm/trunk/docs/tutorial/OCamlLangImpl2.html llvm/trunk/docs/tutorial/OCamlLangImpl3.html llvm/trunk/docs/tutorial/OCamlLangImpl4.html llvm/trunk/docs/tutorial/OCamlLangImpl5.html llvm/trunk/docs/tutorial/OCamlLangImpl6.html llvm/trunk/docs/tutorial/OCamlLangImpl7.html llvm/trunk/docs/tutorial/OCamlLangImpl8.html llvm/trunk/docs/tutorial/index.html Modified: llvm/trunk/docs/AliasAnalysis.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AliasAnalysis.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/AliasAnalysis.html (original) +++ llvm/trunk/docs/AliasAnalysis.html Mon Apr 18 18:59:50 2011 @@ -7,9 +7,9 @@ -
+

LLVM Alias Analysis Infrastructure -

+
  1. Introduction
  2. @@ -59,9 +59,9 @@
- +
@@ -96,9 +96,9 @@
- +
@@ -125,9 +125,9 @@
- +
@@ -181,9 +181,9 @@
- +

The alias method is the primary interface used to determine whether @@ -197,9 +197,9 @@

- +

The NoAlias response may be used when there is never an immediate dependence @@ -228,9 +228,9 @@

- +
@@ -250,9 +250,9 @@ - +
@@ -264,9 +264,9 @@
-
+

The pointsToConstantMemory method -

+
@@ -279,10 +279,10 @@
- +
@@ -308,9 +308,9 @@
- +
@@ -324,9 +324,9 @@
- +
@@ -352,9 +352,9 @@
- +
@@ -393,9 +393,9 @@
- +
@@ -412,9 +412,9 @@ - +
@@ -451,9 +451,9 @@ - +

@@ -474,7 +474,7 @@

-
The deleteValue method
+

The deleteValue method

The deleteValue method is called by transformations when they remove an @@ -485,7 +485,7 @@
-
The copyValue method
+

The copyValue method

The copyValue method is used when a new value is introduced into the @@ -496,7 +496,7 @@
-
The replaceWithNewValue method
+

The replaceWithNewValue method

This method is a simple helper method that is provided to make clients easier to @@ -506,7 +506,7 @@
-
The addEscapingUse method
+

The addEscapingUse method

The addEscapingUse method is used when the uses of a pointer @@ -528,9 +528,9 @@

- +
@@ -544,9 +544,9 @@
- +
@@ -617,9 +617,9 @@
- +
@@ -630,9 +630,9 @@
- +
@@ -645,9 +645,9 @@
- +
@@ -681,9 +681,9 @@
-
+

The AliasSetTracker implementation -

+
@@ -707,9 +707,9 @@
- +
@@ -722,9 +722,9 @@
- +
@@ -738,9 +738,9 @@
- +
@@ -752,9 +752,9 @@
- +
@@ -766,9 +766,9 @@
- +
@@ -794,9 +794,9 @@
- +
@@ -818,9 +818,9 @@
- +
@@ -841,9 +841,9 @@
- +
@@ -864,9 +864,9 @@
- +
@@ -878,9 +878,9 @@
- +
LLVM includes several alias-analysis driven transformations which can be used @@ -888,9 +888,9 @@
- +
@@ -902,9 +902,9 @@ - +
@@ -927,9 +927,9 @@
- +

@@ -942,10 +942,10 @@

- +
@@ -955,10 +955,10 @@
- +
@@ -969,9 +969,9 @@
- +
@@ -990,9 +990,9 @@ - +
@@ -1014,9 +1014,9 @@
- +
@@ -1029,9 +1029,9 @@
- +
Modified: llvm/trunk/docs/BitCodeFormat.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/BitCodeFormat.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/BitCodeFormat.html (original) +++ llvm/trunk/docs/BitCodeFormat.html Mon Apr 18 18:59:50 2011 @@ -7,7 +7,7 @@ -
LLVM Bitcode File Format
+

LLVM Bitcode File Format

  1. Abstract
  2. Overview
  3. @@ -47,7 +47,7 @@
- +

Abstract

@@ -58,7 +58,7 @@
- +

Overview

@@ -88,7 +88,7 @@
- +

Bitstream Format

@@ -117,8 +117,9 @@
- +

+ Magic Numbers +

@@ -130,8 +131,9 @@
- +

+ Primitives +

@@ -147,8 +149,9 @@
- +

+ Fixed Width Integers +

@@ -161,8 +164,9 @@
- +

+ Variable Width Integers +

@@ -182,7 +186,7 @@
- +

6-bit characters

@@ -206,7 +210,7 @@
- +

Word Alignment

@@ -218,8 +222,9 @@ - +

+ Abbreviation IDs +

@@ -253,8 +258,9 @@
- +

+ Blocks +

@@ -300,8 +306,7 @@
- +

ENTER_SUBBLOCK Encoding

@@ -322,8 +327,7 @@
- +

END_BLOCK Encoding

@@ -340,8 +344,9 @@ - +

+ Data Records +

@@ -358,8 +363,7 @@

- +

UNABBREV_RECORD Encoding

@@ -385,8 +389,7 @@
- +

Abbreviated Record Encoding

@@ -410,8 +413,9 @@
- +

+ Abbreviations +

@@ -434,8 +438,7 @@

- +

DEFINE_ABBREV Encoding

@@ -553,8 +556,9 @@
- +

+ Standard Blocks +

@@ -568,8 +572,7 @@
- +

#0 - BLOCKINFO Block

@@ -621,7 +624,7 @@
- +

Bitcode Wrapper Format

@@ -652,7 +655,7 @@
- +

LLVM IR Encoding

@@ -669,11 +672,12 @@
- +

+ Basics +

- +

LLVM IR Magic Number

@@ -695,7 +699,7 @@
- +

Signed VBRs

@@ -728,7 +732,7 @@ - +

LLVM IR Blocks

@@ -759,8 +763,9 @@
- +

+ MODULE_BLOCK Contents +

@@ -785,8 +790,7 @@
- +

MODULE_CODE_VERSION Record

@@ -798,8 +802,7 @@
- +

MODULE_CODE_TRIPLE Record

[TRIPLE, ...string...]

@@ -810,8 +813,7 @@
- +

MODULE_CODE_DATALAYOUT Record

[DATALAYOUT, ...string...]

@@ -822,8 +824,7 @@
- +

MODULE_CODE_ASM Record

[ASM, ...string...]

@@ -834,8 +835,7 @@
- +

MODULE_CODE_SECTIONNAME Record

[SECTIONNAME, ...string...]

@@ -850,8 +850,7 @@
- +

MODULE_CODE_DEPLIB Record

[DEPLIB, ...string...]

@@ -864,8 +863,7 @@
- +

MODULE_CODE_GLOBALVAR Record

[GLOBALVAR, pointer type, isconst, initid, linkage, alignment, section, visibility, threadlocal]

@@ -929,8 +927,7 @@
- +

MODULE_CODE_FUNCTION Record

@@ -986,8 +983,7 @@
- +

MODULE_CODE_ALIAS Record

@@ -1011,8 +1007,7 @@
- +

MODULE_CODE_PURGEVALS Record

[PURGEVALS, numvals]

@@ -1025,8 +1020,7 @@
- +

MODULE_CODE_GCNAME Record

[GCNAME, ...string...]

@@ -1040,8 +1034,9 @@
- +

+ PARAMATTR_BLOCK Contents +

@@ -1061,8 +1056,7 @@ - +

PARAMATTR_CODE_ENTRY Record

@@ -1106,8 +1100,9 @@
- +

+ TYPE_BLOCK Contents +

@@ -1127,8 +1122,7 @@
- +

TYPE_CODE_NUMENTRY Record

@@ -1142,8 +1136,7 @@
- +

TYPE_CODE_VOID Record

@@ -1155,8 +1148,7 @@
- +

TYPE_CODE_FLOAT Record

@@ -1168,8 +1160,7 @@
- +

TYPE_CODE_DOUBLE Record

@@ -1181,8 +1172,7 @@
- +

TYPE_CODE_LABEL Record

@@ -1194,8 +1184,7 @@
- +

TYPE_CODE_OPAQUE Record

@@ -1208,8 +1197,7 @@
- +

TYPE_CODE_INTEGER Record

@@ -1222,8 +1210,7 @@
- +

TYPE_CODE_POINTER Record

@@ -1243,8 +1230,7 @@
- +

TYPE_CODE_FUNCTION Record

@@ -1268,8 +1254,7 @@
- +

TYPE_CODE_STRUCT Record

@@ -1287,8 +1272,7 @@
- +

TYPE_CODE_ARRAY Record

@@ -1305,8 +1289,7 @@
- +

TYPE_CODE_VECTOR Record

@@ -1323,8 +1306,7 @@
- +

TYPE_CODE_X86_FP80 Record

@@ -1336,8 +1318,7 @@
- +

TYPE_CODE_FP128 Record

@@ -1349,8 +1330,7 @@
- +

TYPE_CODE_PPC_FP128 Record

@@ -1362,8 +1342,7 @@
- +

TYPE_CODE_METADATA Record

@@ -1375,8 +1354,9 @@
- +

+ CONSTANTS_BLOCK Contents +

@@ -1387,8 +1367,9 @@ - +

+ FUNCTION_BLOCK Contents +

@@ -1409,8 +1390,9 @@ - +

+ TYPE_SYMTAB_BLOCK Contents +

@@ -1422,8 +1404,7 @@
- +

TST_CODE_ENTRY Record

@@ -1438,8 +1419,9 @@ - +

+ VALUE_SYMTAB_BLOCK Contents +

@@ -1450,8 +1432,9 @@ - +

+ METADATA_BLOCK Contents +

@@ -1462,8 +1445,9 @@ - +

+ METADATA_ATTACHMENT Contents +

Modified: llvm/trunk/docs/Bugpoint.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Bugpoint.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/Bugpoint.html (original) +++ llvm/trunk/docs/Bugpoint.html Mon Apr 18 18:59:50 2011 @@ -6,9 +6,9 @@ -
+

LLVM bugpoint tool: design and usage -

+
- +
@@ -50,9 +50,9 @@
- +
@@ -71,9 +71,9 @@
- +
@@ -104,9 +104,9 @@
- +
@@ -129,9 +129,9 @@
- +
@@ -150,9 +150,9 @@
- +
@@ -167,9 +167,9 @@
- +
Modified: llvm/trunk/docs/CMake.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/CMake.html (original) +++ llvm/trunk/docs/CMake.html Mon Apr 18 18:59:50 2011 @@ -6,9 +6,9 @@ -
+

Building LLVM with CMake -

+
- +
@@ -59,9 +59,9 @@
- +
@@ -112,9 +112,9 @@
- +
@@ -160,9 +160,9 @@
- +
@@ -197,9 +197,9 @@
- +
@@ -240,9 +240,9 @@
- +
@@ -358,9 +358,9 @@
- +
@@ -378,9 +378,9 @@
- +
@@ -399,9 +399,9 @@
- +
@@ -462,9 +462,9 @@
- +
@@ -519,9 +519,9 @@ - +
@@ -530,9 +530,9 @@
- +
Modified: llvm/trunk/docs/CodeGenerator.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodeGenerator.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/CodeGenerator.html (original) +++ llvm/trunk/docs/CodeGenerator.html Mon Apr 18 18:59:50 2011 @@ -19,9 +19,9 @@ -
+

The LLVM Target-Independent Code Generator -

+
  1. Introduction @@ -127,9 +127,9 @@
- +
@@ -191,9 +191,9 @@
- +
@@ -223,9 +223,9 @@
- +
@@ -297,9 +297,9 @@
- +
@@ -325,9 +325,9 @@
- +
@@ -349,9 +349,9 @@
- +
@@ -369,9 +369,9 @@
- +
@@ -385,9 +385,9 @@
- +
@@ -411,9 +411,9 @@
- +
@@ -445,9 +445,9 @@
- +
@@ -463,9 +463,9 @@
- +
@@ -479,9 +479,9 @@
- +
@@ -495,9 +495,9 @@ - +
@@ -510,9 +510,9 @@
- +
@@ -531,9 +531,9 @@
- +
@@ -579,9 +579,9 @@
- +
@@ -630,9 +630,9 @@
- +
@@ -702,9 +702,9 @@
- +
@@ -720,9 +720,9 @@
- +
@@ -737,9 +737,9 @@
- +
@@ -756,9 +756,9 @@ - +
@@ -783,9 +783,9 @@ - +
@@ -817,9 +817,9 @@
- +
@@ -832,9 +832,9 @@
- +
@@ -864,9 +864,9 @@
- +
@@ -882,9 +882,9 @@
- +
@@ -906,9 +906,9 @@ - +
@@ -920,9 +920,9 @@
- +
@@ -939,9 +939,9 @@
- +
@@ -1001,9 +1001,9 @@
- +
@@ -1082,9 +1082,9 @@
- +
@@ -1102,9 +1102,9 @@
- +
@@ -1135,9 +1135,9 @@
- +
@@ -1167,10 +1167,11 @@
- +

+ + SelectionDAG Optimization Phase: the DAG Combiner + +

@@ -1202,9 +1203,9 @@
- +
@@ -1363,9 +1364,9 @@
- +
@@ -1384,9 +1385,9 @@
- +
@@ -1399,15 +1400,15 @@
- +

To Be Written

- +
@@ -1420,9 +1421,9 @@
- +
@@ -1466,9 +1467,9 @@
- +
@@ -1486,9 +1487,9 @@
- +
@@ -1504,9 +1505,9 @@ - +
@@ -1617,9 +1618,9 @@ - +
@@ -1667,9 +1668,9 @@
- +
@@ -1703,9 +1704,9 @@
- +
@@ -1727,9 +1728,9 @@
- +
@@ -1764,9 +1765,9 @@ - +
@@ -1806,20 +1807,20 @@
- +

To Be Written

- +

To Be Written

- +
@@ -1882,9 +1883,9 @@ - +
@@ -1899,15 +1900,15 @@
-
Instruction Parsing
+

Instruction Parsing

To Be Written

-
+

Instruction Alias Processing -

+

Once the instruction is parsed, it enters the MatchInstructionImpl function. @@ -1925,7 +1926,7 @@

-
Mnemonic Aliases
+

Mnemonic Aliases

@@ -1965,7 +1966,7 @@
-
Instruction Aliases
+

Instruction Aliases

@@ -2031,7 +2032,7 @@ -
Instruction Matching
+

Instruction Matching

To Be Written

@@ -2039,9 +2040,9 @@ - +
@@ -2053,9 +2054,9 @@
- +
@@ -2231,7 +2232,7 @@
-
Is Generally Reliable
+

Is Generally Reliable

This box indicates whether the target is considered to be production quality. @@ -2241,7 +2242,7 @@

-
Assembly Parser
+

Assembly Parser

This box indicates whether the target supports parsing target specific .s @@ -2253,7 +2254,7 @@ -

Disassembler
+

Disassembler

This box indicates whether the target supports the MCDisassembler API for @@ -2262,7 +2263,7 @@

-
Inline Asm
+

Inline Asm

This box indicates whether the target supports most popular inline assembly @@ -2274,7 +2275,7 @@

-
JIT Support
+

JIT Support

This box indicates whether the target supports the JIT compiler through @@ -2286,7 +2287,7 @@

-
.o File Writing
+

.o File Writing

@@ -2302,7 +2303,7 @@
-
Tail Calls
+

Tail Calls

@@ -2317,9 +2318,9 @@ - +
@@ -2383,9 +2384,9 @@
- +
@@ -2427,9 +2428,9 @@
- +
@@ -2440,9 +2441,9 @@
- +
@@ -2469,9 +2470,9 @@
- +
@@ -2489,9 +2490,9 @@
- +
@@ -2526,9 +2527,9 @@
- +
@@ -2571,9 +2572,9 @@
- +
@@ -2592,9 +2593,9 @@
- +
@@ -2605,9 +2606,9 @@
- +
@@ -2625,9 +2626,9 @@
- +
@@ -2772,9 +2773,9 @@
- +
@@ -2789,9 +2790,9 @@
- +
Modified: llvm/trunk/docs/CodingStandards.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CodingStandards.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/CodingStandards.html (original) +++ llvm/trunk/docs/CodingStandards.html Mon Apr 18 18:59:50 2011 @@ -7,9 +7,9 @@ -
+

LLVM Coding Standards -

+
  1. Introduction
  2. @@ -83,9 +83,9 @@ - +
    @@ -117,20 +117,20 @@
    - + - + - +
    @@ -208,9 +208,9 @@
    - +
    @@ -233,9 +233,9 @@
    - +
    @@ -273,9 +273,9 @@
    - +
    @@ -298,9 +298,9 @@
    - +
    @@ -319,9 +319,9 @@
    - +
    @@ -333,15 +333,15 @@ - + - +
    @@ -393,9 +393,9 @@
    - +
    @@ -412,9 +412,9 @@
    - +

    In an effort to reduce code and executable size, LLVM does not use RTTI @@ -433,9 +433,9 @@

    - +

    In C++, the class and struct keywords can be used almost @@ -455,23 +455,23 @@

    - + - + - +
    @@ -499,9 +499,9 @@
    - +
    @@ -528,9 +528,9 @@
    - +
    @@ -549,9 +549,9 @@
    - +
    @@ -658,9 +658,9 @@
    - +
    @@ -741,9 +741,9 @@
    - +
    @@ -804,16 +804,18 @@ - + - +

    + + Name Types, Functions, Variables, and Enumerators Properly + +

    @@ -894,9 +896,9 @@ - +
    @@ -997,9 +999,9 @@
    - +
    @@ -1035,10 +1037,11 @@
    - +

    + + Provide a Virtual Method Anchor for Classes in Headers + +

    @@ -1052,9 +1055,9 @@
    - +
    @@ -1114,9 +1117,9 @@
    - +
    @@ -1149,9 +1152,9 @@ - +
    @@ -1169,9 +1172,9 @@ - +
    @@ -1193,18 +1196,18 @@ - +

    This section describes preferred low-level formatting guidelines along with reasoning on why we prefer them.

    - +
    @@ -1260,9 +1263,9 @@
    - +
    @@ -1280,9 +1283,9 @@
    - +
    @@ -1368,9 +1371,9 @@
    - +
    @@ -1455,9 +1458,9 @@ - +
    Modified: llvm/trunk/docs/CommandGuide/index.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/index.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/CommandGuide/index.html (original) +++ llvm/trunk/docs/CommandGuide/index.html Mon Apr 18 18:59:50 2011 @@ -7,9 +7,9 @@ -
    +

    LLVM Command Guide -

    +
    @@ -23,9 +23,9 @@
    - +
    @@ -80,9 +80,9 @@
    - +
    @@ -99,9 +99,9 @@
    - + @@ -123,9 +123,9 @@
    - +
    Modified: llvm/trunk/docs/CommandLine.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandLine.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/CommandLine.html (original) +++ llvm/trunk/docs/CommandLine.html Mon Apr 18 18:59:50 2011 @@ -8,9 +8,9 @@ -
    +

    CommandLine 2.0 Library Manual -

    +
    1. Introduction
    2. @@ -100,9 +100,9 @@
    - +
    @@ -184,9 +184,9 @@
    - +
    @@ -324,9 +324,9 @@
    - +
    @@ -406,9 +406,9 @@
    - +
    @@ -456,10 +456,10 @@
    - +
    @@ -567,9 +567,9 @@
    - +
    @@ -629,9 +629,9 @@
    - +
    @@ -699,9 +699,9 @@
    - +
    @@ -758,9 +758,9 @@ - +
    @@ -802,9 +802,9 @@ - +
    @@ -817,9 +817,9 @@
    - +
    @@ -858,9 +858,9 @@ - +
    @@ -895,9 +895,9 @@
    - +

    Sometimes an option can affect or modify the meaning of another option. For example, consider gcc's -x LANG option. This tells @@ -954,9 +954,9 @@

    - +
    @@ -1007,9 +1007,9 @@
    - +
    @@ -1076,9 +1076,9 @@
    - +
    @@ -1166,9 +1166,9 @@
    - +
    @@ -1199,9 +1199,9 @@
    - +
    @@ -1230,10 +1230,10 @@
    - +
    @@ -1279,9 +1279,9 @@
    - +
    @@ -1328,9 +1328,9 @@
    - +
    @@ -1409,9 +1409,9 @@
    - +
    @@ -1453,9 +1453,9 @@
    - +
    @@ -1476,9 +1476,9 @@ - +
    @@ -1493,10 +1493,10 @@
    - +
    @@ -1514,10 +1514,10 @@
    - +
    @@ -1551,10 +1551,10 @@
    - +
    @@ -1572,9 +1572,9 @@
    - +
    @@ -1607,9 +1607,9 @@
    - +
    @@ -1634,9 +1634,9 @@
    - +
    @@ -1659,9 +1659,9 @@
    - +
    @@ -1682,9 +1682,9 @@
    - +
    @@ -1710,9 +1710,9 @@
    - +
    @@ -1774,9 +1774,9 @@
    - +
    @@ -1789,9 +1789,9 @@
    - +
    @@ -1932,9 +1932,9 @@
    - +

    Several of the LLVM libraries define static cl::opt instances that @@ -1951,9 +1951,9 @@

    - +
    Modified: llvm/trunk/docs/CompilerWriterInfo.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CompilerWriterInfo.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/CompilerWriterInfo.html (original) +++ llvm/trunk/docs/CompilerWriterInfo.html Mon Apr 18 18:59:50 2011 @@ -9,9 +9,9 @@ -
    +

    Architecture/platform information for compiler writers -

    +

    Note: This document is a work-in-progress. Additions and clarifications @@ -43,11 +43,11 @@

    - +

    Hardware

    - +

    Alpha

      @@ -58,7 +58,7 @@
    - +

    ARM

      @@ -70,7 +70,7 @@
    - +

    Itanium (ia64)

      @@ -81,7 +81,7 @@
    - +

    MIPS

      @@ -92,10 +92,10 @@
    - +

    PowerPC

    -
    IBM - Official manuals and docs
    +

    IBM - Official manuals and docs

    @@ -129,7 +129,7 @@
    -
    Other documents, collections, notes
    +

    Other documents, collections, notes

    @@ -144,7 +144,7 @@
    - +

    SPARC

    @@ -156,10 +156,10 @@
    - +

    X86

    -
    AMD - Official manuals and docs
    +

    AMD - Official manuals and docs

      @@ -170,7 +170,7 @@
    -
    Intel - Official manuals and docs
    +

    Intel - Official manuals and docs

      @@ -184,7 +184,7 @@
    -
    Other x86-specific information
    +

    Other x86-specific information

      @@ -194,7 +194,7 @@
    - +

    Other relevant lists

    @@ -205,11 +205,11 @@
    - +

    ABI

    - +

    Linux

      @@ -219,7 +219,7 @@
    - +

    OS X

      @@ -233,7 +233,7 @@
    - +

    Miscellaneous resources

      Modified: llvm/trunk/docs/DebuggingJITedCode.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DebuggingJITedCode.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/DebuggingJITedCode.html (original) +++ llvm/trunk/docs/DebuggingJITedCode.html Mon Apr 18 18:59:50 2011 @@ -7,7 +7,7 @@ -
      Debugging JITed Code With GDB
      +

      Debugging JITed Code With GDB

      1. Example usage
      2. Background
      3. @@ -15,7 +15,7 @@
        Written by Reid Kleckner
        - +

        Example usage

        @@ -96,7 +96,7 @@
        - +

        Background

        Modified: llvm/trunk/docs/DeveloperPolicy.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/DeveloperPolicy.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/DeveloperPolicy.html (original) +++ llvm/trunk/docs/DeveloperPolicy.html Mon Apr 18 18:59:50 2011 @@ -8,7 +8,7 @@ -
        LLVM Developer Policy
        +

        LLVM Developer Policy

        1. Introduction
        2. Developer Policies @@ -34,7 +34,7 @@
          Written by the LLVM Oversight Team
          - +

          Introduction

          This document contains the LLVM Developer Policy which defines the project's @@ -63,7 +63,7 @@

          - +

          Developer Policies

          This section contains policies that pertain to frequent LLVM developers. We @@ -75,7 +75,7 @@

          - +

          Stay Informed

          Developers should stay informed by reading at least the "dev" mailing list for the projects you are interested in, such as @@ -102,7 +102,7 @@

          - +

          Making a Patch

          When making a patch for review, the goal is to make it as easy for the @@ -142,7 +142,7 @@

          - +

          Code Reviews

          LLVM has a code review policy. Code review is one way to increase the quality of software. We generally follow these policies:

          @@ -174,7 +174,7 @@
          - +

          Code Owners

          The LLVM Project relies on two features of its process to maintain rapid @@ -225,7 +225,7 @@

          - +

          Test Cases

          Developers are required to create test cases for any bugs fixed and any new features added. Some tips for getting your testcase approved:

          @@ -258,7 +258,7 @@
          - +

          Quality

          The minimum quality standards that any change must satisfy before being committed to the main development branch are:

          @@ -318,8 +318,7 @@
          - +

          Obtaining Commit Access

          We grant commit access to contributors with a track record of submitting high @@ -381,7 +380,7 @@

          - +

          Making a Major Change

          When a developer begins a major new project with the aim of contributing it back to LLVM, s/he should inform the community with an email to @@ -410,8 +409,7 @@

          - +

          Incremental Development

          In the LLVM project, we do all significant changes as a series of incremental patches. We have a strong dislike for huge changes or long-term development @@ -472,8 +470,7 @@

          - +

          Attribution of Changes

          We believe in correct attribution of contributions to their contributors. However, we do not want the source code to be littered with random @@ -487,9 +484,9 @@

          - +
          @@ -507,7 +504,7 @@
          - +

          Copyright

          The LLVM project does not require copyright assignments, which means that the @@ -530,7 +527,7 @@

          - +

          License

          We intend to keep LLVM perpetually open source and to use a liberal open source license. All of the code in LLVM is available under the @@ -585,7 +582,7 @@

          - +

          Patents

          To the best of our knowledge, LLVM does not infringe on any patents (we have actually removed code from LLVM in the past that was found to infringe). Modified: llvm/trunk/docs/ExceptionHandling.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ExceptionHandling.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/ExceptionHandling.html (original) +++ llvm/trunk/docs/ExceptionHandling.html Mon Apr 18 18:59:50 2011 @@ -11,7 +11,7 @@ -

          Exception Handling in LLVM
          +

          Exception Handling in LLVM

          @@ -58,7 +58,7 @@ - +

          Introduction

          @@ -73,9 +73,9 @@
          - +
          @@ -106,9 +106,9 @@
          - +
          @@ -138,9 +138,9 @@
          - +
          @@ -186,9 +186,9 @@
          - +
          @@ -203,9 +203,9 @@
          -
          +

          Throw -

          +
          @@ -225,9 +225,9 @@
          - +
          @@ -313,9 +313,9 @@
          - +
          @@ -332,9 +332,9 @@
          - +
          @@ -359,9 +359,9 @@
          - +
          @@ -385,9 +385,9 @@
          - +
          @@ -398,9 +398,9 @@
          - +
          @@ -413,9 +413,9 @@
          - +
          @@ -445,9 +445,9 @@
          - +
          @@ -463,9 +463,9 @@
          - +
          @@ -492,9 +492,9 @@
          - +
          @@ -512,9 +512,9 @@
          - +
          @@ -531,9 +531,9 @@
          - +
          @@ -549,9 +549,9 @@
          - +
          @@ -566,9 +566,9 @@
          - +
          @@ -578,9 +578,9 @@
          - +
          @@ -596,9 +596,9 @@
          - +
          @@ -612,9 +612,9 @@
          -
          +

          ToDo -

          +
          Modified: llvm/trunk/docs/ExtendingLLVM.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ExtendingLLVM.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/ExtendingLLVM.html (original) +++ llvm/trunk/docs/ExtendingLLVM.html Mon Apr 18 18:59:50 2011 @@ -8,9 +8,9 @@ -
          +

          Extending LLVM: Adding instructions, intrinsics, types, etc. -

          +
          1. Introduction and Warning
          2. @@ -31,9 +31,9 @@
          - +
          @@ -68,9 +68,9 @@
          - +
          @@ -130,9 +130,9 @@
          - +
          @@ -220,9 +220,9 @@
          - +
          @@ -277,9 +277,9 @@ - +
          @@ -291,9 +291,9 @@
          - +
          @@ -317,9 +317,9 @@
          - +
          Modified: llvm/trunk/docs/FAQ.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/FAQ.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/FAQ.html (original) +++ llvm/trunk/docs/FAQ.html Mon Apr 18 18:59:50 2011 @@ -12,9 +12,9 @@ -
          +

          LLVM: Frequently Asked Questions -

          +
          1. License @@ -138,9 +138,9 @@ -
            +

            License -

            +
            @@ -189,9 +189,9 @@
            - +
            @@ -227,9 +227,9 @@
            - +
            @@ -449,7 +449,9 @@
            - +

            + Source Languages +

            - +

            When I compile software that uses a configure script, the configure script @@ -712,9 +714,9 @@

            - +

            What is this llvm.global_ctors and Modified: llvm/trunk/docs/GCCFEBuildInstrs.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GCCFEBuildInstrs.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/GCCFEBuildInstrs.html (original) +++ llvm/trunk/docs/GCCFEBuildInstrs.html Mon Apr 18 18:59:50 2011 @@ -8,9 +8,9 @@ -

            +
            1. Building llvm-gcc from Source
            2. Modified: llvm/trunk/docs/GarbageCollection.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GarbageCollection.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/GarbageCollection.html (original) +++ llvm/trunk/docs/GarbageCollection.html Mon Apr 18 18:59:50 2011 @@ -13,9 +13,9 @@ -
              +

              Accurate Garbage Collection with LLVM -

              +
              1. Introduction @@ -79,9 +79,9 @@
            - +
            @@ -127,9 +127,9 @@
            - +
            @@ -199,9 +199,9 @@
            - +
            @@ -249,9 +249,9 @@
            - +
            @@ -276,9 +276,9 @@
            - +
            @@ -343,9 +343,9 @@ }
            - +
            @@ -373,9 +373,9 @@
            - +
            @@ -393,9 +393,9 @@
            - +
            define ty @name(...) gc "name" { ... @@ -418,9 +418,9 @@
            - +
            void @llvm.gcroot(i8** %ptrloc, i8* %metadata) @@ -494,9 +494,9 @@
            - +
            @@ -537,9 +537,9 @@
            - +
            void @llvm.gcwrite(i8* %value, i8* %object, i8** %derived) @@ -559,9 +559,9 @@
            - +
            i8* @llvm.gcread(i8* %object, i8** %derived)
            @@ -581,9 +581,9 @@
            - +
            @@ -669,9 +669,9 @@
            - +
            @@ -958,9 +958,9 @@
            - +
            @@ -1014,9 +1014,9 @@ - +
            @@ -1039,10 +1039,10 @@ - +
            @@ -1129,9 +1129,9 @@ - +
            @@ -1193,9 +1193,9 @@ - +
            @@ -1343,9 +1343,9 @@ - +
            Modified: llvm/trunk/docs/GetElementPtr.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GetElementPtr.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/GetElementPtr.html (original) +++ llvm/trunk/docs/GetElementPtr.html Mon Apr 18 18:59:50 2011 @@ -11,9 +11,9 @@ -
            +

            The Often Misunderstood GEP Instruction -

            +
            1. Introduction
            2. @@ -58,7 +58,7 @@ - +

              Introduction

              @@ -72,7 +72,7 @@
              - +

              Address Computation

              When people are first confronted with the GEP instruction, they tend to @@ -83,9 +83,9 @@

              - +

              + What is the first index of the GEP instruction? +

              Quick answer: The index stepping through the first operand.

              The confusion with the first index usually arises from thinking about @@ -205,9 +205,9 @@

              - +

              + Why is the extra 0 index required? +

              Quick answer: there are no superfluous indices.

              @@ -247,9 +247,9 @@
              - +

              + What is dereferenced by GEP? +

              Quick answer: nothing.

              The GetElementPtr instruction dereferences nothing. That is, it doesn't @@ -302,9 +302,9 @@

              - +

              + Why don't GEP x,0,0,1 and GEP x,1 alias? +

              Quick Answer: They compute different address locations.

              If you look at the first indices in these GEP @@ -331,9 +331,9 @@

              - +

              + Why do GEP x,1,0,0 and GEP x,1 alias? +

              Quick Answer: They compute the same address location.

              These two GEP instructions will compute the same address because indexing @@ -355,9 +355,9 @@ -

              +

              + Can GEP index into vector elements? +

              This hasn't always been forcefully disallowed, though it's not recommended. It leads to awkward special cases in the optimizers, and fundamental @@ -368,9 +368,9 @@ -

              +

              + What effect do address spaces have on GEPs? +

              None, except that the address space qualifier on the first operand pointer type always matches the address space qualifier on the result type.

              @@ -379,10 +379,11 @@ - +

              + + How is GEP different from ptrtoint, arithmetic, and inttoptr? + +

              It's very similar; there are only subtle differences.

              @@ -409,10 +410,12 @@ - +

              + + I'm writing a backend for a target which needs custom lowering for GEP. + How do I do this? + +

              You don't. The integer computation implied by a GEP is target-independent. Typically what you'll need to do is make your backend pattern-match @@ -431,9 +434,9 @@ -

              +

              + How does VLA addressing work with GEPs? +

              GEPs don't natively support VLAs. LLVM's type system is entirely static, and GEP address computations are guided by an LLVM type.

              @@ -451,14 +454,14 @@
              - +

              Rules

              - +

              + What happens if an array index is out of bounds? +

              There are two senses in which an array index can be out of bounds.

              @@ -498,9 +501,9 @@
              - +

              + Can array indices be negative? +

              Yes. This is basically a special case of array indices being out of bounds.

              @@ -508,9 +511,9 @@
              - +

              + Can I compare two values computed with GEPs? +

              Yes. If both addresses are within the same allocated object, or one-past-the-end, you'll get the comparison result you expect. If either @@ -520,10 +523,12 @@

              - +

              + + Can I do GEP with a different pointer type than the type of + the underlying object? + +

              Yes. There are no restrictions on bitcasting a pointer value to an arbitrary pointer type. The types in a GEP serve only to define the parameters for the @@ -538,10 +543,11 @@

              - +

              + + Can I cast an object's address to integer and add it to null? + +

              You can compute an address that way, but if you use GEP to do the add, you can't use that pointer to actually access the object, unless the @@ -562,10 +568,12 @@

              - +

              + + Can I compute the distance between two objects, and add + that value to one address to compute the other address? + +

              As with arithmetic on null, You can use GEP to compute an address that way, but you can't use that pointer to actually access the object if you @@ -577,9 +585,9 @@

              - +

              + Can I do type-based alias analysis on LLVM IR? +

              You can't do type-based alias analysis using LLVM's built-in type system, because LLVM has no restrictions on mixing types in addressing, loads or @@ -594,9 +602,9 @@ -

              +

              + What happens if a GEP computation overflows? +

              If the GEP lacks the inbounds keyword, the value is the result from evaluating the implied two's complement integer computation. However, @@ -624,10 +632,11 @@ -

              +

              + + How can I tell if my front-end is following the rules? + +

              There is currently no checker for the getelementptr rules. Currently, the only way to do this is to manually check each place in your front-end @@ -642,14 +651,14 @@

              - +

              Rationale

              - +

              + Why is GEP designed this way? +

              The design of GEP has the following goals, in rough unofficial order of priority:

              @@ -669,9 +678,9 @@
              - +

              + Why do struct member indices always use i32? +

              The specific type i32 is probably just a historical artifact, however it's wide enough for all practical purposes, so there's been no need to change it. @@ -684,9 +693,9 @@ -

              +

              + What's an uglygep? +

              Some LLVM optimizers operate on GEPs by internally lowering them into more primitive integer expressions, which allows them to be combined @@ -705,7 +714,7 @@

              - +

              Summary

              Modified: llvm/trunk/docs/GettingStarted.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/GettingStarted.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/GettingStarted.html (original) +++ llvm/trunk/docs/GettingStarted.html Mon Apr 18 18:59:50 2011 @@ -8,9 +8,9 @@ -
              +

              Getting Started with the LLVM System -

              +
          @@ -37,9 +37,9 @@
          - +
          @@ -76,9 +76,9 @@
          - +
          @@ -112,9 +112,9 @@
          - +
          @@ -137,9 +137,9 @@
          - +
          @@ -171,9 +171,9 @@
          - +
          @@ -208,9 +208,9 @@
          - +
          @@ -241,9 +241,9 @@
          - +
          Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          LLVM Language Reference Manual
          +

          LLVM Language Reference Manual

          1. Abstract
          2. Introduction
          3. @@ -321,7 +321,7 @@
          - +

          Abstract

          @@ -335,7 +335,7 @@
          - +

          Introduction

          @@ -362,7 +362,9 @@
          - +

          + Well-Formedness +

          @@ -387,7 +389,7 @@ - +

          Identifiers

          @@ -475,12 +477,13 @@
          - +

          High Level Structure

          - +

          + Module Structure +

          @@ -528,9 +531,9 @@
          - +
          @@ -677,9 +680,9 @@
          - +
          @@ -750,9 +753,9 @@
          - +
          @@ -784,9 +787,9 @@
          - +
          @@ -815,9 +818,9 @@
          - +
          @@ -883,9 +886,9 @@ - +
          @@ -946,9 +949,9 @@
          -
          +

          Aliases -

          +
          @@ -965,9 +968,9 @@
          - +
          @@ -988,7 +991,9 @@
          - +

          + Parameter Attributes +

          @@ -1097,9 +1102,9 @@
          - +
          @@ -1117,9 +1122,9 @@
          - +
          @@ -1240,9 +1245,9 @@
          - +
          @@ -1266,9 +1271,9 @@
          - +
          @@ -1378,9 +1383,9 @@
          - +
          @@ -1442,9 +1447,9 @@
          - +
          @@ -1460,7 +1465,7 @@
          - +

          Type System

          @@ -1476,8 +1481,9 @@
          - +

          + Type Classifications +

          @@ -1536,7 +1542,9 @@
          - +

          + Primitive Types +

          @@ -1546,7 +1554,9 @@
          - +

          + Integer Type +

          @@ -1582,7 +1592,9 @@
          - +

          + Floating Point Types +

          @@ -1600,7 +1612,9 @@
          - +

          + X86mmx Type +

          @@ -1615,7 +1629,9 @@
          - +

          + Void Type +

          @@ -1630,7 +1646,9 @@
          - +

          + Label Type +

          @@ -1645,7 +1663,9 @@
          - +

          + Metadata Type +

          @@ -1663,7 +1683,9 @@ - +

          + Derived Types +

          @@ -1678,7 +1700,9 @@
          - +

          + Aggregate Types +

          @@ -1690,7 +1714,9 @@
          - +

          + Array Type +

          @@ -1748,7 +1774,9 @@
          - +

          + Function Type +

          @@ -1801,7 +1829,9 @@
          - +

          + Structure Type +

          @@ -1839,8 +1869,9 @@
          - +

          + Packed Structure Type +

          @@ -1877,7 +1908,9 @@
          - +

          + Pointer Type +

          @@ -1921,7 +1954,9 @@
          - +

          + Vector Type +

          @@ -1960,7 +1995,10 @@
          - +

          + Opaque Type +

          +
          Overview:
          @@ -1985,9 +2023,9 @@
          - +
          @@ -2033,7 +2071,7 @@
          - +

          Constants

          @@ -2044,7 +2082,9 @@
          - +

          + Simple Constants +

          @@ -2099,10 +2139,10 @@
          - +
          @@ -2154,9 +2194,9 @@
          - +
          @@ -2176,7 +2216,10 @@
          - +

          + Undefined Values +

          +

          The string 'undef' can be used anywhere a constant is expected, and @@ -2316,7 +2359,10 @@

          - +

          + Trap Values +

          +

          Trap values are similar to undef values, however @@ -2441,8 +2487,10 @@

          - +

          + Addresses of Basic Blocks +

          +

          blockaddress(@function, %block)

          @@ -2468,8 +2516,9 @@ - +

          + Constant Expressions +

          @@ -2598,13 +2647,13 @@
          - +

          Other Values

          - +
          @@ -2657,9 +2706,9 @@ another document that covers inline asm from a holistic perspective.

          - +
          @@ -2683,9 +2732,9 @@
          - +

          + Metadata Nodes and Metadata Strings +

          @@ -2731,9 +2780,9 @@ - +

          LLVM has a number of "magic" global variables that contain data that affect @@ -2743,9 +2792,9 @@ by LLVM.

          - +
          @@ -2778,9 +2827,11 @@
          - +

          + + The 'llvm.compiler.used' Global Variable + +

          @@ -2796,9 +2847,9 @@
          - +
          @@ -2811,9 +2862,9 @@
           
          - +
          @@ -2828,7 +2879,7 @@
           
           
           
          -
          +

          Instruction Reference

          @@ -2843,8 +2894,9 @@
          - +

          + Terminator Instructions +

          @@ -2867,8 +2919,9 @@
          - +

          + 'ret' Instruction +

          @@ -2916,7 +2969,9 @@
          - +

          + 'br' Instruction +

          @@ -2957,9 +3012,9 @@
          - +
          @@ -3012,9 +3067,9 @@ - +
          @@ -3060,9 +3115,9 @@ - +
          @@ -3150,8 +3205,9 @@ - +

          + 'unwind' Instruction +

          @@ -3181,8 +3237,9 @@ - +

          + 'unreachable' Instruction +

          @@ -3203,7 +3260,9 @@
          - +

          + Binary Operations +

          @@ -3218,9 +3277,9 @@
          - +
          @@ -3263,9 +3322,9 @@
          - +
          @@ -3293,9 +3352,9 @@
          - +
          @@ -3345,9 +3404,9 @@
          - +
          @@ -3381,9 +3440,9 @@
          - +
          @@ -3431,9 +3490,9 @@
          - +
          @@ -3461,8 +3520,9 @@
          - +

          + 'udiv' Instruction +

          @@ -3501,8 +3561,9 @@
          - +

          + 'sdiv' Instruction +

          @@ -3543,8 +3604,9 @@
          - +

          + 'fdiv' Instruction +

          @@ -3572,8 +3634,9 @@
          - +

          + 'urem' Instruction +

          @@ -3609,9 +3672,9 @@
          - +
          @@ -3660,8 +3723,9 @@
          - +

          + 'frem' Instruction +

          @@ -3691,8 +3755,9 @@
          - +

          + Bitwise Binary Operations +

          @@ -3705,8 +3770,9 @@
          - +

          + 'shl' Instruction +

          @@ -3755,8 +3821,9 @@
          - +

          + 'lshr' Instruction +

          @@ -3801,8 +3868,10 @@
          - +

          + 'ashr' Instruction +

          +
          Syntax:
          @@ -3846,8 +3915,9 @@
          - +

          + 'and' Instruction +

          @@ -3906,7 +3976,9 @@
          - +

          + 'or' Instruction +

          @@ -3967,8 +4039,9 @@
          - +

          + 'xor' Instruction +

          @@ -4031,9 +4104,9 @@
          - +
          @@ -4047,9 +4120,9 @@
          - +
          @@ -4083,9 +4156,9 @@
          - +
          @@ -4119,9 +4192,9 @@
          - +
          @@ -4167,9 +4240,9 @@
          - +
          @@ -4179,9 +4252,9 @@
          - +
          @@ -4221,9 +4294,9 @@
          - +
          @@ -4261,9 +4334,9 @@ - +
          @@ -4275,9 +4348,9 @@
          - +
          @@ -4326,8 +4399,9 @@
          - +

          + 'load' Instruction +

          @@ -4384,8 +4458,9 @@
          - +

          + 'store' Instruction +

          @@ -4445,9 +4520,9 @@
          - +
          @@ -4576,8 +4651,9 @@
          - +

          + Conversion Operations +

          @@ -4588,9 +4664,10 @@
          - + +
          Syntax:
          @@ -4627,9 +4704,10 @@
          - + +
          Syntax:
          @@ -4666,9 +4744,10 @@
          - + +
          Syntax:
          @@ -4704,9 +4783,9 @@
          - +
          @@ -4742,9 +4821,10 @@
          - + +
          Syntax:
          @@ -4778,9 +4858,10 @@
          - + +
          Syntax:
          @@ -4815,9 +4896,10 @@
          - + +
          Syntax:
          @@ -4853,9 +4935,10 @@
          - + +
          Syntax:
          @@ -4889,9 +4972,10 @@
          - + +
          Syntax:
          @@ -4924,9 +5008,10 @@
          - + +
          Syntax:
          @@ -4961,9 +5046,10 @@
          - + +
          Syntax:
          @@ -4998,9 +5084,10 @@
          - + +
          Syntax:
          @@ -5041,7 +5128,9 @@
          - +

          + Other Operations +

          @@ -5051,8 +5140,9 @@
          - +

          + 'icmp' Instruction +

          @@ -5153,8 +5243,9 @@
          - +

          + 'fcmp' Instruction +

          @@ -5273,9 +5364,9 @@
          - +
          @@ -5321,9 +5412,9 @@
          - +
          @@ -5364,9 +5455,9 @@
          - +
          @@ -5473,9 +5564,9 @@
          - +
          @@ -5519,7 +5610,7 @@
          - +

          Intrinsic Functions

          @@ -5568,9 +5659,9 @@
          - +
          @@ -5617,9 +5708,9 @@
          - +
          @@ -5648,9 +5739,9 @@
          - +
          @@ -5679,9 +5770,9 @@
          - +
          @@ -5710,9 +5801,9 @@
          - +
          @@ -5732,9 +5823,9 @@
          - +
          @@ -5763,9 +5854,9 @@
          - +
          @@ -5795,9 +5886,9 @@
          - +
          @@ -5827,9 +5918,9 @@
          - +
          @@ -5839,9 +5930,9 @@
          - +
          @@ -5874,9 +5965,9 @@
          - +
          @@ -5908,9 +5999,9 @@
          - +
          @@ -5938,9 +6029,9 @@
          - +
          @@ -5963,9 +6054,9 @@
          - +
          @@ -5996,9 +6087,9 @@
          - +
          @@ -6027,9 +6118,9 @@
          - +
          @@ -6054,9 +6145,9 @@
          - +
          @@ -6068,9 +6159,9 @@
          - +
          @@ -6122,9 +6213,9 @@
          - +
          @@ -6178,9 +6269,9 @@
          - +
          @@ -6228,9 +6319,9 @@
          - +
          @@ -6266,9 +6357,9 @@
          - +
          @@ -6302,9 +6393,9 @@
          - +
          @@ -6336,9 +6427,9 @@
          - +
          @@ -6370,9 +6461,9 @@
          - +
          @@ -6405,9 +6496,9 @@
          - +
          @@ -6417,9 +6508,9 @@
          - +
          @@ -6452,9 +6543,9 @@
          - +
          @@ -6484,9 +6575,9 @@
          - +
          @@ -6518,9 +6609,9 @@
          - +
          @@ -6552,9 +6643,9 @@
          - +
          @@ -6563,9 +6654,11 @@
          - +

          + + 'llvm.sadd.with.overflow.*' Intrinsics + +

          @@ -6609,9 +6702,11 @@
          - +

          + + 'llvm.uadd.with.overflow.*' Intrinsics + +

          @@ -6654,9 +6749,11 @@
          - +

          + + 'llvm.ssub.with.overflow.*' Intrinsics + +

          @@ -6700,9 +6797,11 @@
          - +

          + + 'llvm.usub.with.overflow.*' Intrinsics + +

          @@ -6746,9 +6845,11 @@
          - +

          + + 'llvm.smul.with.overflow.*' Intrinsics + +

          @@ -6793,9 +6894,11 @@
          - +

          + + 'llvm.umul.with.overflow.*' Intrinsics + +

          @@ -6839,9 +6942,9 @@
          - +
          @@ -6860,9 +6963,11 @@
          - +

          + + 'llvm.convert.to.fp16' Intrinsic + +

          @@ -6895,9 +7000,11 @@
          - +

          + + 'llvm.convert.from.fp16' Intrinsic + +

          @@ -6930,9 +7037,9 @@
          - +
          @@ -6944,9 +7051,9 @@
          - +
          @@ -6958,9 +7065,9 @@
          - +
          @@ -6991,9 +7098,11 @@
          - +

          + + 'llvm.init.trampoline' Intrinsic + +

          @@ -7033,9 +7142,9 @@
          - +
          @@ -7060,9 +7169,10 @@
          - + +
          Syntax:
          @@ -7131,9 +7241,9 @@
           
          - +
          @@ -7191,9 +7301,10 @@
          - + +
          Syntax:
          @@ -7247,10 +7358,9 @@
          - +
          @@ -7297,10 +7407,9 @@
          - +
          @@ -7349,12 +7458,23 @@
          - +

          + + 'llvm.atomic.load.and.*' Intrinsic + +
          + + 'llvm.atomic.load.nand.*' Intrinsic + +
          + + 'llvm.atomic.load.or.*' Intrinsic + +
          + + 'llvm.atomic.load.xor.*' Intrinsic + +

          @@ -7429,12 +7549,23 @@
          - +

          + + 'llvm.atomic.load.max.*' Intrinsic + +
          + + 'llvm.atomic.load.min.*' Intrinsic + +
          + + 'llvm.atomic.load.umax.*' Intrinsic + +
          + + 'llvm.atomic.load.umin.*' Intrinsic + +

          @@ -7509,9 +7640,9 @@ - +
          @@ -7521,9 +7652,9 @@
          - +
          @@ -7551,9 +7682,9 @@
          - +
          @@ -7580,9 +7711,9 @@
          - +
          @@ -7608,9 +7739,9 @@
          - +
          @@ -7635,9 +7766,9 @@
          - +
          @@ -7647,9 +7778,9 @@
          - +
          @@ -7675,9 +7806,9 @@
          - +
          @@ -7711,9 +7842,9 @@
          - +
          @@ -7736,9 +7867,9 @@
          - +
          @@ -7770,9 +7901,9 @@
          - +
          Modified: llvm/trunk/docs/Lexicon.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Lexicon.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/Lexicon.html (original) +++ llvm/trunk/docs/Lexicon.html Mon Apr 18 18:59:50 2011 @@ -9,10 +9,10 @@ content="A glossary of terms used with the LLVM project."> -
          The LLVM Lexicon
          +

          The LLVM Lexicon

          NOTE: This document is a work in progress!

          -
          Table Of Contents
          +

          Table Of Contents

          @@ -83,10 +83,10 @@ -
          Definitions
          +

          Definitions

          - +

          - A -

          ADCE
          @@ -94,7 +94,7 @@
          - +

          - B -

          BURS
          @@ -104,7 +104,7 @@
          - +

          - C -

          CSE
          @@ -116,7 +116,7 @@
          - +

          - D -

          DAG
          @@ -136,7 +136,7 @@
          - +

          - G -

          GC
          @@ -145,7 +145,7 @@
          - +

          - H -

          Heap
          @@ -154,7 +154,7 @@
          - +

          - I -

          IPA
          @@ -169,7 +169,7 @@
          - +

          - L -

          LCSSA
          @@ -183,7 +183,7 @@
          - +

          - M -

          MC
          @@ -191,7 +191,7 @@
          - +

          - O -

          Object Pointer
          @@ -202,7 +202,7 @@
          - +

          - P -

          PRE
          @@ -211,7 +211,7 @@
          - +

          - R -

          RAUW
          An abbreviation for Replace @@ -234,7 +234,7 @@
          - +

          - S -

          Safe Point
          Modified: llvm/trunk/docs/LinkTimeOptimization.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LinkTimeOptimization.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/LinkTimeOptimization.html (original) +++ llvm/trunk/docs/LinkTimeOptimization.html Mon Apr 18 18:59:50 2011 @@ -6,9 +6,9 @@ -
          +

          LLVM Link Time Optimization: Design and Implementation -

          +
          - +
          @@ -50,9 +50,9 @@
          - +
          @@ -72,9 +72,9 @@
          - +

          The following example illustrates the advantages of LTO's integrated @@ -145,9 +145,9 @@

          - +
          @@ -176,9 +176,9 @@
          - +

          The linker collects information about symbol defininitions and uses in @@ -195,9 +195,9 @@

          - +

          The linker first reads all object files in natural order and collects @@ -219,9 +219,9 @@

          - +

          In this stage, the linker resolves symbols using global symbol table. @@ -233,9 +233,9 @@

          - +

          After symbol resolution, the linker tells the LTO shared object which symbols are needed by native object files. In the example above, the linker @@ -248,9 +248,9 @@

          - +

          In this phase, the linker reads optimized a native object file and @@ -265,9 +265,9 @@

          -
          +

          libLTO -

          +

          libLTO is a shared object that is part of the LLVM tools, and @@ -281,9 +281,9 @@

          - +
          @@ -325,9 +325,9 @@
          - +
          Modified: llvm/trunk/docs/MakefileGuide.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/MakefileGuide.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/MakefileGuide.html (original) +++ llvm/trunk/docs/MakefileGuide.html Mon Apr 18 18:59:50 2011 @@ -7,7 +7,7 @@ -
          LLVM Makefile Guide
          +

          LLVM Makefile Guide

          1. Introduction
          2. @@ -77,7 +77,7 @@
          - +

          Introduction

          @@ -99,7 +99,7 @@
          - +

          General Concepts

          @@ -111,7 +111,7 @@
          - +

          Projects

          The LLVM Makefile System is quite generous. It not only builds its own software, but it can build yours too. Built into the system is knowledge of @@ -129,7 +129,7 @@

          - +

          Variable Values

          To use the makefile system, you simply create a file named Makefile in your directory and declare values for certain variables. @@ -139,7 +139,7 @@

          - +

          Including Makefiles

          Setting variables alone is not enough. You must include into your Makefile additional files that provide the rules of the LLVM Makefile system. The @@ -147,7 +147,7 @@

          - +

          Makefile

          Each directory to participate in the build needs to have a file named Makefile. This is the file first read by make. It has three @@ -163,8 +163,7 @@

          - +

          Makefile.common

          Every project must have a Makefile.common file at its top source directory. This file serves three purposes:

          @@ -182,8 +181,7 @@
          - +

          Makefile.config

          Every project must have a Makefile.config at the top of its build directory. This file is generated by the @@ -196,7 +194,7 @@

          - +

          Makefile.rules

          This file, located at $(LLVM_SRC_ROOT)/Makefile.rules is the heart of the LLVM Makefile System. It provides all the logic, dependencies, and @@ -206,7 +204,7 @@

          - +

          Comments

          User Makefiles need not have comments in them unless the construction is unusual or it does not strictly follow the rules and patterns of the LLVM @@ -216,7 +214,7 @@

          - +

          Tutorial

          This section provides some examples of the different kinds of modules you @@ -226,7 +224,7 @@

          - +

          Libraries

          Only a few variable definitions are needed to build a regular library. Normally, the makefile system will build all the software into a single @@ -259,7 +257,7 @@

          - +

          Bitcode Modules

          In some situations, it is desirable to build a single bitcode module from a variety of sources, instead of an archive, shared library, or bitcode @@ -280,9 +278,9 @@

          - +

          In some situations, you need to create a loadable module. Loadable modules can be loaded into programs like opt or llc to specify @@ -312,7 +310,7 @@

          - +

          Tools

          For building executable programs (tools), you must provide the name of the tool and the names of the libraries you wish to link with the tool. For @@ -347,7 +345,7 @@

          - +

          JIT Tools

          Many tools will want to use the JIT features of LLVM. To do this, you simply specify that you want an execution 'engine', and the makefiles will @@ -368,7 +366,7 @@

          - +

          Targets Supported

          @@ -429,7 +427,7 @@
          - +

          all (default)

          When you invoke make with no arguments, you are implicitly instructing it to seek the "all" target (goal). This target is used for @@ -440,14 +438,14 @@

          - +

          all-local

          This target is the same as all but it operates only on the current directory instead of recursively.

          - +

          check

          This target can be invoked from anywhere within a project's directories but always invokes the check-local target @@ -464,7 +462,7 @@

          - +

          check-local

          This target should be implemented by the Makefile in the project's test directory. It is invoked by the check target elsewhere. @@ -475,7 +473,7 @@

          - +

          clean

          This target cleans the build directory, recursively removing all things that the Makefile builds. The cleaning rules have been made guarded so they @@ -484,14 +482,14 @@

          - +

          clean-local

          This target does the same thing as clean but only for the current (local) directory.

          - +

          dist

          This target builds a distribution tarball. It first builds the entire project using the all target and then tars up the necessary files and @@ -500,7 +498,7 @@

          - +

          dist-check

          This target does the same thing as the dist target but also checks the distribution tarball. The check is made by unpacking the tarball to a new @@ -512,7 +510,7 @@

          - +

          dist-clean

          This is a special form of the clean clean target. It performs a normal clean but also removes things pertaining to building the @@ -520,7 +518,7 @@

          - +

          install

          This target finalizes shared objects and executables and copies all libraries, headers, executables and documentation to the directory given @@ -538,7 +536,7 @@

          - +

          preconditions

          This utility target checks to see if the Makefile in the object directory is older than the Makefile in the source directory and @@ -549,14 +547,14 @@

          - +

          printvars

          This utility target just causes the LLVM makefiles to print out some of the makefile variables so that you can double check how things are set.

          - +

          reconfigure

          This utility target will force a reconfigure of LLVM or your project. It simply runs $(PROJ_OBJ_ROOT)/config.status --recheck to rerun the @@ -566,7 +564,7 @@

          - +

          spotless

          This utility target, only available when $(PROJ_OBJ_ROOT) is not the same as $(PROJ_SRC_ROOT), will completely clean the @@ -578,7 +576,7 @@

          - +

          tags

          This target will generate a TAGS file in the top-level source directory. It is meant for use with emacs, XEmacs, or ViM. The TAGS file @@ -587,7 +585,7 @@

          - +

          uninstall

          This target is the opposite of the install target. It removes the header, library and executable files from the installation directories. Note @@ -596,7 +594,7 @@

          - +

          Variables

          Variables are used to tell the LLVM Makefile System what to do and to @@ -609,7 +607,7 @@

          - +

          Control Variables

          Variables listed in the table below should be set before the inclusion of $(LEVEL)/Makefile.common. @@ -762,7 +760,7 @@

          - +

          Override Variables

          Override variables can be used to override the default values provided by the LLVM makefile system. These variables can be set in @@ -868,7 +866,7 @@

          - +

          Readable Variables

          Variables listed in the table below can be used by the user's Makefile but should not be changed. Changing the value will generally cause the build to go @@ -939,7 +937,7 @@

          - +

          Internal Variables

          Variables listed below are used by the LLVM Makefile System and considered internal. You should not use these variables under any Modified: llvm/trunk/docs/Packaging.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Packaging.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/Packaging.html (original) +++ llvm/trunk/docs/Packaging.html Mon Apr 18 18:59:50 2011 @@ -7,7 +7,7 @@ -

          Advice on Packaging LLVM
          +

          Advice on Packaging LLVM

          1. Overview
          2. Compile Flags
          3. @@ -17,7 +17,7 @@
          - +

          Overview

          @@ -34,7 +34,7 @@
          - +

          Compile Flags

          @@ -65,7 +65,7 @@
          - +

          C++ Features

          @@ -78,7 +78,7 @@
          - +

          Shared Library

          @@ -89,7 +89,7 @@
          - +

          Dependencies

          Modified: llvm/trunk/docs/Passes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Passes.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/Passes.html (original) +++ llvm/trunk/docs/Passes.html Mon Apr 18 18:59:50 2011 @@ -1,4 +1,4 @@ - @@ -40,7 +40,7 @@ --> -
          LLVM's Analysis and Transform Passes
          +

          LLVM's Analysis and Transform Passes

          1. Introduction
          2. @@ -55,7 +55,7 @@
          - +

          Introduction

          This document serves as a high level summary of the optimization features that LLVM provides. Optimizations are implemented as Passes that traverse some @@ -204,15 +204,15 @@

          - +

          Analysis Passes

          This section describes the LLVM Analysis Passes.

          - +

          This is a simple N^2 alias analysis accuracy evaluator. Basically, for each function in the program, it simply queries to see how the @@ -224,9 +224,9 @@

          - +

          This is the default implementation of the Alias Analysis interface @@ -236,17 +236,17 @@

          - +

          Yet to be written.

          - +

          A pass which can be used to count how many alias queries @@ -255,9 +255,9 @@

          - +

          This simple pass checks alias analysis users to ensure that if they @@ -272,9 +272,9 @@

          - +

          This pass is a simple dominator construction algorithm for finding forward @@ -283,9 +283,9 @@

          - +

          This pass is a simple dominator construction algorithm for finding forward @@ -294,9 +294,9 @@

          - +

          This pass, only available in opt, prints the call graph into a @@ -306,9 +306,9 @@

          - +

          This pass, only available in opt, prints the control flow graph @@ -318,9 +318,9 @@

          - +

          This pass, only available in opt, prints the control flow graph @@ -331,9 +331,9 @@

          - +

          This pass, only available in opt, prints the dominator tree @@ -343,9 +343,9 @@

          - +

          This pass, only available in opt, prints the dominator tree @@ -356,9 +356,9 @@

          - +

          This pass, only available in opt, prints the post dominator tree @@ -368,9 +368,9 @@

          - +

          This pass, only available in opt, prints the post dominator tree @@ -381,9 +381,9 @@

          - +

          This simple pass provides alias and mod/ref information for global values @@ -394,9 +394,9 @@

          - +

          This pass collects the count of all instructions and reports them @@ -404,9 +404,9 @@

          - +

          This analysis calculates and represents the interval partition of a function, @@ -420,43 +420,43 @@

          - +

          Bookkeeping for "interesting" users of expressions computed from induction variables.

          - +

          Interface for lazy computation of value constraint information.

          - +

          Loop dependence analysis framework, which is used to detect dependences in memory accesses in loops.

          - +

          LibCall Alias Analysis.

          - +

          This pass statically checks for common and easily-identified constructs which produce undefined or likely unintended behavior in LLVM IR.

          @@ -485,9 +485,9 @@
          - +

          This analysis is used to identify natural loops and determine the loop depth @@ -498,9 +498,9 @@

          - +

          An analysis that determines, for a given memory operation, what preceding @@ -511,9 +511,9 @@

          - +

          This pass decodes the debug info metadata in a module and prints in a (sufficiently-prepared-) human-readable form. @@ -524,9 +524,9 @@

          - +

          Always returns "I don't know" for alias queries. NoAA is unlike other alias @@ -536,9 +536,9 @@

          - +

          The default "no profile" implementation of the abstract @@ -547,9 +547,9 @@

          - +

          This pass is a simple post-dominator construction algorithm for finding @@ -558,9 +558,9 @@

          - +

          This pass is a simple post-dominator construction algorithm for finding @@ -569,17 +569,17 @@

          - +

          Yet to be written.

          - +

          This pass, only available in opt, prints the call graph to @@ -588,9 +588,9 @@

          - +

          This pass, only available in opt, prints the SCCs of the call @@ -599,9 +599,9 @@

          - +

          This pass, only available in opt, prints the SCCs of each @@ -610,9 +610,9 @@

          - +

          Pass that prints instructions, and associated debug info:

            @@ -624,17 +624,17 @@
          - +

          Dominator Info Printer.

          - +

          This pass, only available in opt, prints out call sites to @@ -645,9 +645,9 @@

          - +

          The PrintFunctionPass class is designed to be pipelined with @@ -657,9 +657,9 @@

          - +

          This pass simply prints out the entire module when it is executed. @@ -667,9 +667,9 @@

          - +

          This pass is used to seek out all of the types in use by the program. Note @@ -678,9 +678,9 @@

          - +

          Profiling information that estimates the profiling information in a very crude and unimaginative way. @@ -688,9 +688,9 @@

          - +

          A concrete implementation of profiling information that loads the information @@ -699,15 +699,15 @@

          - +

          Pass that checks profiling information for plausibility.

          - +

          The RegionInfo pass detects single entry single exit regions in a @@ -718,9 +718,9 @@

          - +

          The ScalarEvolution analysis can be used to analyze and @@ -737,9 +737,9 @@

          - +

          Simple alias analysis implemented in terms of ScalarEvolution queries. @@ -753,24 +753,24 @@

          - +

          Provides other passes access to information on how the size and alignment required by the the target ABI for various data types.

          - +

          Transform Passes

          This section describes the LLVM Transform Passes.

          - +

          ADCE aggressively tries to eliminate code. This pass is similar to DCE but it assumes that values are dead until proven @@ -779,18 +779,18 @@

          - +

          A custom inliner that handles only functions that are marked as "always inline".

          - +

          This pass promotes "by reference" arguments to be "by value" arguments. In @@ -819,9 +819,9 @@

          - +

          This pass is a very simple profile guided basic block placement algorithm. The idea is to put frequently executed blocks together at the start of the @@ -831,9 +831,9 @@

          - +

          Break all of the critical edges in the CFG by inserting a dummy basic block. @@ -844,9 +844,9 @@

          - +
          This pass munges the code in the input function to better prepare it for SelectionDAG-based code generation. This works around limitations in it's @@ -854,9 +854,9 @@
          - +

          Merges duplicate global constants together into a single constant that is @@ -867,9 +867,9 @@

          - +

          This file implements constant propagation and merging. It looks for instructions involving only constant operands and replaces them with a @@ -883,9 +883,9 @@

          - +

          Dead code elimination is similar to dead instruction @@ -895,9 +895,9 @@

          - +

          This pass deletes dead arguments from internal functions. Dead argument @@ -913,9 +913,9 @@

          - +

          This pass is used to cleanup the output of GCC. It eliminate names for types @@ -925,9 +925,9 @@

          - +

          Dead instruction elimination performs a single pass over the function, @@ -936,9 +936,9 @@

          - +

          A trivial dead store elimination that only considers basic-block local @@ -947,9 +947,9 @@

          - +

          A simple interprocedural pass which walks the call-graph, looking for functions which do not access or only read non-local memory, and marking them @@ -962,9 +962,9 @@

          - +

          This transform is designed to eliminate unreachable internal globals from the @@ -976,9 +976,9 @@

          - +

          This pass transforms simple global variables that never have their address @@ -988,9 +988,9 @@

          - +

          This pass performs global value numbering to eliminate fully and partially @@ -999,9 +999,9 @@

          - +

          This transformation analyzes and transforms the induction variables (and @@ -1050,9 +1050,9 @@

          - +

          Bottom-up inlining of functions into callees. @@ -1060,9 +1060,9 @@

          - +

          This pass instruments the specified program with counters for edge profiling. @@ -1078,9 +1078,9 @@

          - +

          This pass instruments the specified program with counters for edge profiling. Edge profiling can give a reasonable approximation of the hot paths through a @@ -1089,9 +1089,9 @@

          - +

          Combine instructions to form fewer, simple @@ -1143,9 +1143,9 @@

          - +

          This pass loops over all of the functions in the input module, looking for a @@ -1155,9 +1155,9 @@

          - +

          This pass implements an extremely simple interprocedural constant @@ -1169,9 +1169,9 @@

          - + - +

          Jump threading tries to find distinct threads of control flow running through @@ -1209,9 +1209,9 @@

          - +

          This pass transforms loops by placing phi nodes at the end of the loops for @@ -1238,9 +1238,9 @@

          - +

          This pass performs loop invariant code motion, attempting to remove as much @@ -1275,9 +1275,9 @@

          - +

          This file implements the Dead Loop Deletion Pass. This pass is responsible @@ -1288,9 +1288,9 @@

          - +

          A pass wrapper around the ExtractLoop() scalar transformation to @@ -1301,9 +1301,9 @@

          - +

          Similar to Extract loops into new functions, @@ -1313,9 +1313,9 @@

          - +

          This pass performs a strength reduction on array references inside loops that @@ -1327,17 +1327,17 @@

          - +

          A simple loop rotation transformation.

          - +

          This pass performs several transformations to transform natural loops into a @@ -1376,9 +1376,9 @@

          - +

          This pass implements a simple loop unroller. It works best when loops have @@ -1388,9 +1388,9 @@

          - +

          This pass transforms loops that contain branches on loop-invariant conditions @@ -1418,9 +1418,9 @@

          - +

          This pass lowers atomic intrinsics to non-atomic form for use in a known @@ -1436,9 +1436,9 @@

          - +

          This transformation is designed for use by code generators which do not yet @@ -1477,9 +1477,9 @@

          - +

          Lowers setjmp and longjmp to use the LLVM invoke and unwind @@ -1506,9 +1506,9 @@

          - +

          Rewrites switch instructions with a sequence of branches, which @@ -1518,9 +1518,9 @@

          - +

          This file promotes memory references to be register references. It promotes @@ -1534,9 +1534,9 @@

          - +

          This pass performs various transformations related to eliminating memcpy @@ -1545,9 +1545,9 @@

          - +

          This pass looks for equivalent functions that are mergable and folds them. @@ -1566,9 +1566,9 @@

          - +

          Ensure that functions have at most one ret instruction in them. @@ -1577,9 +1577,9 @@

          - +

          This pass performs partial inlining, typically by inlining an if statement that surrounds the body of the function. @@ -1587,9 +1587,9 @@

          - +

          This file implements a simple interprocedural pass which walks the call-graph, @@ -1600,9 +1600,9 @@

          - +

          This pass reassociates commutative expressions in an order that is designed @@ -1623,9 +1623,9 @@

          - +

          This file demotes all registers to memory references. It is intented to be @@ -1640,9 +1640,9 @@

          - +

          The well-known scalar replacement of aggregates transformation. This @@ -1662,9 +1662,9 @@

          - +

          Sparse conditional constant propagation and merging, which can be summarized @@ -1685,9 +1685,9 @@

          - +

          Applies a variety of small optimizations for calls to specific well-known @@ -1698,9 +1698,9 @@

          - +

          Performs dead code elimination and basic block merging. Specifically: @@ -1717,9 +1717,9 @@

          - +

          This pass moves instructions into successor blocks, when possible, so that they aren't executed on paths where their results aren't needed. @@ -1727,9 +1727,9 @@

          - +

          This pass finds functions that return a struct (using a pointer to the struct @@ -1750,9 +1750,9 @@

          - +

          performs code stripping. this transformation can delete: @@ -1772,9 +1772,9 @@

          - +

          performs code stripping. this transformation can delete: @@ -1794,9 +1794,9 @@

          - +

          This pass loops over all of the functions in the input module, looking for @@ -1807,9 +1807,9 @@

          - +

          This pass implements code stripping. Specifically, it can delete:

            @@ -1825,9 +1825,9 @@
          - +

          This pass implements code stripping. Specifically, it can delete:

            @@ -1843,9 +1843,9 @@
          - +

          This file transforms calls of the current function (self recursion) followed @@ -1875,9 +1875,9 @@

          - +

          This pass performs a limited form of tail duplication, intended to simplify @@ -1889,15 +1889,15 @@

          - +

          Utility Passes

          This section describes the LLVM Utility Passes.

          - +

          Same as dead argument elimination, but deletes arguments to functions which @@ -1906,9 +1906,9 @@

          - +

          This pass is used by bugpoint to extract all blocks from the module into their @@ -1916,9 +1916,9 @@

          - +

          This is a little utility pass that gives instructions names, this is mostly useful when diffing the effect of an optimization because deleting an @@ -1928,9 +1928,9 @@

          - +

          Ensures that the module is in the form required by the -

          +

          Verifies an LLVM IR code. This is useful to run after an optimization which is @@ -1995,9 +1995,9 @@

          - +

          Displays the control flow graph using the GraphViz tool. @@ -2005,9 +2005,9 @@

          - +

          Displays the control flow graph using the GraphViz tool, but omitting function @@ -2016,9 +2016,9 @@

          - +

          Displays the dominator tree using the GraphViz tool. @@ -2026,9 +2026,9 @@

          - +

          Displays the dominator tree using the GraphViz tool, but omitting function @@ -2037,9 +2037,9 @@

          - +

          Displays the post dominator tree using the GraphViz tool. @@ -2047,9 +2047,9 @@

          - +

          Displays the post dominator tree using the GraphViz tool, but omitting Modified: llvm/trunk/docs/ProgrammersManual.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/ProgrammersManual.html (original) +++ llvm/trunk/docs/ProgrammersManual.html Mon Apr 18 18:59:50 2011 @@ -8,9 +8,9 @@ -

          +

          LLVM Programmer's Manual -

          +
          1. Introduction
          2. @@ -210,9 +210,9 @@
          - +
          @@ -242,9 +242,9 @@
          - +
          @@ -255,9 +255,9 @@
          - +
          @@ -305,9 +305,9 @@
          - +
          @@ -319,9 +319,9 @@
          - +
          @@ -332,10 +332,10 @@
          - +
          @@ -442,10 +442,10 @@ - +
          @@ -464,9 +464,9 @@
          - +
          @@ -504,9 +504,9 @@
          - +
          @@ -541,9 +541,9 @@ - +
          @@ -594,10 +594,10 @@
          - +
          @@ -668,10 +668,10 @@
          - +
          @@ -768,9 +768,9 @@
          - +
          @@ -817,9 +817,9 @@
          - +
          @@ -881,9 +881,9 @@
          - +
          There are a variety of sequential containers available for you, based on your @@ -891,9 +891,9 @@
          - +

          The llvm::ArrayRef class is the preferred class to use in an interface that @@ -906,9 +906,9 @@ -

          +

          Fixed size arrays are very simple and very fast. They are good if you know @@ -917,9 +917,9 @@

          - +

          Heap allocated arrays (new[] + delete[]) are also simple. They are good if @@ -933,9 +933,9 @@

          - +

          SmallVector<Type, N> is a simple class that looks and smells @@ -962,9 +962,9 @@

          - +

          @@ -1004,9 +1004,9 @@

          -
          +

          <deque> -

          +

          std::deque is, in some senses, a generalized version of std::vector. Like @@ -1020,9 +1020,9 @@

          -
          +

          <list> -

          +

          std::list is an extremely inefficient class that is rarely useful. @@ -1038,9 +1038,9 @@

          - +

          ilist<T> implements an 'intrusive' doubly-linked list. It is @@ -1068,9 +1068,9 @@

          - +

          ilist_traits<T> is ilist<T>'s customization @@ -1079,9 +1079,9 @@

          -
          +

          iplist -

          +

          iplist<T> is ilist<T>'s base and as such @@ -1093,9 +1093,9 @@

          - +

          ilist_node<T> implements a the forward and backward links @@ -1108,9 +1108,9 @@

          - +

          ilists have another specialty that must be considered. To be a good @@ -1146,9 +1146,9 @@

          - +

          Other STL containers are available, such as std::string.

          @@ -1161,9 +1161,9 @@ - +
          @@ -1175,9 +1175,9 @@ - +
          @@ -1197,9 +1197,9 @@
          - +
          @@ -1220,9 +1220,9 @@
          - +
          @@ -1240,9 +1240,9 @@
          - +
          @@ -1259,9 +1259,9 @@
          - +
          @@ -1296,9 +1296,9 @@
          -
          +

          <set> -

          +
          @@ -1321,9 +1321,9 @@
          - +

          LLVM's SetVector<Type> is an adapter class that combines your choice of @@ -1361,9 +1361,9 @@

          - +
          @@ -1381,9 +1381,9 @@ - +
          @@ -1402,9 +1402,9 @@
          - +
          Map-like containers are useful when you want to associate data to a key. As @@ -1412,9 +1412,9 @@
          - +
          @@ -1429,9 +1429,9 @@
          - +
          @@ -1463,9 +1463,9 @@
          - +

          @@ -1483,9 +1483,9 @@

          - +
          @@ -1509,9 +1509,9 @@
          - +
          @@ -1526,9 +1526,9 @@
          - +
          @@ -1543,9 +1543,9 @@
          -
          +

          <map> -

          +
          @@ -1563,9 +1563,9 @@
          - +
          @@ -1583,9 +1583,9 @@
          - +
          @@ -1602,9 +1602,9 @@
          - +
          @@ -1616,9 +1616,9 @@
          - +

          Unlike the other containers, there are only two bit storage containers, and @@ -1633,9 +1633,9 @@

          - +

          The BitVector container provides a dynamic size set of bits for manipulation. @@ -1648,9 +1648,9 @@

          - +

          The SmallBitVector container provides the same interface as BitVector, but @@ -1667,9 +1667,9 @@

          - +

          The SparseBitVector container is much like BitVector, with one major @@ -1682,9 +1682,9 @@

          - +
          @@ -1700,9 +1700,9 @@ - +
          @@ -1724,11 +1724,11 @@
          - +
          @@ -1759,11 +1759,11 @@
          - +
          @@ -1790,11 +1790,11 @@
          - +
          @@ -1836,10 +1836,10 @@
          - +
          @@ -1913,10 +1913,10 @@
          - +
          @@ -1975,9 +1975,9 @@
          - +
          @@ -2002,9 +2002,9 @@
          - +
          @@ -2063,10 +2063,10 @@
          - +
          @@ -2093,9 +2093,9 @@ - +
          @@ -2108,10 +2108,10 @@
          - +
          @@ -2249,9 +2249,9 @@
          - +
          @@ -2273,10 +2273,10 @@
          - +
          @@ -2339,9 +2339,9 @@
          - +
          @@ -2361,9 +2361,9 @@
          - +
          @@ -2401,9 +2401,9 @@
          - +
          @@ -2432,9 +2432,9 @@
          - +
          @@ -2469,9 +2469,9 @@
          - +

          @@ -2489,9 +2489,9 @@

          - +

          @@ -2518,9 +2518,9 @@

          - +

          @@ -2562,9 +2562,9 @@

          - +

          @@ -2590,9 +2590,9 @@

          - +
          @@ -2604,9 +2604,9 @@
          - +
          @@ -2640,9 +2640,9 @@
          - +
          @@ -2696,9 +2696,9 @@
          - +

          @@ -2726,9 +2726,9 @@

          - +

          @@ -2748,9 +2748,9 @@

          - +
          @@ -2768,10 +2768,10 @@ - +

          The @@ -2804,9 +2804,9 @@ -

          +

          The @@ -2817,9 +2817,11 @@ addition and removal.

          - +

          + + Interaction and relationship between User and Use objects + +

          @@ -2878,9 +2880,9 @@ is stored in each Use object in the member Use::Prev) -

          +

          @@ -2919,9 +2921,9 @@ 1000 Use objects associated with a User.

          - +

          @@ -3009,9 +3011,9 @@ -

          +

          To maintain the invariant that the 2 LSBits of each Use** in Use @@ -3028,9 +3030,9 @@

          - +
          @@ -3045,9 +3047,9 @@
          - +
          @@ -3067,9 +3069,9 @@
          - +
          @@ -3089,9 +3091,9 @@
          - +
          IntegerType
          @@ -3157,9 +3159,9 @@ - +
          @@ -3179,9 +3181,9 @@
          - +
          @@ -3284,9 +3286,9 @@ - +
          @@ -3342,9 +3344,9 @@
          - +
          @@ -3394,9 +3396,9 @@
          - +
          @@ -3420,9 +3422,9 @@
          - +
          @@ -3448,9 +3450,9 @@
          - +
          @@ -3486,10 +3488,11 @@
          - +

          + + Important Subclasses of the Instruction class + +

          - +

          + + Important Public Members of the Instruction class + +

          @@ -3535,9 +3539,9 @@
          - +
          @@ -3550,7 +3554,7 @@
          -
          Important Subclasses of Constant
          +

          Important Subclasses of Constant

          @@ -68,7 +68,7 @@ - +

          Introduction

          @@ -83,9 +83,9 @@
          - +
          @@ -133,9 +133,9 @@
          - +
          @@ -157,9 +157,9 @@
          - +
          @@ -227,9 +227,9 @@
          - +
          @@ -268,9 +268,9 @@
          - +
          @@ -315,9 +315,9 @@
          - +
          @@ -351,9 +351,9 @@
          - +
          @@ -380,9 +380,9 @@
          - +
          @@ -413,9 +413,9 @@
          - +
          @@ -456,9 +456,9 @@
          - +
          @@ -482,9 +482,9 @@
          - +
          @@ -534,9 +534,9 @@
          - +
          @@ -606,9 +606,9 @@
          - +
          @@ -693,9 +693,9 @@
          - +
          @@ -719,9 +719,9 @@
          - +
          @@ -743,9 +743,9 @@
          - +
          @@ -787,9 +787,9 @@
          - +
          @@ -799,9 +799,9 @@
          - +
          @@ -814,9 +814,9 @@
           
          - +
          @@ -831,9 +831,9 @@
           
          - +

          In many languages, the local variables in functions can have their lifetimes @@ -994,9 +994,9 @@

          - +
          @@ -1023,9 +1023,9 @@
          - +
          @@ -1101,9 +1101,9 @@
          - +
          @@ -1171,9 +1171,9 @@
          - +
          @@ -1228,9 +1228,9 @@
          - +
          @@ -1239,9 +1239,9 @@
          -
          +

          bool -

          +
          @@ -1265,9 +1265,9 @@
          -
          +

          char -

          +
          @@ -1291,9 +1291,9 @@
          - +
          @@ -1317,9 +1317,9 @@
          -
          +

          short -

          +
          @@ -1343,9 +1343,9 @@
          - +
          @@ -1369,9 +1369,9 @@
          -
          +

          int -

          +
          @@ -1394,9 +1394,9 @@
          - +
          @@ -1420,9 +1420,9 @@
          - +
          @@ -1446,9 +1446,9 @@
          - +
          @@ -1472,9 +1472,9 @@
          -
          +

          float -

          +
          @@ -1498,9 +1498,9 @@
          -
          +

          double -

          +
          @@ -1524,9 +1524,9 @@
          - +
          @@ -1609,9 +1609,9 @@
          - +
          @@ -1722,9 +1722,9 @@
          - +
          Modified: llvm/trunk/docs/SystemLibrary.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SystemLibrary.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/SystemLibrary.html (original) +++ llvm/trunk/docs/SystemLibrary.html Mon Apr 18 18:59:50 2011 @@ -7,7 +7,7 @@ -
          System Library
          +

          System Library

          @@ -152,7 +152,7 @@ -
          Using llvm-config
          +

          Using llvm-config

          The llvm-config tool is a perl script that produces on its output various kinds of information. For example, the source or object directories @@ -401,14 +401,15 @@

          - +

          Linkage Rules Of Thumb

          This section contains various "rules of thumb" about what files you should link into your programs.

          - +

          + Always Link LLVMCore, LLVMSupport, and LLVMSystem +

          No matter what you do with LLVM, the last three entries in the value of your LLVMLIBS make variable should always be: @@ -416,8 +417,9 @@ programs that don't depend on these three.

          - +

          + Never link both archive and re-linked library +

          There is never any point to linking both the re-linked (.o) and the archive (.a) versions of a library. Since the re-linked version Modified: llvm/trunk/docs/WritingAnLLVMBackend.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMBackend.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/WritingAnLLVMBackend.html (original) +++ llvm/trunk/docs/WritingAnLLVMBackend.html Mon Apr 18 18:59:50 2011 @@ -9,9 +9,9 @@ -

          +

          Writing an LLVM Compiler Backend -

          +
          1. Introduction @@ -61,9 +61,9 @@
          - +
          @@ -93,9 +93,9 @@
          - +
          @@ -106,9 +106,9 @@
          - +
          @@ -155,9 +155,9 @@
          - +
          @@ -220,9 +220,9 @@
          - +
          @@ -282,9 +282,9 @@
          - +
          @@ -424,9 +424,9 @@
          - +
          @@ -480,9 +480,9 @@
          - +
          @@ -517,9 +517,9 @@
          - +
          @@ -700,9 +700,9 @@
          - +
          @@ -894,10 +894,10 @@
          - +
          @@ -934,9 +934,9 @@
          - +
          @@ -1191,9 +1191,9 @@
          - +
          @@ -1283,10 +1283,10 @@
          - +
          @@ -1327,9 +1327,9 @@
          - +

          @@ -1486,9 +1486,9 @@

          - +
          @@ -1645,9 +1645,9 @@
          - +
          @@ -1719,9 +1719,9 @@
          -
          +

          Promote -

          +
          @@ -1742,9 +1742,9 @@
          -
          +

          Expand -

          +
          @@ -1767,9 +1767,9 @@
          -
          +

          Custom -

          +
          @@ -1833,9 +1833,9 @@
          -
          +

          Legal -

          +
          @@ -1866,9 +1866,9 @@
          - +
          @@ -2016,9 +2016,9 @@
          - +
          @@ -2171,9 +2171,9 @@
          - +
          @@ -2289,9 +2289,9 @@
          - +
          @@ -2336,9 +2336,9 @@
          - +
          @@ -2478,9 +2478,9 @@
          - +
          Modified: llvm/trunk/docs/WritingAnLLVMPass.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMPass.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/WritingAnLLVMPass.html (original) +++ llvm/trunk/docs/WritingAnLLVMPass.html Mon Apr 18 18:59:50 2011 @@ -8,9 +8,9 @@ -
          +

          Writing an LLVM Pass -

          +
          1. Introduction - What is a pass?
          2. @@ -121,9 +121,9 @@
          - +
          @@ -156,9 +156,9 @@
          - +
          @@ -172,9 +172,9 @@
          - +
          @@ -220,9 +220,9 @@
          - +
          @@ -356,9 +356,9 @@
          - +
          @@ -447,9 +447,9 @@
          - +
          @@ -470,9 +470,9 @@
          - +
          @@ -493,9 +493,9 @@
          - +
          @@ -522,9 +522,9 @@
          - +
          @@ -539,9 +539,9 @@
          - +
          @@ -587,10 +587,11 @@
          - +

          + + The doInitialization(CallGraph &) method + +

          @@ -609,9 +610,9 @@
          - +
          @@ -626,10 +627,11 @@
          - +

          + + The doFinalization(CallGraph &) method + +

          @@ -645,9 +647,9 @@
          - +
          @@ -677,10 +679,11 @@
          - +

          + + The doInitialization(Module &) method + +

          @@ -706,9 +709,9 @@
          - +
          @@ -723,10 +726,11 @@
          - +

          + + The doFinalization(Module &) method + +

          @@ -742,9 +746,9 @@
          - +
          @@ -760,11 +764,11 @@
          - +

          + + The doInitialization(Loop *,LPPassManager &) method + +

          @@ -783,9 +787,9 @@ - +
          @@ -801,9 +805,9 @@
          - +
          @@ -819,9 +823,9 @@
          - +
          @@ -838,11 +842,11 @@
          - +

          + + The doInitialization(Region *, RGPassManager &) method + +

          @@ -861,9 +865,9 @@ - +
          @@ -879,9 +883,9 @@
          - +
          @@ -899,9 +903,9 @@ - +
          @@ -928,10 +932,11 @@
          - +

          + + The doInitialization(Function &) method + +

          @@ -950,9 +955,9 @@
          - +
          @@ -968,10 +973,11 @@
          - +

          + + The doFinalization(Function &) method + +

          @@ -988,9 +994,9 @@
          - +
          @@ -1020,10 +1026,11 @@
          - +

          + + The runOnMachineFunction(MachineFunction &MF) method + +

          @@ -1047,9 +1054,9 @@
          - +
          @@ -1072,9 +1079,9 @@
          - +
          @@ -1097,9 +1104,9 @@
          - +
          @@ -1122,9 +1129,9 @@
          - +
          @@ -1142,9 +1149,12 @@
          - +

          + + The AnalysisUsage::addRequired<> + and AnalysisUsage::addRequiredTransitive<> methods + +

          @@ -1168,9 +1178,11 @@

          - +

          + + The AnalysisUsage::addPreserved<> method + +

          @@ -1203,9 +1215,11 @@

          - +

          + + Example implementations of getAnalysisUsage + +

          @@ -1220,10 +1234,12 @@
          - +

          + + The getAnalysis<> and + getAnalysisIfAvailable<> methods + +

          @@ -1278,9 +1294,9 @@
          - +
          @@ -1305,9 +1321,9 @@
          - +
          @@ -1356,9 +1372,9 @@
          - +
          @@ -1418,9 +1434,9 @@
          - +
          @@ -1435,9 +1451,9 @@ - +
          @@ -1610,9 +1626,9 @@
          - +
          @@ -1636,9 +1652,9 @@
          - +
          @@ -1671,9 +1687,9 @@
          - +
          @@ -1736,9 +1752,9 @@ - +
          @@ -1769,9 +1785,9 @@
          - +
          @@ -1789,9 +1805,9 @@
          - +
          @@ -1834,9 +1850,9 @@
          - +
          @@ -1867,9 +1883,9 @@
          - +
          @@ -1881,9 +1897,9 @@
          - +
          Modified: llvm/trunk/docs/index.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/index.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/index.html (original) +++ llvm/trunk/docs/index.html Mon Apr 18 18:59:50 2011 @@ -7,7 +7,7 @@ -
          Documentation for the LLVM System at SVN head
          +

          Documentation for the LLVM System at SVN head

          If you are using a released version of LLVM, see the download page to find @@ -39,7 +39,7 @@

          - +

          LLVM Design & Overview

            @@ -57,7 +57,7 @@
          - +

          LLVM User Guides

          - +

          Tutorial Introduction

          @@ -123,7 +123,7 @@
          - +

          The Basic Language

          @@ -181,7 +181,7 @@
          - +

          The Lexer

          Modified: llvm/trunk/docs/tutorial/LangImpl2.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl2.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl2.html (original) +++ llvm/trunk/docs/tutorial/LangImpl2.html Mon Apr 18 18:59:50 2011 @@ -11,7 +11,7 @@ -
          Kaleidoscope: Implementing a Parser and AST
          +

          Kaleidoscope: Implementing a Parser and AST

          - +

          Chapter 2 Introduction

          @@ -61,7 +61,7 @@
          - +

          The Abstract Syntax Tree (AST)

          @@ -178,7 +178,7 @@
          - +

          Parser Basics

          @@ -239,8 +239,7 @@
          - +

          Basic Expression Parsing

          @@ -394,8 +393,7 @@
          - +

          Binary Expression Parsing

          @@ -617,7 +615,7 @@
          - +

          Parsing the Rest

          @@ -714,7 +712,7 @@
          - +

          The Driver

          @@ -753,7 +751,7 @@
          - +

          Conclusions

          @@ -790,7 +788,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/LangImpl3.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl3.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl3.html (original) +++ llvm/trunk/docs/tutorial/LangImpl3.html Mon Apr 18 18:59:50 2011 @@ -11,7 +11,7 @@ -
          Kaleidoscope: Code generation to LLVM IR
          +

          Kaleidoscope: Code generation to LLVM IR

          - +

          Chapter 3 Introduction

          @@ -57,7 +57,7 @@
          - +

          Code Generation Setup

          @@ -147,7 +147,7 @@
          - +

          Expression Code Generation

          @@ -293,7 +293,7 @@
          - +

          Function Code Generation

          @@ -515,8 +515,7 @@
          - +

          Driver Changes and Closing Thoughts

          @@ -657,7 +656,7 @@ - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/LangImpl4.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl4.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl4.html (original) +++ llvm/trunk/docs/tutorial/LangImpl4.html Mon Apr 18 18:59:50 2011 @@ -11,7 +11,7 @@ -
          Kaleidoscope: Adding JIT and Optimizer Support
          +

          Kaleidoscope: Adding JIT and Optimizer Support

          - +

          Chapter 4 Introduction

          @@ -48,8 +48,7 @@
          - +

          Trivial Constant Folding

          @@ -134,8 +133,7 @@
          - +

          LLVM Optimization Passes

          @@ -266,7 +264,7 @@
          - +

          Adding a JIT Compiler

          @@ -474,7 +472,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/LangImpl5.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl5.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl5.html (original) +++ llvm/trunk/docs/tutorial/LangImpl5.html Mon Apr 18 18:59:50 2011 @@ -11,7 +11,7 @@ -
          Kaleidoscope: Extending the Language: Control Flow
          +

          Kaleidoscope: Extending the Language: Control Flow

          - +

          Chapter 5 Introduction

          @@ -65,7 +65,7 @@
          - +

          If/Then/Else

          @@ -111,8 +111,7 @@
          - +

          Lexer Extensions for If/Then/Else

          @@ -146,8 +145,7 @@
          - +

          AST Extensions for If/Then/Else

          @@ -172,8 +170,7 @@
          - +

          Parser Extensions for If/Then/Else

          @@ -231,7 +228,7 @@
          - +

          LLVM IR for If/Then/Else

          @@ -347,8 +344,7 @@
          - +

          Code Generation for If/Then/Else

          @@ -501,7 +497,7 @@
          - +

          'for' Loop Expression

          @@ -536,8 +532,7 @@
          - +

          Lexer Extensions for the 'for' Loop

          @@ -566,8 +561,7 @@
          - +

          AST Extensions for the 'for' Loop

          @@ -593,8 +587,7 @@
          - +

          Parser Extensions for the 'for' Loop

          @@ -653,8 +646,7 @@
          - +

          LLVM IR for the 'for' Loop

          @@ -699,8 +691,7 @@
          - +

          Code Generation for the 'for' Loop

          @@ -877,7 +868,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/LangImpl6.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl6.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl6.html (original) +++ llvm/trunk/docs/tutorial/LangImpl6.html Mon Apr 18 18:59:50 2011 @@ -11,7 +11,7 @@ -
          Kaleidoscope: Extending the Language: User-defined Operators
          +

          Kaleidoscope: Extending the Language: User-defined Operators

          - +

          Chapter 6 Introduction

          @@ -60,7 +60,7 @@
          - +

          User-defined Operators: the Idea

          @@ -125,7 +125,7 @@
          - +

          User-defined Binary Operators

          @@ -342,7 +342,7 @@
          - +

          User-defined Unary Operators

          @@ -491,7 +491,7 @@
          - +

          Kicking the Tires

          @@ -796,7 +796,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/LangImpl7.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl7.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl7.html (original) +++ llvm/trunk/docs/tutorial/LangImpl7.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          Kaleidoscope: Extending the Language: Mutable Variables
          +

          Kaleidoscope: Extending the Language: Mutable Variables

          - +

          Chapter 7 Introduction

          @@ -66,7 +66,7 @@
          - +

          Why is this a hard problem?

          @@ -140,7 +140,7 @@
          - +

          Memory in LLVM

          @@ -321,8 +321,7 @@
          - +

          Mutable Variables in Kaleidoscope

          @@ -378,8 +377,7 @@
          - +

          Adjusting Existing Variables for Mutation

          @@ -648,7 +646,7 @@
          - +

          New Assignment Operator

          @@ -745,8 +743,7 @@
          - +

          User-defined Local Variables

          @@ -979,7 +976,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/LangImpl8.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/LangImpl8.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/LangImpl8.html (original) +++ llvm/trunk/docs/tutorial/LangImpl8.html Mon Apr 18 18:59:50 2011 @@ -11,8 +11,7 @@ -
          Kaleidoscope: Conclusion and other useful LLVM - tidbits
          +

          Kaleidoscope: Conclusion and other useful LLVM tidbits

          - +

          Tutorial Conclusion

          @@ -154,8 +153,7 @@
          - +

          Properties of the LLVM IR

          @@ -166,8 +164,7 @@
          - +

          Target Independence

          @@ -221,7 +218,7 @@
          - +

          Safety Guarantees

          @@ -243,8 +240,7 @@
          - +

          Language-Specific Optimizations

          @@ -298,7 +294,7 @@
          - +

          Tips and Tricks

          @@ -310,8 +306,7 @@
          - +

          Implementing portable offsetof/sizeof

          @@ -331,8 +326,7 @@
          - +

          Garbage Collected Stack Frames

          Modified: llvm/trunk/docs/tutorial/OCamlLangImpl1.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl1.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl1.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl1.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          Kaleidoscope: Tutorial Introduction and the Lexer
          +

          Kaleidoscope: Tutorial Introduction and the Lexer

          - +

          Tutorial Introduction

          @@ -130,7 +130,7 @@
          - +

          The Basic Language

          @@ -188,7 +188,7 @@
          - +

          The Lexer

          Modified: llvm/trunk/docs/tutorial/OCamlLangImpl2.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl2.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl2.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl2.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          Kaleidoscope: Implementing a Parser and AST
          +

          Kaleidoscope: Implementing a Parser and AST

          - +

          Chapter 2 Introduction

          @@ -65,7 +65,7 @@
          - +

          The Abstract Syntax Tree (AST)

          @@ -146,7 +146,7 @@
          - +

          Parser Basics

          @@ -181,8 +181,7 @@
          - +

          Basic Expression Parsing

          @@ -303,8 +302,7 @@
          - +

          Binary Expression Parsing

          @@ -517,7 +515,7 @@
          - +

          Parsing the Rest

          @@ -596,7 +594,7 @@
          - +

          The Driver

          @@ -652,7 +650,7 @@
          - +

          Conclusions

          @@ -689,7 +687,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/OCamlLangImpl3.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl3.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl3.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl3.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          Kaleidoscope: Code generation to LLVM IR
          +

          Kaleidoscope: Code generation to LLVM IR

          - +

          Chapter 3 Introduction

          @@ -57,7 +57,7 @@
          - +

          Code Generation Setup

          @@ -128,7 +128,7 @@
          - +

          Expression Code Generation

          @@ -263,7 +263,7 @@
          - +

          Function Code Generation

          @@ -466,8 +466,7 @@
          - +

          Driver Changes and Closing Thoughts

          @@ -607,7 +606,7 @@ - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/OCamlLangImpl4.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl4.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl4.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl4.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          Kaleidoscope: Adding JIT and Optimizer Support
          +

          Kaleidoscope: Adding JIT and Optimizer Support

          - +

          Chapter 4 Introduction

          @@ -52,8 +52,7 @@
          - +

          Trivial Constant Folding

          @@ -148,8 +147,7 @@
          - +

          LLVM Optimization Passes

          @@ -283,7 +281,7 @@
          - +

          Adding a JIT Compiler

          @@ -486,7 +484,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/OCamlLangImpl5.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl5.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl5.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl5.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          Kaleidoscope: Extending the Language: Control Flow
          +

          Kaleidoscope: Extending the Language: Control Flow

          - +

          Chapter 5 Introduction

          @@ -69,7 +69,7 @@
          - +

          If/Then/Else

          @@ -115,8 +115,7 @@
          - +

          Lexer Extensions for If/Then/Else

          @@ -153,8 +152,7 @@
          - +

          AST Extensions for If/Then/Else

          @@ -175,8 +173,7 @@
          - +

          Parser Extensions for If/Then/Else

          @@ -214,7 +211,7 @@
          - +

          LLVM IR for If/Then/Else

          @@ -331,8 +328,7 @@
          - +

          Code Generation for If/Then/Else

          @@ -493,7 +489,7 @@
          - +

          'for' Loop Expression

          @@ -528,8 +524,7 @@
          - +

          Lexer Extensions for the 'for' Loop

          @@ -559,8 +554,7 @@
          - +

          AST Extensions for the 'for' Loop

          @@ -580,8 +574,7 @@
          - +

          Parser Extensions for the 'for' Loop

          @@ -628,8 +621,7 @@
          - +

          LLVM IR for the 'for' Loop

          @@ -674,8 +666,7 @@
          - +

          Code Generation for the 'for' Loop

          @@ -852,7 +843,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/OCamlLangImpl6.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl6.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl6.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl6.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          Kaleidoscope: Extending the Language: User-defined Operators
          +

          Kaleidoscope: Extending the Language: User-defined Operators

          - +

          Chapter 6 Introduction

          @@ -64,7 +64,7 @@
          - +

          User-defined Operators: the Idea

          @@ -129,7 +129,7 @@
          - +

          User-defined Binary Operators

          @@ -320,7 +320,7 @@
          - +

          User-defined Unary Operators

          @@ -472,7 +472,7 @@
          - +

          Kicking the Tires

          @@ -778,7 +778,7 @@ - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/OCamlLangImpl7.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl7.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl7.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl7.html Mon Apr 18 18:59:50 2011 @@ -13,7 +13,7 @@ -
          Kaleidoscope: Extending the Language: Mutable Variables
          +

          Kaleidoscope: Extending the Language: Mutable Variables

          - +

          Chapter 7 Introduction

          @@ -70,7 +70,7 @@
          - +

          Why is this a hard problem?

          @@ -144,7 +144,7 @@
          - +

          Memory in LLVM

          @@ -325,8 +325,7 @@
          - +

          Mutable Variables in Kaleidoscope

          @@ -382,8 +381,7 @@
          - +

          Adjusting Existing Variables for Mutation

          @@ -672,7 +670,7 @@
          - +

          New Assignment Operator

          @@ -773,8 +771,7 @@
          - +

          User-defined Local Variables

          @@ -956,7 +953,7 @@
          - +

          Full Code Listing

          Modified: llvm/trunk/docs/tutorial/OCamlLangImpl8.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/OCamlLangImpl8.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/OCamlLangImpl8.html (original) +++ llvm/trunk/docs/tutorial/OCamlLangImpl8.html Mon Apr 18 18:59:50 2011 @@ -11,8 +11,7 @@ -
          Kaleidoscope: Conclusion and other useful LLVM - tidbits
          +

          Kaleidoscope: Conclusion and other useful LLVM tidbits

          - +

          Tutorial Conclusion

          @@ -154,8 +153,7 @@
          - +

          Properties of the LLVM IR

          @@ -166,8 +164,7 @@
          - +

          Target Independence

          @@ -221,7 +218,7 @@
          - +

          Safety Guarantees

          @@ -243,8 +240,7 @@
          - +

          Language-Specific Optimizations

          @@ -298,7 +294,7 @@
          - +

          Tips and Tricks

          @@ -310,8 +306,7 @@
          - +

          Implementing portable offsetof/sizeof

          @@ -331,8 +326,7 @@
          - +

          Garbage Collected Stack Frames

          Modified: llvm/trunk/docs/tutorial/index.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/tutorial/index.html?rev=129736&r1=129735&r2=129736&view=diff ============================================================================== --- llvm/trunk/docs/tutorial/index.html (original) +++ llvm/trunk/docs/tutorial/index.html Mon Apr 18 18:59:50 2011 @@ -12,7 +12,7 @@ -
          LLVM Tutorial: Table of Contents
          +

          LLVM Tutorial: Table of Contents

          1. Kaleidoscope: Implementing a Language with LLVM From pichet2000 at gmail.com Mon Apr 18 19:03:17 2011 From: pichet2000 at gmail.com (Francois Pichet) Date: Tue, 19 Apr 2011 00:03:17 -0000 Subject: [llvm-commits] [llvm] r129737 - /llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Message-ID: <20110419000317.6F7C82A6C12C@llvm.org> Author: fpichet Date: Mon Apr 18 19:03:17 2011 New Revision: 129737 URL: http://llvm.org/viewvc/llvm-project?rev=129737&view=rev Log: Disable warning C4181: "qualifier applied to reference type; ignored" This was causing a flooding of warnings with MSVC 2008. This warning was removed in MSVC 2010. Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=129737&r1=129736&r2=129737&view=diff ============================================================================== --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original) +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Mon Apr 18 19:03:17 2011 @@ -153,7 +153,7 @@ -wd4715 # Suppress ''function' : not all control paths return a value' -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)' -wd4065 # Suppress 'switch statement contains 'default' but no 'case' labels' - + -wd4181 # Suppress 'qualifier applied to reference type; ignored' -w14062 # Promote "enumerator in switch of enum is not handled" to level 1 warning. ) From evan.cheng at apple.com Mon Apr 18 19:04:04 2011 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 19 Apr 2011 00:04:04 -0000 Subject: [llvm-commits] [llvm] r129738 - in /llvm/trunk: lib/Target/ARM/ARMExpandPseudoInsts.cpp lib/Target/ARM/ARMISelDAGToDAG.cpp test/CodeGen/ARM/vld1.ll test/CodeGen/ARM/vldlane.ll Message-ID: <20110419000404.29CE62A6C12C@llvm.org> Author: evancheng Date: Mon Apr 18 19:04:03 2011 New Revision: 129738 URL: http://llvm.org/viewvc/llvm-project?rev=129738&view=rev Log: Do not lose mem_operands while lowering VLD / VST intrinsics. Modified: llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/test/CodeGen/ARM/vld1.ll llvm/trunk/test/CodeGen/ARM/vldlane.ll Modified: llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp?rev=129738&r1=129737&r2=129738&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp Mon Apr 18 19:04:03 2011 @@ -455,6 +455,10 @@ // Add an implicit def for the super-register. MIB.addReg(DstReg, RegState::ImplicitDefine | getDeadRegState(DstIsDead)); TransferImpOps(MI, MIB, MIB); + + // Transfer memoperands. + (*MIB).setMemRefs(MI.memoperands_begin(), MI.memoperands_end()); + MI.eraseFromParent(); } @@ -500,6 +504,10 @@ // Add an implicit kill for the super-reg. (*MIB).addRegisterKilled(SrcReg, TRI, true); TransferImpOps(MI, MIB, MIB); + + // Transfer memoperands. + (*MIB).setMemRefs(MI.memoperands_begin(), MI.memoperands_end()); + MI.eraseFromParent(); } Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=129738&r1=129737&r2=129738&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon Apr 18 19:04:03 2011 @@ -1553,6 +1553,11 @@ Ops.data(), Ops.size()); } + // Transfer memoperands. + MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1); + MemOp[0] = cast(N)->getMemOperand(); + cast(VLd)->setMemRefs(MemOp, MemOp + 1); + if (NumVecs == 1) return VLd; @@ -1582,6 +1587,9 @@ if (!SelectAddrMode6(N, N->getOperand(AddrOpIdx), MemAddr, Align)) return NULL; + MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1); + MemOp[0] = cast(N)->getMemOperand(); + SDValue Chain = N->getOperand(0); EVT VT = N->getOperand(Vec0Idx).getValueType(); bool is64BitVector = VT.is64BitVector(); @@ -1654,7 +1662,13 @@ Ops.push_back(Pred); Ops.push_back(Reg0); Ops.push_back(Chain); - return CurDAG->getMachineNode(Opc, dl, ResTys, Ops.data(), Ops.size()); + SDNode *VSt = + CurDAG->getMachineNode(Opc, dl, ResTys, Ops.data(), Ops.size()); + + // Transfer memoperands. + cast(VSt)->setMemRefs(MemOp, MemOp + 1); + + return VSt; } // Otherwise, quad registers are stored with two separate instructions, @@ -1675,6 +1689,7 @@ SDNode *VStA = CurDAG->getMachineNode(QOpcodes0[OpcodeIndex], dl, MemAddr.getValueType(), MVT::Other, OpsA, 7); + cast(VStA)->setMemRefs(MemOp, MemOp + 1); Chain = SDValue(VStA, 1); // Store the odd D registers. @@ -1691,8 +1706,10 @@ Ops.push_back(Pred); Ops.push_back(Reg0); Ops.push_back(Chain); - return CurDAG->getMachineNode(QOpcodes1[OpcodeIndex], dl, ResTys, - Ops.data(), Ops.size()); + SDNode *VStB = CurDAG->getMachineNode(QOpcodes1[OpcodeIndex], dl, ResTys, + Ops.data(), Ops.size()); + cast(VStB)->setMemRefs(MemOp, MemOp + 1); + return VStB; } SDNode *ARMDAGToDAGISel::SelectVLDSTLane(SDNode *N, bool IsLoad, @@ -1708,6 +1725,9 @@ if (!SelectAddrMode6(N, N->getOperand(AddrOpIdx), MemAddr, Align)) return NULL; + MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1); + MemOp[0] = cast(N)->getMemOperand(); + SDValue Chain = N->getOperand(0); unsigned Lane = cast(N->getOperand(Vec0Idx + NumVecs))->getZExtValue(); @@ -1794,6 +1814,7 @@ QOpcodes[OpcodeIndex]); SDNode *VLdLn = CurDAG->getMachineNode(Opc, dl, ResTys, Ops.data(), Ops.size()); + cast(VLdLn)->setMemRefs(MemOp, MemOp + 1); if (!IsLoad) return VLdLn; @@ -1820,6 +1841,9 @@ if (!SelectAddrMode6(N, N->getOperand(1), MemAddr, Align)) return NULL; + MachineSDNode::mmo_iterator MemOp = MF->allocateMemRefsArray(1); + MemOp[0] = cast(N)->getMemOperand(); + SDValue Chain = N->getOperand(0); EVT VT = N->getValueType(0); @@ -1864,12 +1888,13 @@ unsigned ResTyElts = (NumVecs == 3) ? 4 : NumVecs; std::vector ResTys; - ResTys.push_back(EVT::getVectorVT(*CurDAG->getContext(), MVT::i64, ResTyElts)); + ResTys.push_back(EVT::getVectorVT(*CurDAG->getContext(), MVT::i64,ResTyElts)); if (isUpdating) ResTys.push_back(MVT::i32); ResTys.push_back(MVT::Other); SDNode *VLdDup = CurDAG->getMachineNode(Opc, dl, ResTys, Ops.data(), Ops.size()); + cast(VLdDup)->setMemRefs(MemOp, MemOp + 1); SuperReg = SDValue(VLdDup, 0); // Extract the subregisters. Modified: llvm/trunk/test/CodeGen/ARM/vld1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vld1.ll?rev=129738&r1=129737&r2=129738&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vld1.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vld1.ll Mon Apr 18 19:04:03 2011 @@ -133,8 +133,6 @@ ; Do not crash if the vld1 result is not used. define void @unused_vld1_result() { entry: -;CHECK: unused_vld1_result -;CHECK: vld1.32 %0 = call <4 x float> @llvm.arm.neon.vld1.v4f32(i8* undef, i32 1) call void @llvm.trap() unreachable Modified: llvm/trunk/test/CodeGen/ARM/vldlane.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vldlane.ll?rev=129738&r1=129737&r2=129738&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/vldlane.ll (original) +++ llvm/trunk/test/CodeGen/ARM/vldlane.ll Mon Apr 18 19:04:03 2011 @@ -491,7 +491,7 @@ ; in the QPR_VFP2 regclass, it needs to be copied to a QPR regclass because ; we don't currently have a QQQQ_VFP2 super-regclass. (The "0" for the low ; part of %ins67 is supposed to be loaded by a VLDRS instruction in this test.) -define void @test_qqqq_regsequence_subreg([6 x i64] %b) nounwind { +define <8 x i16> @test_qqqq_regsequence_subreg([6 x i64] %b) nounwind { ;CHECK: test_qqqq_regsequence_subreg ;CHECK: vld3.16 %tmp63 = extractvalue [6 x i64] %b, 5 @@ -500,8 +500,12 @@ %ins67 = or i128 %tmp65, 0 %tmp78 = bitcast i128 %ins67 to <8 x i16> %vld3_lane = tail call %struct.__neon_int16x8x3_t @llvm.arm.neon.vld3lane.v8i16(i8* undef, <8 x i16> undef, <8 x i16> undef, <8 x i16> %tmp78, i32 1, i32 2) - call void @llvm.trap() - unreachable + %tmp3 = extractvalue %struct.__neon_int16x8x3_t %vld3_lane, 0 + %tmp4 = extractvalue %struct.__neon_int16x8x3_t %vld3_lane, 1 + %tmp5 = extractvalue %struct.__neon_int16x8x3_t %vld3_lane, 2 + %tmp6 = add <8 x i16> %tmp3, %tmp4 + %tmp7 = add <8 x i16> %tmp5, %tmp6 + ret <8 x i16> %tmp7 } declare void @llvm.trap() nounwind From stoklund at 2pi.dk Mon Apr 18 19:14:43 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Tue, 19 Apr 2011 00:14:43 -0000 Subject: [llvm-commits] [llvm] r129739 - in /llvm/trunk/test/CodeGen: ARM/fcopysign.ll ARM/inlineasm3.ll Mips/buildpairextractelementf64.ll Thumb/2010-07-15-debugOrdering.ll Message-ID: <20110419001443.B11852A6C12C@llvm.org> Author: stoklund Date: Mon Apr 18 19:14:43 2011 New Revision: 129739 URL: http://llvm.org/viewvc/llvm-project?rev=129739&view=rev Log: Make tests register allocation independent again. Modified: llvm/trunk/test/CodeGen/ARM/fcopysign.ll llvm/trunk/test/CodeGen/ARM/inlineasm3.ll llvm/trunk/test/CodeGen/Mips/buildpairextractelementf64.ll llvm/trunk/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll Modified: llvm/trunk/test/CodeGen/ARM/fcopysign.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/fcopysign.ll?rev=129739&r1=129738&r2=129739&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/fcopysign.ll (original) +++ llvm/trunk/test/CodeGen/ARM/fcopysign.ll Mon Apr 18 19:14:43 2011 @@ -45,10 +45,10 @@ entry: ; SOFT: test4: ; SOFT: vmov.f64 [[REG4:(d[0-9]+)]], #1.000000e+00 -; SOFT: vcvt.f32.f64 s0, [[REG4]] +; SOFT: vcvt.f32.f64 {{s[0-9]+}}, [[REG4]] ; SOFT: vshr.u64 [[REG4]], [[REG4]], #32 ; SOFT: vmov.i32 [[REG5:(d[0-9]+)]], #0x80000000 -; SOFT: vbsl [[REG5]], [[REG4]], d0 +; SOFT: vbsl [[REG5]], [[REG4]], {{d[0-9]+}} %call80 = tail call double @copysign(double 1.000000e+00, double undef) %conv81 = fptrunc double %call80 to float %tmp88 = bitcast float %conv81 to i32 Modified: llvm/trunk/test/CodeGen/ARM/inlineasm3.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/inlineasm3.ll?rev=129739&r1=129738&r2=129739&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/inlineasm3.ll (original) +++ llvm/trunk/test/CodeGen/ARM/inlineasm3.ll Mon Apr 18 19:14:43 2011 @@ -6,7 +6,7 @@ define void @t() nounwind { entry: ; CHECK: vmov.I64 q15, #0 -; CHECK: vmov.32 d30[0], r0 +; CHECK: vmov.32 d30[0], ; CHECK: vmov q8, q15 %tmp = alloca %struct.int32x4_t, align 16 call void asm sideeffect "vmov.I64 q15, #0\0Avmov.32 d30[0], $1\0Avmov ${0:q}, q15\0A", "=*w,r,~{d31},~{d30}"(%struct.int32x4_t* %tmp, i32 8192) nounwind Modified: llvm/trunk/test/CodeGen/Mips/buildpairextractelementf64.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/buildpairextractelementf64.ll?rev=129739&r1=129738&r2=129739&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Mips/buildpairextractelementf64.ll (original) +++ llvm/trunk/test/CodeGen/Mips/buildpairextractelementf64.ll Mon Apr 18 19:14:43 2011 @@ -1,13 +1,11 @@ -; RUN: llc < %s -march=mipsel | FileCheck %s -check-prefix=CHECK-EL -; RUN: llc < %s -march=mips | FileCheck %s -check-prefix=CHECK-EB +; RUN: llc < %s -march=mipsel | FileCheck %s +; RUN: llc < %s -march=mips | FileCheck %s @a = external global i32 define double @f(i32 %a1, double %d) nounwind { entry: -; CHECK-EL: mtc1 $6, $f12 -; CHECK-EL: mtc1 $7, $f13 -; CHECK-EB: mtc1 $7, $f12 -; CHECK-EB: mtc1 $6, $f13 +; CHECK: mtc1 +; CHECK: mtc1 store i32 %a1, i32* @a, align 4 %add = fadd double %d, 2.000000e+00 ret double %add @@ -15,10 +13,8 @@ define void @f3(double %d, i32 %a1) nounwind { entry: -; CHECK-EL: mfc1 ${{[0-9]+}}, $f12 -; CHECK-EL: mfc1 $7, $f13 -; CHECK-EB: mfc1 ${{[0-9]+}}, $f13 -; CHECK-EB: mfc1 $7, $f12 +; CHECK: mfc1 +; CHECK: mfc1 tail call void @f2(i32 %a1, double %d) nounwind ret void } Modified: llvm/trunk/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll?rev=129739&r1=129738&r2=129739&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll (original) +++ llvm/trunk/test/CodeGen/Thumb/2010-07-15-debugOrdering.ll Mon Apr 18 19:14:43 2011 @@ -10,7 +10,7 @@ define void @_Z19getClosestDiagonal3ii(%0* noalias sret, i32, i32) nounwind { ; CHECK: blx ___muldf3 ; CHECK: blx ___muldf3 -; CHECK: beq LBB0_7 +; CHECK: beq LBB0 ; CHECK: blx ___muldf3 ;
          -""" % table_name - if show_perf: + # Group tests by final component. + def get_last_component(t): + name = t[0] + if '.' in name: + return name.rsplit('.', 1)[1] + return '' + grouped = Util.multidict( + (get_last_component(t), t) + for t in tests) + + test_name = name + for group,grouped_tests in Util.sorted(grouped.items()): + group_name = { + "" : "(ungrouped)", + "exec" : "Execution", + "compile" : "Compile" }.get(group, group) + if show_pset: + table_name = "%s - %s" % (test_name, pset) + else: + table_name = test_name + print >>report, "%s - %s" % (table_name, group_name) print >>html_report, """ -""" - print >>html_report, """""" - - for i,(name,cr) in enumerate(tests): +

          +

          %sΔPreviousCurrent σ
          + """ % (table_name, group_name) if show_perf: - if cr.stddev is not None: - print >>report, ( - ' %s: %.2f%%' - '(%.4f => %.4f, std. dev.: %.4f)') % ( - name, 100. * cr.pct_delta, - cr.previous, cr.current, cr.stddev) - else: - print >>report, ( - ' %s: %.2f%%' - '(%.4f => %.4f)') % ( - name, 100. * cr.pct_delta, - cr.previous, cr.current) - - # Show inline charts for top 10 changes. - if show_graphs and i < 10: - graph_name = "graph.%d" % len(graphs) - graphs.append( (graph_name,name,pset) ) - extra_cell_value = """ -
          -""" % (graph_name) - else: - extra_cell_value = "" - - # Link the regression to the chart of its performance. - pset_name = pset_names[pset] - form_data = urllib.urlencode([(pset_name, 'on'), - ('test.'+name, 'on')]) - linked_name = '%s' % ( - os.path.join(report_url, "graph"), form_data, name) - - pct_value = Util.PctCell(cr.pct_delta).render() - if cr.stddev is not None: - print >>html_report, """ -
          %s""" %( - linked_name, extra_cell_value, pct_value, - cr.previous, cr.current, cr.stddev) + print >>html_report, """ + """ + print >>html_report, """""" + for i,(name,cr) in enumerate(grouped_tests): + if show_perf: + if cr.stddev is not None: + print >>report, ( + ' %s: %.2f%%' + '(%.4f => %.4f, std. dev.: %.4f)') % ( + name, 100. * cr.pct_delta, + cr.previous, cr.current, cr.stddev) + else: + print >>report, ( + ' %s: %.2f%%' + '(%.4f => %.4f)') % ( + name, 100. * cr.pct_delta, + cr.previous, cr.current) + + # Show inline charts for top 10 changes. + if show_graphs and i < 10: + graph_name = "graph.%d" % len(graphs) + graphs.append( (graph_name,name,pset) ) + extra_cell_value = """ +
          + """ % (graph_name) + else: + extra_cell_value = "" + + # Link the regression to the chart of its + # performance. + pset_name = pset_names[pset] + form_data = urllib.urlencode([(pset_name, 'on'), + ('test.'+name, 'on')]) + linked_name = '%s' % ( + os.path.join(report_url, "graph"), + form_data, name) + + pct_value = Util.PctCell(cr.pct_delta).render() + if cr.stddev is not None: + print >>html_report, """ +
          %s""" %( + linked_name, extra_cell_value, pct_value, + cr.previous, cr.current, cr.stddev) + else: + print >>html_report, """ + %s""" %( + name, extra_cell_value, pct_value, + cr.previous, cr.current) else: + print >>report, ' %s' % (name,) print >>html_report, """ -%s""" %( - name, extra_cell_value, pct_value, - cr.previous, cr.current) - else: - print >>report, ' %s' % (name,) - print >>html_report, """ -""" % (name,) - print >>html_report, """ -
          %s - %s
          %s%s%.4f%.4f%.4f
          ΔPreviousCurrent σ
          %s%s%.4f%.4f%.4f
          %s%s%.4f%.4f-
          %s%s%.4f%.4f-
          %s
          """ + %s""" % (name,) + print >>html_report, """ + """ # Finish up the HTML report. if graphs: From clattner at apple.com Wed Apr 20 11:34:37 2011 From: clattner at apple.com (Chris Lattner) Date: Wed, 20 Apr 2011 09:34:37 -0700 Subject: [llvm-commits] [llvm] r129845 - /llvm/trunk/lib/Target/X86/X86InstrInfo.td In-Reply-To: <20110420031942.F0A132A6C12C@llvm.org> References: <20110420031942.F0A132A6C12C@llvm.org> Message-ID: <889DFF1D-FCA2-4899-8A51-911466CB53A6@apple.com> On Apr 19, 2011, at 8:19 PM, Nick Lewycky wrote: > Author: nicholas > Date: Tue Apr 19 22:19:42 2011 > New Revision: 129845 > > URL: http://llvm.org/viewvc/llvm-project?rev=129845&view=rev > Log: > This should always be signed chars, so use int8_t. This fixes a miscompile when > llvm is built with unsigned chars where an immediate such as 0xff would be zero > extended to 64-bits, turning "cmp $0xff,%eax" into > "cmp $0xffffffffffffffff,%eax". Nice catch, thanks! -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20110420/55cd4852/attachment.html From clattner at apple.com Wed Apr 20 11:36:33 2011 From: clattner at apple.com (Chris Lattner) Date: Wed, 20 Apr 2011 09:36:33 -0700 Subject: [llvm-commits] [llvm] r129842 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/ARM/umulo-32.ll In-Reply-To: <20110420011945.CDE012A6C12C@llvm.org> References: <20110420011945.CDE012A6C12C@llvm.org> Message-ID: <85DF957B-7C5F-4C9F-BC47-C7C517E339B1@apple.com> On Apr 19, 2011, at 6:19 PM, Eric Christopher wrote: > Author: echristo > Date: Tue Apr 19 20:19:45 2011 > New Revision: 129842 > > URL: http://llvm.org/viewvc/llvm-project?rev=129842&view=rev > Log: > Rewrite the expander for umulo/smulo to remember to sign extend the input > manually and pass all (now) 4 arguments to the mul libcall. Add a new > ExpandLibCall for just this (copied gratuitously from type legalization). Instead of copying the code over, could it be moved someplace common? Maybe become a method on SelectionDAG itself or something. -Chris From stuart at apple.com Wed Apr 20 11:47:52 2011 From: stuart at apple.com (Stuart Hastings) Date: Wed, 20 Apr 2011 16:47:52 -0000 Subject: [llvm-commits] [llvm] r129858 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h include/llvm/Target/TargetLowering.h lib/CodeGen/CallingConvLower.cpp lib/Target/ARM/ARMCallingConv.td lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMISelLowering.h Message-ID: <20110420164753.185282A6C12C@llvm.org> Author: stuart Date: Wed Apr 20 11:47:52 2011 New Revision: 129858 URL: http://llvm.org/viewvc/llvm-project?rev=129858&view=rev Log: ARM byval support. Will be enabled by another patch to the FE. Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/CallingConvLower.cpp llvm/trunk/lib/Target/ARM/ARMCallingConv.td llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=129858&r1=129857&r2=129858&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Wed Apr 20 11:47:52 2011 @@ -141,6 +141,8 @@ MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State); +typedef enum { Invalid, Prologue, Call } ParmContext; + /// CCState - This class holds information needed while lowering arguments and /// return values. It captures which registers are already assigned and which /// stack slots are used. It provides accessors to allocate these values. @@ -154,6 +156,9 @@ unsigned StackOffset; SmallVector UsedRegs; + unsigned FirstByValReg; + bool FirstByValRegValid; + ParmContext CallOrPrologue; public: CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &TM, SmallVector &locs, LLVMContext &C); @@ -288,6 +293,16 @@ MVT LocVT, CCValAssign::LocInfo LocInfo, int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags); + // First GPR that carries part of a byval aggregate that's split + // between registers and memory. + unsigned getFirstByValReg() { return FirstByValRegValid ? FirstByValReg : 0; } + void setFirstByValReg(unsigned r) { FirstByValReg = r; FirstByValRegValid = true; } + void clearFirstByValReg() { FirstByValReg = 0; FirstByValRegValid = false; } + bool isFirstByValRegValid() { return FirstByValRegValid; } + + ParmContext getCallOrPrologue() { return CallOrPrologue; } + void setCallOrPrologue(ParmContext pc) { CallOrPrologue = pc; } + private: /// MarkAllocated - Mark a register and all of its aliases as allocated. void MarkAllocated(unsigned Reg); Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=129858&r1=129857&r2=129858&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Apr 20 11:47:52 2011 @@ -1253,7 +1253,7 @@ } /// HandleByVal - Target-specific cleanup for formal ByVal parameters. - virtual void HandleByVal(CCState *) const {} + virtual void HandleByVal(CCState *, unsigned &) const {} /// CanLowerReturn - This hook should be implemented to check whether the /// return values described by the Outs array can fit into the return Modified: llvm/trunk/lib/CodeGen/CallingConvLower.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CallingConvLower.cpp?rev=129858&r1=129857&r2=129858&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/CallingConvLower.cpp (original) +++ llvm/trunk/lib/CodeGen/CallingConvLower.cpp Wed Apr 20 11:47:52 2011 @@ -25,10 +25,12 @@ CCState::CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &tm, SmallVector &locs, LLVMContext &C) : CallingConv(CC), IsVarArg(isVarArg), TM(tm), - TRI(*TM.getRegisterInfo()), Locs(locs), Context(C) { + TRI(*TM.getRegisterInfo()), Locs(locs), Context(C), + CallOrPrologue(Invalid) { // No stack is used. StackOffset = 0; + clearFirstByValReg(); UsedRegs.resize((TRI.getNumRegs()+31)/32); } @@ -45,10 +47,9 @@ Size = MinSize; if (MinAlign > (int)Align) Align = MinAlign; + TM.getTargetLowering()->HandleByVal(const_cast(this), Size); unsigned Offset = AllocateStack(Size, Align); - addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo)); - TM.getTargetLowering()->HandleByVal(const_cast(this)); } /// MarkAllocated - Mark a register and all of its aliases as allocated. Modified: llvm/trunk/lib/Target/ARM/ARMCallingConv.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallingConv.td?rev=129858&r1=129857&r2=129858&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMCallingConv.td (original) +++ llvm/trunk/lib/Target/ARM/ARMCallingConv.td Wed Apr 20 11:47:52 2011 @@ -23,7 +23,7 @@ def CC_ARM_APCS : CallingConv<[ // Handles byval parameters. - CCIfByVal>, + CCIfByVal>, CCIfType<[i8, i16], CCPromoteToType>, Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=129858&r1=129857&r2=129858&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Apr 20 11:47:52 2011 @@ -72,6 +72,16 @@ cl::desc("Enable / disable ARM interworking (for debugging only)"), cl::init(true)); +// The APCS parameter registers. +static const unsigned GPRArgRegs[] = { + ARM::R0, ARM::R1, ARM::R2, ARM::R3 +}; + +static cl::opt +UseDivMod("arm-divmod-libcall", cl::Hidden, + cl::desc("Use __{u}divmod libcalls for div / rem pairs"), + cl::init(false)); + void ARMTargetLowering::addTypeForNEON(EVT VT, EVT PromotedLdStVT, EVT PromotedBitwiseVT) { if (VT != PromotedLdStVT) { @@ -1117,22 +1127,6 @@ return Chain; } -/// CreateCopyOfByValArgument - Make a copy of an aggregate at address specified -/// by "Src" to address "Dst" of size "Size". Alignment information is -/// specified by the specific parameter attribute. The copy will be passed as -/// a byval function parameter. -/// Sometimes what we are copying is the end of a larger object, the part that -/// does not fit in registers. -static SDValue -CreateCopyOfByValArgument(SDValue Src, SDValue Dst, SDValue Chain, - ISD::ArgFlagsTy Flags, SelectionDAG &DAG, - DebugLoc dl) { - SDValue SizeNode = DAG.getConstant(Flags.getByValSize(), MVT::i32); - return DAG.getMemcpy(Chain, dl, Dst, Src, SizeNode, Flags.getByValAlign(), - /*isVolatile=*/false, /*AlwaysInline=*/false, - MachinePointerInfo(0), MachinePointerInfo(0)); -} - /// LowerMemOpCallTo - Store the argument to the stack. SDValue ARMTargetLowering::LowerMemOpCallTo(SDValue Chain, @@ -1143,9 +1137,6 @@ unsigned LocMemOffset = VA.getLocMemOffset(); SDValue PtrOff = DAG.getIntPtrConstant(LocMemOffset); PtrOff = DAG.getNode(ISD::ADD, dl, getPointerTy(), StackPtr, PtrOff); - if (Flags.isByVal()) - return CreateCopyOfByValArgument(Arg, PtrOff, Chain, Flags, DAG, dl); - return DAG.getStore(Chain, dl, Arg, PtrOff, MachinePointerInfo::getStack(LocMemOffset), false, false, 0); @@ -1211,6 +1202,7 @@ SmallVector ArgLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs, *DAG.getContext()); + CCInfo.setCallOrPrologue(Call); CCInfo.AnalyzeCallOperands(Outs, CCAssignFnForNode(CallConv, /* Return*/ false, isVarArg)); @@ -1287,7 +1279,44 @@ } } else if (VA.isRegLoc()) { RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg)); - } else if (!IsSibCall || isByVal) { + } else if (isByVal) { + assert(VA.isMemLoc()); + unsigned offset = 0; + + // True if this byval aggregate will be split between registers + // and memory. + if (CCInfo.isFirstByValRegValid()) { + EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); + unsigned int i, j; + for (i = 0, j = CCInfo.getFirstByValReg(); j < ARM::R4; i++, j++) { + SDValue Const = DAG.getConstant(4*i, MVT::i32); + SDValue AddArg = DAG.getNode(ISD::ADD, dl, PtrVT, Arg, Const); + SDValue Load = DAG.getLoad(PtrVT, dl, Chain, AddArg, + MachinePointerInfo(), + false, false, 0); + MemOpChains.push_back(Load.getValue(1)); + RegsToPass.push_back(std::make_pair(j, Load)); + } + offset = ARM::R4 - CCInfo.getFirstByValReg(); + CCInfo.clearFirstByValReg(); + } + + unsigned LocMemOffset = VA.getLocMemOffset(); + SDValue StkPtrOff = DAG.getIntPtrConstant(LocMemOffset); + SDValue Dst = DAG.getNode(ISD::ADD, dl, getPointerTy(), StackPtr, + StkPtrOff); + SDValue SrcOffset = DAG.getIntPtrConstant(4*offset); + SDValue Src = DAG.getNode(ISD::ADD, dl, getPointerTy(), Arg, SrcOffset); + SDValue SizeNode = DAG.getConstant(Flags.getByValSize() - 4*offset, + MVT::i32); + MemOpChains.push_back(DAG.getMemcpy(Chain, dl, Dst, Src, SizeNode, + Flags.getByValAlign(), + /*isVolatile=*/false, + /*AlwaysInline=*/false, + MachinePointerInfo(0), + MachinePointerInfo(0))); + + } else if (!IsSibCall) { assert(VA.isMemLoc()); MemOpChains.push_back(LowerMemOpCallTo(Chain, StackPtr, Arg, @@ -1481,14 +1510,32 @@ } /// HandleByVal - Every parameter *after* a byval parameter is passed -/// on the stack. Confiscate all the parameter registers to insure +/// on the stack. Remember the next parameter register to allocate, +/// and then confiscate the rest of the parameter registers to insure /// this. void -llvm::ARMTargetLowering::HandleByVal(CCState *State) const { - static const unsigned RegList1[] = { - ARM::R0, ARM::R1, ARM::R2, ARM::R3 - }; - do {} while (State->AllocateReg(RegList1, 4)); +llvm::ARMTargetLowering::HandleByVal(CCState *State, unsigned &size) const { + unsigned reg = State->AllocateReg(GPRArgRegs, 4); + assert((State->getCallOrPrologue() == Prologue || + State->getCallOrPrologue() == Call) && + "unhandled ParmContext"); + if ((!State->isFirstByValRegValid()) && + (ARM::R0 <= reg) && (reg <= ARM::R3)) { + State->setFirstByValReg(reg); + // At a call site, a byval parameter that is split between + // registers and memory needs its size truncated here. In a + // function prologue, such byval parameters are reassembled in + // memory, and are not truncated. + if (State->getCallOrPrologue() == Call) { + unsigned excess = 4 * (ARM::R4 - reg); + assert(size >= excess && "expected larger existing stack allocation"); + size -= excess; + } + } + // Confiscate any remaining parameter registers to preclude their + // assignment to subsequent parameters. + while (State->AllocateReg(GPRArgRegs, 4)) + ; } /// MatchingStackOffset - Return true if the given stack call argument is @@ -2273,6 +2320,88 @@ return DAG.getNode(ARMISD::VMOVDRR, dl, MVT::f64, ArgValue, ArgValue2); } +void +ARMTargetLowering::computeRegArea(CCState &CCInfo, MachineFunction &MF, + unsigned &VARegSize, unsigned &VARegSaveSize) + const { + unsigned NumGPRs; + if (CCInfo.isFirstByValRegValid()) + NumGPRs = ARM::R4 - CCInfo.getFirstByValReg(); + else { + unsigned int firstUnalloced; + firstUnalloced = CCInfo.getFirstUnallocated(GPRArgRegs, + sizeof(GPRArgRegs) / + sizeof(GPRArgRegs[0])); + NumGPRs = (firstUnalloced <= 3) ? (4 - firstUnalloced) : 0; + } + + unsigned Align = MF.getTarget().getFrameLowering()->getStackAlignment(); + VARegSize = NumGPRs * 4; + VARegSaveSize = (VARegSize + Align - 1) & ~(Align - 1); +} + +// The remaining GPRs hold either the beginning of variable-argument +// data, or the beginning of an aggregate passed by value (usuall +// byval). Either way, we allocate stack slots adjacent to the data +// provided by our caller, and store the unallocated registers there. +// If this is a variadic function, the va_list pointer will begin with +// these values; otherwise, this reassembles a (byval) structure that +// was split between registers and memory. +void +ARMTargetLowering::VarArgStyleRegisters(CCState &CCInfo, SelectionDAG &DAG, + DebugLoc dl, SDValue &Chain, + unsigned ArgOffset) const { + MachineFunction &MF = DAG.getMachineFunction(); + MachineFrameInfo *MFI = MF.getFrameInfo(); + ARMFunctionInfo *AFI = MF.getInfo(); + unsigned firstRegToSaveIndex; + if (CCInfo.isFirstByValRegValid()) + firstRegToSaveIndex = CCInfo.getFirstByValReg() - ARM::R0; + else { + firstRegToSaveIndex = CCInfo.getFirstUnallocated + (GPRArgRegs, sizeof(GPRArgRegs) / sizeof(GPRArgRegs[0])); + } + + unsigned VARegSize, VARegSaveSize; + computeRegArea(CCInfo, MF, VARegSize, VARegSaveSize); + if (VARegSaveSize) { + // If this function is vararg, store any remaining integer argument regs + // to their spots on the stack so that they may be loaded by deferencing + // the result of va_next. + AFI->setVarArgsRegSaveSize(VARegSaveSize); + AFI->setVarArgsFrameIndex( + MFI->CreateFixedObject(VARegSaveSize, + ArgOffset + VARegSaveSize - VARegSize, + false)); + SDValue FIN = DAG.getFrameIndex(AFI->getVarArgsFrameIndex(), + getPointerTy()); + + SmallVector MemOps; + for (; firstRegToSaveIndex < 4; ++firstRegToSaveIndex) { + TargetRegisterClass *RC; + if (AFI->isThumb1OnlyFunction()) + RC = ARM::tGPRRegisterClass; + else + RC = ARM::GPRRegisterClass; + + unsigned VReg = MF.addLiveIn(GPRArgRegs[firstRegToSaveIndex], RC); + SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, MVT::i32); + SDValue Store = + DAG.getStore(Val.getValue(1), dl, Val, FIN, + MachinePointerInfo::getFixedStack(AFI->getVarArgsFrameIndex()), + false, false, 0); + MemOps.push_back(Store); + FIN = DAG.getNode(ISD::ADD, dl, getPointerTy(), FIN, + DAG.getConstant(4, getPointerTy())); + } + if (!MemOps.empty()) + Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, + &MemOps[0], MemOps.size()); + } else + // This will point to the next argument passed via stack. + AFI->setVarArgsFrameIndex(MFI->CreateFixedObject(4, ArgOffset, true)); +} + SDValue ARMTargetLowering::LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, @@ -2281,7 +2410,6 @@ DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const { - MachineFunction &MF = DAG.getMachineFunction(); MachineFrameInfo *MFI = MF.getFrameInfo(); @@ -2291,6 +2419,7 @@ SmallVector ArgLocs; CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs, *DAG.getContext()); + CCInfo.setCallOrPrologue(Prologue); CCInfo.AnalyzeFormalArguments(Ins, CCAssignFnForNode(CallConv, /* Return*/ false, isVarArg)); @@ -2393,9 +2522,13 @@ // In case of tail call optimization mark all arguments mutable. Since they // could be overwritten by lowering of arguments in case of a tail call. if (Flags.isByVal()) { - unsigned Bytes = Flags.getByValSize(); + unsigned VARegSize, VARegSaveSize; + computeRegArea(CCInfo, MF, VARegSize, VARegSaveSize); + VarArgStyleRegisters(CCInfo, DAG, dl, Chain, 0); + unsigned Bytes = Flags.getByValSize() - VARegSize; if (Bytes == 0) Bytes = 1; // Don't create zero-sized stack objects. - int FI = MFI->CreateFixedObject(Bytes, VA.getLocMemOffset(), false); + int FI = MFI->CreateFixedObject(Bytes, + VA.getLocMemOffset(), false); InVals.push_back(DAG.getFrameIndex(FI, getPointerTy())); } else { int FI = MFI->CreateFixedObject(VA.getLocVT().getSizeInBits()/8, @@ -2413,55 +2546,8 @@ } // varargs - if (isVarArg) { - static const unsigned GPRArgRegs[] = { - ARM::R0, ARM::R1, ARM::R2, ARM::R3 - }; - - unsigned NumGPRs = CCInfo.getFirstUnallocated - (GPRArgRegs, sizeof(GPRArgRegs) / sizeof(GPRArgRegs[0])); - - unsigned Align = MF.getTarget().getFrameLowering()->getStackAlignment(); - unsigned VARegSize = (4 - NumGPRs) * 4; - unsigned VARegSaveSize = (VARegSize + Align - 1) & ~(Align - 1); - unsigned ArgOffset = CCInfo.getNextStackOffset(); - if (VARegSaveSize) { - // If this function is vararg, store any remaining integer argument regs - // to their spots on the stack so that they may be loaded by deferencing - // the result of va_next. - AFI->setVarArgsRegSaveSize(VARegSaveSize); - AFI->setVarArgsFrameIndex( - MFI->CreateFixedObject(VARegSaveSize, - ArgOffset + VARegSaveSize - VARegSize, - false)); - SDValue FIN = DAG.getFrameIndex(AFI->getVarArgsFrameIndex(), - getPointerTy()); - - SmallVector MemOps; - for (; NumGPRs < 4; ++NumGPRs) { - TargetRegisterClass *RC; - if (AFI->isThumb1OnlyFunction()) - RC = ARM::tGPRRegisterClass; - else - RC = ARM::GPRRegisterClass; - - unsigned VReg = MF.addLiveIn(GPRArgRegs[NumGPRs], RC); - SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, MVT::i32); - SDValue Store = - DAG.getStore(Val.getValue(1), dl, Val, FIN, - MachinePointerInfo::getFixedStack(AFI->getVarArgsFrameIndex()), - false, false, 0); - MemOps.push_back(Store); - FIN = DAG.getNode(ISD::ADD, dl, getPointerTy(), FIN, - DAG.getConstant(4, getPointerTy())); - } - if (!MemOps.empty()) - Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, - &MemOps[0], MemOps.size()); - } else - // This will point to the next argument passed via stack. - AFI->setVarArgsFrameIndex(MFI->CreateFixedObject(4, ArgOffset, true)); - } + if (isVarArg) + VarArgStyleRegisters(CCInfo, DAG, dl, Chain, CCInfo.getNextStackOffset()); return Chain; } Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=129858&r1=129857&r2=129858&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Apr 20 11:47:52 2011 @@ -426,6 +426,13 @@ DebugLoc dl, SelectionDAG &DAG, SmallVectorImpl &InVals) const; + void VarArgStyleRegisters(CCState &CCInfo, SelectionDAG &DAG, + DebugLoc dl, SDValue &Chain, unsigned ArgOffset) + const; + + void computeRegArea(CCState &CCInfo, MachineFunction &MF, + unsigned &VARegSize, unsigned &VARegSaveSize) const; + virtual SDValue LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv, bool isVarArg, @@ -437,7 +444,7 @@ SmallVectorImpl &InVals) const; /// HandleByVal - Target-specific cleanup for ByVal support. - virtual void HandleByVal(CCState *) const; + virtual void HandleByVal(CCState *, unsigned &) const; /// IsEligibleForTailCallOptimization - Check whether the call is eligible /// for tail call optimization. Targets which want to do tail call From eli.friedman at gmail.com Wed Apr 20 12:21:02 2011 From: eli.friedman at gmail.com (Eli Friedman) Date: Wed, 20 Apr 2011 10:21:02 -0700 Subject: [llvm-commits] [llvm] r129858 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h include/llvm/Target/TargetLowering.h lib/CodeGen/CallingConvLower.cpp lib/Target/ARM/ARMCallingConv.td lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMIS Message-ID: On Wed, Apr 20, 2011 at 9:47 AM, Stuart Hastings wrote: > Author: stuart > Date: Wed Apr 20 11:47:52 2011 > New Revision: 129858 > > URL: http://llvm.org/viewvc/llvm-project?rev=129858&view=rev > Log: > ARM byval support. ?Will be enabled by another patch to the FE. ? Oh, wow; I didn't realize clang was still using my nasty fake-byval hack. :) -Eli > Modified: > ? ?llvm/trunk/include/llvm/CodeGen/CallingConvLower.h > ? ?llvm/trunk/include/llvm/Target/TargetLowering.h > ? ?llvm/trunk/lib/CodeGen/CallingConvLower.cpp > ? ?llvm/trunk/lib/Target/ARM/ARMCallingConv.td > ? ?llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > ? ?llvm/trunk/lib/Target/ARM/ARMISelLowering.h > > Modified: llvm/trunk/include/llvm/CodeGen/CallingConvLower.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/CallingConvLower.h?rev=129858&r1=129857&r2=129858&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/CodeGen/CallingConvLower.h (original) > +++ llvm/trunk/include/llvm/CodeGen/CallingConvLower.h Wed Apr 20 11:47:52 2011 > @@ -141,6 +141,8 @@ > ? ? ? ? ? ? ? ? ? ? ? ? MVT &LocVT, CCValAssign::LocInfo &LocInfo, > ? ? ? ? ? ? ? ? ? ? ? ? ISD::ArgFlagsTy &ArgFlags, CCState &State); > > +typedef enum { Invalid, Prologue, Call } ParmContext; > + > ?/// CCState - This class holds information needed while lowering arguments and > ?/// return values. ?It captures which registers are already assigned and which > ?/// stack slots are used. ?It provides accessors to allocate these values. > @@ -154,6 +156,9 @@ > > ? unsigned StackOffset; > ? SmallVector UsedRegs; > + ?unsigned FirstByValReg; > + ?bool FirstByValRegValid; > + ?ParmContext CallOrPrologue; > ?public: > ? CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &TM, > ? ? ? ? ? SmallVector &locs, LLVMContext &C); > @@ -288,6 +293,16 @@ > ? ? ? ? ? ? ? ? ? ?MVT LocVT, CCValAssign::LocInfo LocInfo, > ? ? ? ? ? ? ? ? ? ?int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags); > > + ?// First GPR that carries part of a byval aggregate that's split > + ?// between registers and memory. > + ?unsigned getFirstByValReg() { return FirstByValRegValid ? FirstByValReg : 0; } > + ?void setFirstByValReg(unsigned r) { FirstByValReg = r; FirstByValRegValid = true; } > + ?void clearFirstByValReg() { FirstByValReg = 0; FirstByValRegValid = false; } > + ?bool isFirstByValRegValid() { return FirstByValRegValid; } > + > + ?ParmContext getCallOrPrologue() { return CallOrPrologue; } > + ?void setCallOrPrologue(ParmContext pc) { CallOrPrologue = pc; } > + > ?private: > ? /// MarkAllocated - Mark a register and all of its aliases as allocated. > ? void MarkAllocated(unsigned Reg); > > Modified: llvm/trunk/include/llvm/Target/TargetLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=129858&r1=129857&r2=129858&view=diff > ============================================================================== > --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) > +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Apr 20 11:47:52 2011 > @@ -1253,7 +1253,7 @@ > ? } > > ? /// HandleByVal - Target-specific cleanup for formal ByVal parameters. > - ?virtual void HandleByVal(CCState *) const {} > + ?virtual void HandleByVal(CCState *, unsigned &) const {} > > ? /// CanLowerReturn - This hook should be implemented to check whether the > ? /// return values described by the Outs array can fit into the return > > Modified: llvm/trunk/lib/CodeGen/CallingConvLower.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CallingConvLower.cpp?rev=129858&r1=129857&r2=129858&view=diff > ============================================================================== > --- llvm/trunk/lib/CodeGen/CallingConvLower.cpp (original) > +++ llvm/trunk/lib/CodeGen/CallingConvLower.cpp Wed Apr 20 11:47:52 2011 > @@ -25,10 +25,12 @@ > ?CCState::CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &tm, > ? ? ? ? ? ? ? ? ?SmallVector &locs, LLVMContext &C) > ? : CallingConv(CC), IsVarArg(isVarArg), TM(tm), > - ? ?TRI(*TM.getRegisterInfo()), Locs(locs), Context(C) { > + ? ?TRI(*TM.getRegisterInfo()), Locs(locs), Context(C), > + ? ?CallOrPrologue(Invalid) { > ? // No stack is used. > ? StackOffset = 0; > > + ?clearFirstByValReg(); > ? UsedRegs.resize((TRI.getNumRegs()+31)/32); > ?} > > @@ -45,10 +47,9 @@ > ? ? Size = MinSize; > ? if (MinAlign > (int)Align) > ? ? Align = MinAlign; > + ?TM.getTargetLowering()->HandleByVal(const_cast(this), Size); > ? unsigned Offset = AllocateStack(Size, Align); > - > ? addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo)); > - ?TM.getTargetLowering()->HandleByVal(const_cast(this)); > ?} > > ?/// MarkAllocated - Mark a register and all of its aliases as allocated. > > Modified: llvm/trunk/lib/Target/ARM/ARMCallingConv.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallingConv.td?rev=129858&r1=129857&r2=129858&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMCallingConv.td (original) > +++ llvm/trunk/lib/Target/ARM/ARMCallingConv.td Wed Apr 20 11:47:52 2011 > @@ -23,7 +23,7 @@ > ?def CC_ARM_APCS : CallingConv<[ > > ? // Handles byval parameters. > - ?CCIfByVal>, > + ?CCIfByVal>, > > ? CCIfType<[i8, i16], CCPromoteToType>, > > > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=129858&r1=129857&r2=129858&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Apr 20 11:47:52 2011 > @@ -72,6 +72,16 @@ > ? cl::desc("Enable / disable ARM interworking (for debugging only)"), > ? cl::init(true)); > > +// The APCS parameter registers. > +static const unsigned GPRArgRegs[] = { > + ?ARM::R0, ARM::R1, ARM::R2, ARM::R3 > +}; > + > +static cl::opt > +UseDivMod("arm-divmod-libcall", cl::Hidden, > + ?cl::desc("Use __{u}divmod libcalls for div / rem pairs"), > + ?cl::init(false)); > + > ?void ARMTargetLowering::addTypeForNEON(EVT VT, EVT PromotedLdStVT, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?EVT PromotedBitwiseVT) { > ? if (VT != PromotedLdStVT) { > @@ -1117,22 +1127,6 @@ > ? return Chain; > ?} > > -/// CreateCopyOfByValArgument - Make a copy of an aggregate at address specified > -/// by "Src" to address "Dst" of size "Size". ?Alignment information is > -/// specified by the specific parameter attribute. ?The copy will be passed as > -/// a byval function parameter. > -/// Sometimes what we are copying is the end of a larger object, the part that > -/// does not fit in registers. > -static SDValue > -CreateCopyOfByValArgument(SDValue Src, SDValue Dst, SDValue Chain, > - ? ? ? ? ? ? ? ? ? ? ? ? ?ISD::ArgFlagsTy Flags, SelectionDAG &DAG, > - ? ? ? ? ? ? ? ? ? ? ? ? ?DebugLoc dl) { > - ?SDValue SizeNode = DAG.getConstant(Flags.getByValSize(), MVT::i32); > - ?return DAG.getMemcpy(Chain, dl, Dst, Src, SizeNode, Flags.getByValAlign(), > - ? ? ? ? ? ? ? ? ? ? ? /*isVolatile=*/false, /*AlwaysInline=*/false, > - ? ? ? ? ? ? ? ? ? ? ? MachinePointerInfo(0), MachinePointerInfo(0)); > -} > - > ?/// LowerMemOpCallTo - Store the argument to the stack. > ?SDValue > ?ARMTargetLowering::LowerMemOpCallTo(SDValue Chain, > @@ -1143,9 +1137,6 @@ > ? unsigned LocMemOffset = VA.getLocMemOffset(); > ? SDValue PtrOff = DAG.getIntPtrConstant(LocMemOffset); > ? PtrOff = DAG.getNode(ISD::ADD, dl, getPointerTy(), StackPtr, PtrOff); > - ?if (Flags.isByVal()) > - ? ?return CreateCopyOfByValArgument(Arg, PtrOff, Chain, Flags, DAG, dl); > - > ? return DAG.getStore(Chain, dl, Arg, PtrOff, > ? ? ? ? ? ? ? ? ? ? ? MachinePointerInfo::getStack(LocMemOffset), > ? ? ? ? ? ? ? ? ? ? ? false, false, 0); > @@ -1211,6 +1202,7 @@ > ? SmallVector ArgLocs; > ? CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs, > ? ? ? ? ? ? ? ? ?*DAG.getContext()); > + ?CCInfo.setCallOrPrologue(Call); > ? CCInfo.AnalyzeCallOperands(Outs, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?CCAssignFnForNode(CallConv, /* Return*/ false, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?isVarArg)); > @@ -1287,7 +1279,44 @@ > ? ? ? } > ? ? } else if (VA.isRegLoc()) { > ? ? ? RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg)); > - ? ?} else if (!IsSibCall || isByVal) { > + ? ?} else if (isByVal) { > + ? ? ?assert(VA.isMemLoc()); > + ? ? ?unsigned offset = 0; > + > + ? ? ?// True if this byval aggregate will be split between registers > + ? ? ?// and memory. > + ? ? ?if (CCInfo.isFirstByValRegValid()) { > + ? ? ? ?EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); > + ? ? ? ?unsigned int i, j; > + ? ? ? ?for (i = 0, j = CCInfo.getFirstByValReg(); j < ARM::R4; i++, j++) { > + ? ? ? ? ?SDValue Const = DAG.getConstant(4*i, MVT::i32); > + ? ? ? ? ?SDValue AddArg = DAG.getNode(ISD::ADD, dl, PtrVT, Arg, Const); > + ? ? ? ? ?SDValue Load = DAG.getLoad(PtrVT, dl, Chain, AddArg, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? MachinePointerInfo(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? false, false, 0); > + ? ? ? ? ?MemOpChains.push_back(Load.getValue(1)); > + ? ? ? ? ?RegsToPass.push_back(std::make_pair(j, Load)); > + ? ? ? ?} > + ? ? ? ?offset = ARM::R4 - CCInfo.getFirstByValReg(); > + ? ? ? ?CCInfo.clearFirstByValReg(); > + ? ? ?} > + > + ? ? ?unsigned LocMemOffset = VA.getLocMemOffset(); > + ? ? ?SDValue StkPtrOff = DAG.getIntPtrConstant(LocMemOffset); > + ? ? ?SDValue Dst = DAG.getNode(ISD::ADD, dl, getPointerTy(), StackPtr, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?StkPtrOff); > + ? ? ?SDValue SrcOffset = DAG.getIntPtrConstant(4*offset); > + ? ? ?SDValue Src = DAG.getNode(ISD::ADD, dl, getPointerTy(), Arg, SrcOffset); > + ? ? ?SDValue SizeNode = DAG.getConstant(Flags.getByValSize() - 4*offset, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? MVT::i32); > + ? ? ?MemOpChains.push_back(DAG.getMemcpy(Chain, dl, Dst, Src, SizeNode, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Flags.getByValAlign(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?/*isVolatile=*/false, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?/*AlwaysInline=*/false, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?MachinePointerInfo(0), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?MachinePointerInfo(0))); > + > + ? ?} else if (!IsSibCall) { > ? ? ? assert(VA.isMemLoc()); > > ? ? ? MemOpChains.push_back(LowerMemOpCallTo(Chain, StackPtr, Arg, > @@ -1481,14 +1510,32 @@ > ?} > > ?/// HandleByVal - Every parameter *after* a byval parameter is passed > -/// on the stack. ?Confiscate all the parameter registers to insure > +/// on the stack. ?Remember the next parameter register to allocate, > +/// and then confiscate the rest of the parameter registers to insure > ?/// this. > ?void > -llvm::ARMTargetLowering::HandleByVal(CCState *State) const { > - ?static const unsigned RegList1[] = { > - ? ?ARM::R0, ARM::R1, ARM::R2, ARM::R3 > - ?}; > - ?do {} while (State->AllocateReg(RegList1, 4)); > +llvm::ARMTargetLowering::HandleByVal(CCState *State, unsigned &size) const { > + ?unsigned reg = State->AllocateReg(GPRArgRegs, 4); > + ?assert((State->getCallOrPrologue() == Prologue || > + ? ? ? ? ?State->getCallOrPrologue() == Call) && > + ? ? ? ? "unhandled ParmContext"); > + ?if ((!State->isFirstByValRegValid()) && > + ? ? ?(ARM::R0 <= reg) && (reg <= ARM::R3)) { > + ? ?State->setFirstByValReg(reg); > + ? ?// At a call site, a byval parameter that is split between > + ? ?// registers and memory needs its size truncated here. ?In a > + ? ?// function prologue, such byval parameters are reassembled in > + ? ?// memory, and are not truncated. > + ? ?if (State->getCallOrPrologue() == Call) { > + ? ? ?unsigned excess = 4 * (ARM::R4 - reg); > + ? ? ?assert(size >= excess && "expected larger existing stack allocation"); > + ? ? ?size -= excess; > + ? ?} > + ?} > + ?// Confiscate any remaining parameter registers to preclude their > + ?// assignment to subsequent parameters. > + ?while (State->AllocateReg(GPRArgRegs, 4)) > + ? ?; > ?} > > ?/// MatchingStackOffset - Return true if the given stack call argument is > @@ -2273,6 +2320,88 @@ > ? return DAG.getNode(ARMISD::VMOVDRR, dl, MVT::f64, ArgValue, ArgValue2); > ?} > > +void > +ARMTargetLowering::computeRegArea(CCState &CCInfo, MachineFunction &MF, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?unsigned &VARegSize, unsigned &VARegSaveSize) > + ?const { > + ?unsigned NumGPRs; > + ?if (CCInfo.isFirstByValRegValid()) > + ? ?NumGPRs = ARM::R4 - CCInfo.getFirstByValReg(); > + ?else { > + ? ?unsigned int firstUnalloced; > + ? ?firstUnalloced = CCInfo.getFirstUnallocated(GPRArgRegs, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sizeof(GPRArgRegs) / > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sizeof(GPRArgRegs[0])); > + ? ?NumGPRs = (firstUnalloced <= 3) ? (4 - firstUnalloced) : 0; > + ?} > + > + ?unsigned Align = MF.getTarget().getFrameLowering()->getStackAlignment(); > + ?VARegSize = NumGPRs * 4; > + ?VARegSaveSize = (VARegSize + Align - 1) & ~(Align - 1); > +} > + > +// The remaining GPRs hold either the beginning of variable-argument > +// data, or the beginning of an aggregate passed by value (usuall > +// byval). ?Either way, we allocate stack slots adjacent to the data > +// provided by our caller, and store the unallocated registers there. > +// If this is a variadic function, the va_list pointer will begin with > +// these values; otherwise, this reassembles a (byval) structure that > +// was split between registers and memory. > +void > +ARMTargetLowering::VarArgStyleRegisters(CCState &CCInfo, SelectionDAG &DAG, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DebugLoc dl, SDValue &Chain, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?unsigned ArgOffset) const { > + ?MachineFunction &MF = DAG.getMachineFunction(); > + ?MachineFrameInfo *MFI = MF.getFrameInfo(); > + ?ARMFunctionInfo *AFI = MF.getInfo(); > + ?unsigned firstRegToSaveIndex; > + ?if (CCInfo.isFirstByValRegValid()) > + ? ?firstRegToSaveIndex = CCInfo.getFirstByValReg() - ARM::R0; > + ?else { > + ? ?firstRegToSaveIndex = CCInfo.getFirstUnallocated > + ? ? ?(GPRArgRegs, sizeof(GPRArgRegs) / sizeof(GPRArgRegs[0])); > + ?} > + > + ?unsigned VARegSize, VARegSaveSize; > + ?computeRegArea(CCInfo, MF, VARegSize, VARegSaveSize); > + ?if (VARegSaveSize) { > + ? ?// If this function is vararg, store any remaining integer argument regs > + ? ?// to their spots on the stack so that they may be loaded by deferencing > + ? ?// the result of va_next. > + ? ?AFI->setVarArgsRegSaveSize(VARegSaveSize); > + ? ?AFI->setVarArgsFrameIndex( > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?MFI->CreateFixedObject(VARegSaveSize, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ArgOffset + VARegSaveSize - VARegSize, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? false)); > + ? ?SDValue FIN = DAG.getFrameIndex(AFI->getVarArgsFrameIndex(), > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?getPointerTy()); > + > + ? ?SmallVector MemOps; > + ? ?for (; firstRegToSaveIndex < 4; ++firstRegToSaveIndex) { > + ? ? ?TargetRegisterClass *RC; > + ? ? ?if (AFI->isThumb1OnlyFunction()) > + ? ? ? ?RC = ARM::tGPRRegisterClass; > + ? ? ?else > + ? ? ? ?RC = ARM::GPRRegisterClass; > + > + ? ? ?unsigned VReg = MF.addLiveIn(GPRArgRegs[firstRegToSaveIndex], RC); > + ? ? ?SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, MVT::i32); > + ? ? ?SDValue Store = > + ? ? ? ?DAG.getStore(Val.getValue(1), dl, Val, FIN, > + ? ? ? ? ? ? ? ? ? ? MachinePointerInfo::getFixedStack(AFI->getVarArgsFrameIndex()), > + ? ? ? ? ? ? ? ? ? ? false, false, 0); > + ? ? ?MemOps.push_back(Store); > + ? ? ?FIN = DAG.getNode(ISD::ADD, dl, getPointerTy(), FIN, > + ? ? ? ? ? ? ? ? ? ? ? ?DAG.getConstant(4, getPointerTy())); > + ? ?} > + ? ?if (!MemOps.empty()) > + ? ? ?Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, > + ? ? ? ? ? ? ? ? ? ? ? ? ?&MemOps[0], MemOps.size()); > + ?} else > + ? ?// This will point to the next argument passed via stack. > + ? ?AFI->setVarArgsFrameIndex(MFI->CreateFixedObject(4, ArgOffset, true)); > +} > + > ?SDValue > ?ARMTargetLowering::LowerFormalArguments(SDValue Chain, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CallingConv::ID CallConv, bool isVarArg, > @@ -2281,7 +2410,6 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DebugLoc dl, SelectionDAG &DAG, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SmallVectorImpl &InVals) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? const { > - > ? MachineFunction &MF = DAG.getMachineFunction(); > ? MachineFrameInfo *MFI = MF.getFrameInfo(); > > @@ -2291,6 +2419,7 @@ > ? SmallVector ArgLocs; > ? CCState CCInfo(CallConv, isVarArg, getTargetMachine(), ArgLocs, > ? ? ? ? ? ? ? ? ?*DAG.getContext()); > + ?CCInfo.setCallOrPrologue(Prologue); > ? CCInfo.AnalyzeFormalArguments(Ins, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? CCAssignFnForNode(CallConv, /* Return*/ false, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? isVarArg)); > @@ -2393,9 +2522,13 @@ > ? ? ? ? ? // In case of tail call optimization mark all arguments mutable. Since they > ? ? ? ? ? // could be overwritten by lowering of arguments in case of a tail call. > ? ? ? ? ? if (Flags.isByVal()) { > - ? ? ? ? ? ?unsigned Bytes = Flags.getByValSize(); > + ? ? ? ? ? ?unsigned VARegSize, VARegSaveSize; > + ? ? ? ? ? ?computeRegArea(CCInfo, MF, VARegSize, VARegSaveSize); > + ? ? ? ? ? ?VarArgStyleRegisters(CCInfo, DAG, dl, Chain, 0); > + ? ? ? ? ? ?unsigned Bytes = Flags.getByValSize() - VARegSize; > ? ? ? ? ? ? if (Bytes == 0) Bytes = 1; // Don't create zero-sized stack objects. > - ? ? ? ? ? ?int FI = MFI->CreateFixedObject(Bytes, VA.getLocMemOffset(), false); > + ? ? ? ? ? ?int FI = MFI->CreateFixedObject(Bytes, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?VA.getLocMemOffset(), false); > ? ? ? ? ? ? InVals.push_back(DAG.getFrameIndex(FI, getPointerTy())); > ? ? ? ? ? } else { > ? ? ? ? ? ? int FI = MFI->CreateFixedObject(VA.getLocVT().getSizeInBits()/8, > @@ -2413,55 +2546,8 @@ > ? } > > ? // varargs > - ?if (isVarArg) { > - ? ?static const unsigned GPRArgRegs[] = { > - ? ? ?ARM::R0, ARM::R1, ARM::R2, ARM::R3 > - ? ?}; > - > - ? ?unsigned NumGPRs = CCInfo.getFirstUnallocated > - ? ? ?(GPRArgRegs, sizeof(GPRArgRegs) / sizeof(GPRArgRegs[0])); > - > - ? ?unsigned Align = MF.getTarget().getFrameLowering()->getStackAlignment(); > - ? ?unsigned VARegSize = (4 - NumGPRs) * 4; > - ? ?unsigned VARegSaveSize = (VARegSize + Align - 1) & ~(Align - 1); > - ? ?unsigned ArgOffset = CCInfo.getNextStackOffset(); > - ? ?if (VARegSaveSize) { > - ? ? ?// If this function is vararg, store any remaining integer argument regs > - ? ? ?// to their spots on the stack so that they may be loaded by deferencing > - ? ? ?// the result of va_next. > - ? ? ?AFI->setVarArgsRegSaveSize(VARegSaveSize); > - ? ? ?AFI->setVarArgsFrameIndex( > - ? ? ? ?MFI->CreateFixedObject(VARegSaveSize, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ArgOffset + VARegSaveSize - VARegSize, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? false)); > - ? ? ?SDValue FIN = DAG.getFrameIndex(AFI->getVarArgsFrameIndex(), > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?getPointerTy()); > - > - ? ? ?SmallVector MemOps; > - ? ? ?for (; NumGPRs < 4; ++NumGPRs) { > - ? ? ? ?TargetRegisterClass *RC; > - ? ? ? ?if (AFI->isThumb1OnlyFunction()) > - ? ? ? ? ?RC = ARM::tGPRRegisterClass; > - ? ? ? ?else > - ? ? ? ? ?RC = ARM::GPRRegisterClass; > - > - ? ? ? ?unsigned VReg = MF.addLiveIn(GPRArgRegs[NumGPRs], RC); > - ? ? ? ?SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, MVT::i32); > - ? ? ? ?SDValue Store = > - ? ? ? ? ?DAG.getStore(Val.getValue(1), dl, Val, FIN, > - ? ? ? ? ? ? ? MachinePointerInfo::getFixedStack(AFI->getVarArgsFrameIndex()), > - ? ? ? ? ? ? ? ? ? ? ? false, false, 0); > - ? ? ? ?MemOps.push_back(Store); > - ? ? ? ?FIN = DAG.getNode(ISD::ADD, dl, getPointerTy(), FIN, > - ? ? ? ? ? ? ? ? ? ? ? ? ?DAG.getConstant(4, getPointerTy())); > - ? ? ?} > - ? ? ?if (!MemOps.empty()) > - ? ? ? ?Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ?&MemOps[0], MemOps.size()); > - ? ?} else > - ? ? ?// This will point to the next argument passed via stack. > - ? ? ?AFI->setVarArgsFrameIndex(MFI->CreateFixedObject(4, ArgOffset, true)); > - ?} > + ?if (isVarArg) > + ? ?VarArgStyleRegisters(CCInfo, DAG, dl, Chain, CCInfo.getNextStackOffset()); > > ? return Chain; > ?} > > Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=129858&r1=129857&r2=129858&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) > +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Apr 20 11:47:52 2011 > @@ -426,6 +426,13 @@ > ? ? ? ? ? ? ? ? ? ? ? ? ? ?DebugLoc dl, SelectionDAG &DAG, > ? ? ? ? ? ? ? ? ? ? ? ? ? ?SmallVectorImpl &InVals) const; > > + ? ?void VarArgStyleRegisters(CCState &CCInfo, SelectionDAG &DAG, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?DebugLoc dl, SDValue &Chain, unsigned ArgOffset) > + ? ? ?const; > + > + ? ?void computeRegArea(CCState &CCInfo, MachineFunction &MF, > + ? ? ? ? ? ? ? ? ? ? ? ?unsigned &VARegSize, unsigned &VARegSaveSize) const; > + > ? ? virtual SDValue > ? ? ? LowerCall(SDValue Chain, SDValue Callee, > ? ? ? ? ? ? ? ? CallingConv::ID CallConv, bool isVarArg, > @@ -437,7 +444,7 @@ > ? ? ? ? ? ? ? ? SmallVectorImpl &InVals) const; > > ? ? /// HandleByVal - Target-specific cleanup for ByVal support. > - ? ?virtual void HandleByVal(CCState *) const; > + ? ?virtual void HandleByVal(CCState *, unsigned &) const; > > ? ? /// IsEligibleForTailCallOptimization - Check whether the call is eligible > ? ? /// for tail call optimization. Targets which want to do tail call > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From echristo at apple.com Wed Apr 20 12:45:11 2011 From: echristo at apple.com (Eric Christopher) Date: Wed, 20 Apr 2011 10:45:11 -0700 Subject: [llvm-commits] [llvm] r129842 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/ARM/umulo-32.ll In-Reply-To: <85DF957B-7C5F-4C9F-BC47-C7C517E339B1@apple.com> References: <20110420011945.CDE012A6C12C@llvm.org> <85DF957B-7C5F-4C9F-BC47-C7C517E339B1@apple.com> Message-ID: <0323ED90-7F4C-4294-AC15-44D3C7B73732@apple.com> On Apr 20, 2011, at 9:36 AM, Chris Lattner wrote: > > On Apr 19, 2011, at 6:19 PM, Eric Christopher wrote: > >> Author: echristo >> Date: Tue Apr 19 20:19:45 2011 >> New Revision: 129842 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=129842&view=rev >> Log: >> Rewrite the expander for umulo/smulo to remember to sign extend the input >> manually and pass all (now) 4 arguments to the mul libcall. Add a new >> ExpandLibCall for just this (copied gratuitously from type legalization). > > Instead of copying the code over, could it be moved someplace common? Maybe become a method on SelectionDAG itself or something. Totally agree. I'll see what I can do. -eric From anton at korobeynikov.info Wed Apr 20 12:59:54 2011 From: anton at korobeynikov.info (Anton Korobeynikov) Date: Wed, 20 Apr 2011 21:59:54 +0400 Subject: [llvm-commits] [llvm] r129858 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h include/llvm/Target/TargetLowering.h lib/CodeGen/CallingConvLower.cpp lib/Target/ARM/ARMCallingConv.td lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMIS Message-ID: Hi Stuart, > +static cl::opt > +UseDivMod("arm-divmod-libcall", cl::Hidden, > + ?cl::desc("Use __{u}divmod libcalls for div / rem pairs"), > + ?cl::init(false)); Are you sure you wanted to commit this hunk? -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University From stuart at apple.com Wed Apr 20 13:11:40 2011 From: stuart at apple.com (Stuart Hastings) Date: Wed, 20 Apr 2011 11:11:40 -0700 Subject: [llvm-commits] [llvm] r129858 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h include/llvm/Target/TargetLowering.h lib/CodeGen/CallingConvLower.cpp lib/Target/ARM/ARMCallingConv.td lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMIS In-Reply-To: References: Message-ID: <83D1D28F-C407-4440-9D67-16DC16050B69@apple.com> On Apr 20, 2011, at 10:59 AM, Anton Korobeynikov wrote: > Hi Stuart, > >> +static cl::opt >> +UseDivMod("arm-divmod-libcall", cl::Hidden, >> + cl::desc("Use __{u}divmod libcalls for div / rem pairs"), >> + cl::init(false)); > Are you sure you wanted to commit this hunk? No. Thank you for pointing this out. stuart From stuart at apple.com Wed Apr 20 13:09:26 2011 From: stuart at apple.com (Stuart Hastings) Date: Wed, 20 Apr 2011 18:09:26 -0000 Subject: [llvm-commits] [llvm] r129862 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <20110420180926.E255E2A6C12C@llvm.org> Author: stuart Date: Wed Apr 20 13:09:26 2011 New Revision: 129862 URL: http://llvm.org/viewvc/llvm-project?rev=129862&view=rev Log: Excise unintended hunk in 129858. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=129862&r1=129861&r2=129862&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Apr 20 13:09:26 2011 @@ -77,11 +77,6 @@ ARM::R0, ARM::R1, ARM::R2, ARM::R3 }; -static cl::opt -UseDivMod("arm-divmod-libcall", cl::Hidden, - cl::desc("Use __{u}divmod libcalls for div / rem pairs"), - cl::init(false)); - void ARMTargetLowering::addTypeForNEON(EVT VT, EVT PromotedLdStVT, EVT PromotedBitwiseVT) { if (VT != PromotedLdStVT) { From stuart at apple.com Wed Apr 20 13:23:23 2011 From: stuart at apple.com (Stuart Hastings) Date: Wed, 20 Apr 2011 11:23:23 -0700 Subject: [llvm-commits] [llvm] r129858 - in /llvm/trunk: include/llvm/CodeGen/CallingConvLower.h include/llvm/Target/TargetLowering.h lib/CodeGen/CallingConvLower.cpp lib/Target/ARM/ARMCallingConv.td lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMIS In-Reply-To: References: Message-ID: On Apr 20, 2011, at 10:21 AM, Eli Friedman wrote: > On Wed, Apr 20, 2011 at 9:47 AM, Stuart Hastings wrote: >> Author: stuart >> Date: Wed Apr 20 11:47:52 2011 >> New Revision: 129858 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=129858&view=rev >> Log: >> ARM byval support. Will be enabled by another patch to the FE. > > Oh, wow; I didn't realize clang was still using my nasty fake-byval hack. :) Honestly, it was a good hack; it's been trouble-free for a long time. Now ARM is trading one hack (yours) for another (byval)! :-) stuart From stoklund at 2pi.dk Wed Apr 20 13:19:48 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 20 Apr 2011 18:19:48 -0000 Subject: [llvm-commits] [llvm] r129864 - in /llvm/trunk: include/llvm/Target/Target.td include/llvm/Target/TargetRegisterInfo.h lib/CodeGen/RegAllocBasic.cpp lib/CodeGen/RegAllocGreedy.cpp lib/Target/ARM/ARMRegisterInfo.td lib/Target/X86/X86RegisterInfo.td utils/TableGen/CodeGenRegisters.h utils/TableGen/CodeGenTarget.cpp utils/TableGen/RegisterInfoEmitter.cpp Message-ID: <20110420181949.040632A6C12C@llvm.org> Author: stoklund Date: Wed Apr 20 13:19:48 2011 New Revision: 129864 URL: http://llvm.org/viewvc/llvm-project?rev=129864&view=rev Log: Prefer cheap registers for busy live ranges. On the x86-64 and thumb2 targets, some registers are more expensive to encode than others in the same register class. Add a CostPerUse field to the TableGen register description, and make it available from TRI->getCostPerUse. This represents the cost of a REX prefix or a 32-bit instruction encoding required by choosing a high register. Teach the greedy register allocator to prefer cheap registers for busy live ranges (as indicated by spill weight). Modified: llvm/trunk/include/llvm/Target/Target.td llvm/trunk/include/llvm/Target/TargetRegisterInfo.h llvm/trunk/lib/CodeGen/RegAllocBasic.cpp llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td llvm/trunk/lib/Target/X86/X86RegisterInfo.td llvm/trunk/utils/TableGen/CodeGenRegisters.h llvm/trunk/utils/TableGen/CodeGenTarget.cpp llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Modified: llvm/trunk/include/llvm/Target/Target.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/Target.td?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/Target.td (original) +++ llvm/trunk/include/llvm/Target/Target.td Wed Apr 20 13:19:48 2011 @@ -78,6 +78,13 @@ // -1 indicates that the gcc number is undefined and -2 that register number // is invalid for this mode/flavour. list DwarfNumbers = []; + + // CostPerUse - Additional cost of instructions using this register compared + // to other registers in its class. The register allocator will try to + // minimize the number of instructions using a register with a CostPerUse. + // This is used by the x86-64 and ARM Thumb targets where some registers + // require larger instruction encodings. + int CostPerUse = 0; } // RegisterWithSubRegs - This can be used to define instances of Register which Modified: llvm/trunk/include/llvm/Target/TargetRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetRegisterInfo.h (original) +++ llvm/trunk/include/llvm/Target/TargetRegisterInfo.h Wed Apr 20 13:19:48 2011 @@ -46,6 +46,7 @@ const unsigned *Overlaps; // Overlapping registers, described above const unsigned *SubRegs; // Sub-register set, described above const unsigned *SuperRegs; // Super-register set, described above + unsigned CostPerUse; // Extra cost of instructions using register. }; class TargetRegisterClass { @@ -426,6 +427,12 @@ return get(RegNo).Name; } + /// getCostPerUse - Return the additional cost of using this register instead + /// of other registers in its class. + unsigned getCostPerUse(unsigned RegNo) const { + return get(RegNo).CostPerUse; + } + /// getNumRegs - Return the number of registers this target has (useful for /// sizing arrays holding per register information) unsigned getNumRegs() const { Modified: llvm/trunk/lib/CodeGen/RegAllocBasic.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBasic.cpp?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocBasic.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocBasic.cpp Wed Apr 20 13:19:48 2011 @@ -278,6 +278,7 @@ << " to " << PrintReg(PhysReg, TRI) << '\n'); assert(!VRM->hasPhys(VirtReg.reg) && "Duplicate VirtReg assignment"); VRM->assignVirt2Phys(VirtReg.reg, PhysReg); + MRI->setPhysRegUsed(PhysReg); PhysReg2LiveUnion[PhysReg].unify(VirtReg); ++NumAssigned; } Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Wed Apr 20 13:19:48 2011 @@ -187,8 +187,10 @@ unsigned nextSplitPoint(unsigned); bool canEvictInterference(LiveInterval&, unsigned, float&); + unsigned tryAssign(LiveInterval&, AllocationOrder&, + SmallVectorImpl&); unsigned tryEvict(LiveInterval&, AllocationOrder&, - SmallVectorImpl&); + SmallVectorImpl&, unsigned = ~0u); unsigned tryRegionSplit(LiveInterval&, AllocationOrder&, SmallVectorImpl&); unsigned tryLocalSplit(LiveInterval&, AllocationOrder&, @@ -334,6 +336,37 @@ return LI; } + +//===----------------------------------------------------------------------===// +// Direct Assignment +//===----------------------------------------------------------------------===// + +/// tryAssign - Try to assign VirtReg to an available register. +unsigned RAGreedy::tryAssign(LiveInterval &VirtReg, + AllocationOrder &Order, + SmallVectorImpl &NewVRegs) { + Order.rewind(); + unsigned PhysReg; + while ((PhysReg = Order.next())) + if (!checkPhysRegInterference(VirtReg, PhysReg)) + break; + if (!PhysReg || Order.isHint(PhysReg)) + return PhysReg; + + // PhysReg is available. Try to evict interference from a cheaper alternative. + unsigned Cost = TRI->getCostPerUse(PhysReg); + + // Most registers have 0 additional cost. + if (!Cost) + return PhysReg; + + DEBUG(dbgs() << PrintReg(PhysReg, TRI) << " is available at cost " << Cost + << '\n'); + unsigned CheapReg = tryEvict(VirtReg, Order, NewVRegs, Cost); + return CheapReg ? CheapReg : PhysReg; +} + + //===----------------------------------------------------------------------===// // Interference eviction //===----------------------------------------------------------------------===// @@ -371,7 +404,8 @@ /// @return Physreg to assign VirtReg, or 0. unsigned RAGreedy::tryEvict(LiveInterval &VirtReg, AllocationOrder &Order, - SmallVectorImpl &NewVRegs){ + SmallVectorImpl &NewVRegs, + unsigned CostPerUseLimit) { NamedRegionTimer T("Evict", TimerGroupName, TimePassesIsEnabled); // Keep track of the lightest single interference seen so far. @@ -380,6 +414,12 @@ Order.rewind(); while (unsigned PhysReg = Order.next()) { + if (TRI->getCostPerUse(PhysReg) >= CostPerUseLimit) + continue; + // The first use of a register in a function has cost 1. + if (CostPerUseLimit == 1 && !MRI->isPhysRegUsed(PhysReg)) + continue; + float Weight = BestWeight; if (!canEvictInterference(VirtReg, PhysReg, Weight)) continue; @@ -1230,10 +1270,8 @@ SmallVectorImpl &NewVRegs) { // First try assigning a free register. AllocationOrder Order(VirtReg.reg, *VRM, ReservedRegs); - while (unsigned PhysReg = Order.next()) { - if (!checkPhysRegInterference(VirtReg, PhysReg)) - return PhysReg; - } + if (unsigned PhysReg = tryAssign(VirtReg, Order, NewVRegs)) + return PhysReg; if (unsigned PhysReg = tryEvict(VirtReg, Order, NewVRegs)) return PhysReg; Modified: llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td (original) +++ llvm/trunk/lib/Target/ARM/ARMRegisterInfo.td Wed Apr 20 13:19:48 2011 @@ -70,6 +70,8 @@ def R5 : ARMReg< 5, "r5">, DwarfRegNum<[5]>; def R6 : ARMReg< 6, "r6">, DwarfRegNum<[6]>; def R7 : ARMReg< 7, "r7">, DwarfRegNum<[7]>; +// These require 32-bit instructions. +let CostPerUse = 1 in { def R8 : ARMReg< 8, "r8">, DwarfRegNum<[8]>; def R9 : ARMReg< 9, "r9">, DwarfRegNum<[9]>; def R10 : ARMReg<10, "r10">, DwarfRegNum<[10]>; @@ -78,6 +80,7 @@ def SP : ARMReg<13, "sp">, DwarfRegNum<[13]>; def LR : ARMReg<14, "lr">, DwarfRegNum<[14]>; def PC : ARMReg<15, "pc">, DwarfRegNum<[15]>; +} // Float registers def S0 : ARMFReg< 0, "s0">; def S1 : ARMFReg< 1, "s1">; Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.td?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.td (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.td Wed Apr 20 13:19:48 2011 @@ -46,7 +46,8 @@ def CL : Register<"cl">, DwarfRegNum<[2, 1, 1]>; def BL : Register<"bl">, DwarfRegNum<[3, 3, 3]>; - // X86-64 only + // X86-64 only, requires REX. + let CostPerUse = 1 in { def SIL : Register<"sil">, DwarfRegNum<[4, 6, 6]>; def DIL : Register<"dil">, DwarfRegNum<[5, 7, 7]>; def BPL : Register<"bpl">, DwarfRegNum<[6, 4, 5]>; @@ -59,6 +60,7 @@ def R13B : Register<"r13b">, DwarfRegNum<[13, -2, -2]>; def R14B : Register<"r14b">, DwarfRegNum<[14, -2, -2]>; def R15B : Register<"r15b">, DwarfRegNum<[15, -2, -2]>; + } // High registers. On x86-64, these cannot be used in any instruction // with a REX prefix. @@ -82,8 +84,8 @@ } def IP : Register<"ip">, DwarfRegNum<[16]>; - // X86-64 only - let SubRegIndices = [sub_8bit] in { + // X86-64 only, requires REX. + let SubRegIndices = [sub_8bit], CostPerUse = 1 in { def R8W : RegisterWithSubRegs<"r8w", [R8B]>, DwarfRegNum<[8, -2, -2]>; def R9W : RegisterWithSubRegs<"r9w", [R9B]>, DwarfRegNum<[9, -2, -2]>; def R10W : RegisterWithSubRegs<"r10w", [R10B]>, DwarfRegNum<[10, -2, -2]>; @@ -105,7 +107,8 @@ def ESP : RegisterWithSubRegs<"esp", [SP]>, DwarfRegNum<[7, 5, 4]>; def EIP : RegisterWithSubRegs<"eip", [IP]>, DwarfRegNum<[16, 8, 8]>; - // X86-64 only + // X86-64 only, requires REX + let CostPerUse = 1 in { def R8D : RegisterWithSubRegs<"r8d", [R8W]>, DwarfRegNum<[8, -2, -2]>; def R9D : RegisterWithSubRegs<"r9d", [R9W]>, DwarfRegNum<[9, -2, -2]>; def R10D : RegisterWithSubRegs<"r10d", [R10W]>, DwarfRegNum<[10, -2, -2]>; @@ -114,7 +117,7 @@ def R13D : RegisterWithSubRegs<"r13d", [R13W]>, DwarfRegNum<[13, -2, -2]>; def R14D : RegisterWithSubRegs<"r14d", [R14W]>, DwarfRegNum<[14, -2, -2]>; def R15D : RegisterWithSubRegs<"r15d", [R15W]>, DwarfRegNum<[15, -2, -2]>; - } + }} // 64-bit registers, X86-64 only let SubRegIndices = [sub_32bit] in { @@ -127,6 +130,8 @@ def RBP : RegisterWithSubRegs<"rbp", [EBP]>, DwarfRegNum<[6, -2, -2]>; def RSP : RegisterWithSubRegs<"rsp", [ESP]>, DwarfRegNum<[7, -2, -2]>; + // These also require REX. + let CostPerUse = 1 in { def R8 : RegisterWithSubRegs<"r8", [R8D]>, DwarfRegNum<[8, -2, -2]>; def R9 : RegisterWithSubRegs<"r9", [R9D]>, DwarfRegNum<[9, -2, -2]>; def R10 : RegisterWithSubRegs<"r10", [R10D]>, DwarfRegNum<[10, -2, -2]>; @@ -136,7 +141,7 @@ def R14 : RegisterWithSubRegs<"r14", [R14D]>, DwarfRegNum<[14, -2, -2]>; def R15 : RegisterWithSubRegs<"r15", [R15D]>, DwarfRegNum<[15, -2, -2]>; def RIP : RegisterWithSubRegs<"rip", [EIP]>, DwarfRegNum<[16, -2, -2]>; - } + }} // MMX Registers. These are actually aliased to ST0 .. ST7 def MM0 : Register<"mm0">, DwarfRegNum<[41, 29, 29]>; @@ -170,6 +175,7 @@ def XMM7: Register<"xmm7">, DwarfRegNum<[24, 28, 28]>; // X86-64 only + let CostPerUse = 1 in { def XMM8: Register<"xmm8">, DwarfRegNum<[25, -2, -2]>; def XMM9: Register<"xmm9">, DwarfRegNum<[26, -2, -2]>; def XMM10: Register<"xmm10">, DwarfRegNum<[27, -2, -2]>; @@ -178,7 +184,7 @@ def XMM13: Register<"xmm13">, DwarfRegNum<[30, -2, -2]>; def XMM14: Register<"xmm14">, DwarfRegNum<[31, -2, -2]>; def XMM15: Register<"xmm15">, DwarfRegNum<[32, -2, -2]>; - } + }} // YMM Registers, used by AVX instructions let SubRegIndices = [sub_xmm] in { Modified: llvm/trunk/utils/TableGen/CodeGenRegisters.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenRegisters.h?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenRegisters.h (original) +++ llvm/trunk/utils/TableGen/CodeGenRegisters.h Wed Apr 20 13:19:48 2011 @@ -31,6 +31,7 @@ const std::string &getName() const; unsigned DeclaredSpillSize, DeclaredSpillAlignment; unsigned EnumValue; + unsigned CostPerUse; CodeGenRegister(Record *R); }; Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original) +++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Wed Apr 20 13:19:48 2011 @@ -172,6 +172,7 @@ CodeGenRegister::CodeGenRegister(Record *R) : TheDef(R) { DeclaredSpillSize = R->getValueAsInt("SpillSize"); DeclaredSpillAlignment = R->getValueAsInt("SpillAlignment"); + CostPerUse = R->getValueAsInt("CostPerUse"); } const std::string &CodeGenRegister::getName() const { Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=129864&r1=129863&r2=129864&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Wed Apr 20 13:19:48 2011 @@ -841,7 +841,7 @@ } OS<<"\n const TargetRegisterDesc RegisterDescriptors[] = { // Descriptors\n"; - OS << " { \"NOREG\",\t0,\t0,\t0 },\n"; + OS << " { \"NOREG\",\t0,\t0,\t0,\t0 },\n"; // Now that register alias and sub-registers sets have been emitted, emit the // register descriptors now. @@ -854,9 +854,10 @@ else OS << "Empty_SubRegsSet,\t"; if (!RegisterSuperRegs[Reg.TheDef].empty()) - OS << Reg.getName() << "_SuperRegsSet },\n"; + OS << Reg.getName() << "_SuperRegsSet,\t"; else - OS << "Empty_SuperRegsSet },\n"; + OS << "Empty_SuperRegsSet,\t"; + OS << Reg.CostPerUse << " },\n"; } OS << " };\n"; // End of register descriptors... From eli.friedman at gmail.com Wed Apr 20 14:00:08 2011 From: eli.friedman at gmail.com (Eli Friedman) Date: Wed, 20 Apr 2011 19:00:08 -0000 Subject: [llvm-commits] [llvm] r129869 - /llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h Message-ID: <20110420190008.3D8DF2A6C12C@llvm.org> Author: efriedma Date: Wed Apr 20 14:00:08 2011 New Revision: 129869 URL: http://llvm.org/viewvc/llvm-project?rev=129869&view=rev Log: Revert r129846; it's breaking a buildbot. See http://google1.osuosl.org:8011/builders/llvm-x86_64-linux-checks/builds/825/steps/test.llvm.stage2/logs/st.ll Modified: llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h Modified: llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h?rev=129869&r1=129868&r2=129869&view=diff ============================================================================== --- llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h (original) +++ llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h Wed Apr 20 14:00:08 2011 @@ -42,6 +42,7 @@ void setRetReg(unsigned reg) { reg_ret = reg; } void doneAddArg(void) { + std::sort(reg_arg.begin(), reg_arg.end()); _isDoneAddArg = true; } void doneAddLocalVar(void) { From eli.friedman at gmail.com Wed Apr 20 14:05:45 2011 From: eli.friedman at gmail.com (Eli Friedman) Date: Wed, 20 Apr 2011 12:05:45 -0700 Subject: [llvm-commits] [llvm] r129846 - /llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h In-Reply-To: <20110420092719.BAA722A6C12C@llvm.org> References: <20110420092719.BAA722A6C12C@llvm.org> Message-ID: On Wed, Apr 20, 2011 at 2:27 AM, Che-Liang Chiou wrote: > Author: clchiou > Date: Wed Apr 20 04:27:19 2011 > New Revision: 129846 > > URL: http://llvm.org/viewvc/llvm-project?rev=129846&view=rev > Log: > ptx: fix parameter ordering > > Patched by Dan Bailey I reverted this because it was breaking the llvm-x86_64-linux-checks buildbot; see http://google1.osuosl.org:8011/builders/llvm-x86_64-linux-checks/builds/825/steps/test.llvm.stage2/logs/st.ll . -Eli > Modified: > ? ?llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h > > Modified: llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h?rev=129846&r1=129845&r2=129846&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h (original) > +++ llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h Wed Apr 20 04:27:19 2011 > @@ -42,7 +42,6 @@ > ? void setRetReg(unsigned reg) { reg_ret = reg; } > > ? void doneAddArg(void) { > - ? ?std::sort(reg_arg.begin(), reg_arg.end()); > ? ? _isDoneAddArg = true; > ? } > ? void doneAddLocalVar(void) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From justin.holewinski at gmail.com Wed Apr 20 14:44:02 2011 From: justin.holewinski at gmail.com (Justin Holewinski) Date: Wed, 20 Apr 2011 15:44:02 -0400 Subject: [llvm-commits] Fwd: [llvm] r129846 - /llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h In-Reply-To: References: <20110420092719.BAA722A6C12C@llvm.org> Message-ID: Forwarding to author. ---------- Forwarded message ---------- From: Eli Friedman Date: Wed, Apr 20, 2011 at 3:05 PM Subject: Re: [llvm-commits] [llvm] r129846 - /llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h To: Che-Liang Chiou Cc: llvm-commits at cs.uiuc.edu On Wed, Apr 20, 2011 at 2:27 AM, Che-Liang Chiou wrote: > Author: clchiou > Date: Wed Apr 20 04:27:19 2011 > New Revision: 129846 > > URL: http://llvm.org/viewvc/llvm-project?rev=129846&view=rev > Log: > ptx: fix parameter ordering > > Patched by Dan Bailey I reverted this because it was breaking the llvm-x86_64-linux-checks buildbot; see http://google1.osuosl.org:8011/builders/llvm-x86_64-linux-checks/builds/825/steps/test.llvm.stage2/logs/st.ll . -Eli > Modified: > llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h > > Modified: llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h?rev=129846&r1=129845&r2=129846&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h (original) > +++ llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h Wed Apr 20 04:27:19 2011 > @@ -42,7 +42,6 @@ > void setRetReg(unsigned reg) { reg_ret = reg; } > > void doneAddArg(void) { > - std::sort(reg_arg.begin(), reg_arg.end()); > _isDoneAddArg = true; > } > void doneAddLocalVar(void) { > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > _______________________________________________ llvm-commits mailing list llvm-commits at cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -- Thanks, Justin Holewinski -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20110420/c6565e08/attachment.html From daniel at zuster.org Wed Apr 20 16:40:37 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 20 Apr 2011 21:40:37 -0000 Subject: [llvm-commits] [compiler-rt] r129873 - /compiler-rt/trunk/make/platform/clang_darwin.mk Message-ID: <20110420214037.65AC22A6C12C@llvm.org> Author: ddunbar Date: Wed Apr 20 16:40:37 2011 New Revision: 129873 URL: http://llvm.org/viewvc/llvm-project?rev=129873&view=rev Log: clang_darwin: Always set deployment targets when building compiler-rt bits, so that we don't have a hidden dependency on possible deployment target environment overrides. - Also, add support for an ARM_SDK build variable which points to the isysroot to use for ARM bits. Modified: compiler-rt/trunk/make/platform/clang_darwin.mk Modified: compiler-rt/trunk/make/platform/clang_darwin.mk URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_darwin.mk?rev=129873&r1=129872&r2=129873&view=diff ============================================================================== --- compiler-rt/trunk/make/platform/clang_darwin.mk (original) +++ compiler-rt/trunk/make/platform/clang_darwin.mk Wed Apr 20 16:40:37 2011 @@ -41,6 +41,26 @@ CFLAGS := -Wall -Werror -O3 -fomit-frame-pointer +# Always set deployment target arguments for every build, these libraries should +# never depend on the environmental overrides. We simply set them to minimum +# supported deployment target -- nothing in the compiler-rt libraries should +# actually depend on the deployment target. +X86_DEPLOYMENT_ARGS := -mmacosx-version-min=10.4 +ARM_DEPLOYMENT_ARGS := -miphoneos-version-min=1.0 + +# If an explicit ARM_SDK build variable is set, use that as the isysroot. +ifneq ($(ARM_SDK),) +ARM_DEPLOYMENT_ARGS += -isysroot $(ARM_SDK) +endif + +CFLAGS.eprintf := $(CFLAGS) $(X86_DEPLOYMENT_ARGS) +CFLAGS.10.4 := $(CFLAGS) $(X86_DEPLOYMENT_ARGS) +CFLAGS.ios := $(CFLAGS) $(ARM_DEPLOYMENT_ARGS) +CFLAGS.cc_kext.i386 := $(CFLAGS) $(X86_DEPLOYMENT_ARGS) +CFLAGS.cc_kext.x86_64 := $(CFLAGS) $(X86_DEPLOYMENT_ARGS) +CFLAGS.cc_kext.armv6 := $(CFLAGS) $(ARM_DEPLOYMENT_ARGS) -mthumb +CFLAGS.cc_kext.armv7 := $(CFLAGS) $(ARM_DEPLOYMENT_ARGS) -mthumb + FUNCTIONS.eprintf := eprintf FUNCTIONS.10.4 := eprintf floatundidf floatundisf floatundixf @@ -162,9 +182,6 @@ FUNCTIONS.cc_kext.armv6 := $(CCKEXT_ARM_FUNCTIONS) FUNCTIONS.cc_kext.armv7 := $(CCKEXT_ARM_FUNCTIONS) -CFLAGS.cc_kext.armv6 := $(CFLAGS) -mthumb -CFLAGS.cc_kext.armv7 := $(CFLAGS) -mthumb - CCKEXT_X86_FUNCTIONS := $(CCKEXT_COMMON_FUNCTIONS) \ divxc3 \ fixunsxfdi \ From daniel at zuster.org Wed Apr 20 16:40:40 2011 From: daniel at zuster.org (Daniel Dunbar) Date: Wed, 20 Apr 2011 21:40:40 -0000 Subject: [llvm-commits] [compiler-rt] r129874 - /compiler-rt/trunk/make/platform/clang_darwin.mk Message-ID: <20110420214040.8C0DC2A6C12D@llvm.org> Author: ddunbar Date: Wed Apr 20 16:40:40 2011 New Revision: 129874 URL: http://llvm.org/viewvc/llvm-project?rev=129874&view=rev Log: clang_darwin: Add divmod functions to cc_kext library. Modified: compiler-rt/trunk/make/platform/clang_darwin.mk Modified: compiler-rt/trunk/make/platform/clang_darwin.mk URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_darwin.mk?rev=129874&r1=129873&r2=129874&view=diff ============================================================================== --- compiler-rt/trunk/make/platform/clang_darwin.mk (original) +++ compiler-rt/trunk/make/platform/clang_darwin.mk Wed Apr 20 16:40:40 2011 @@ -87,6 +87,8 @@ divdc3 \ divdi3 \ divsc3 \ + divmodsi4 \ + udivmodsi4 \ do_global_dtors \ eprintf \ ffsdi2 \ From stuart at apple.com Wed Apr 20 16:47:45 2011 From: stuart at apple.com (Stuart Hastings) Date: Wed, 20 Apr 2011 21:47:45 -0000 Subject: [llvm-commits] [llvm] r129875 - /llvm/trunk/test/CodeGen/Generic/2010-11-04-BigByval.ll Message-ID: <20110420214746.0681E2A6C12C@llvm.org> Author: stuart Date: Wed Apr 20 16:47:45 2011 New Revision: 129875 URL: http://llvm.org/viewvc/llvm-project?rev=129875&view=rev Log: Un-XFAIL this test for ARM. Modified: llvm/trunk/test/CodeGen/Generic/2010-11-04-BigByval.ll Modified: llvm/trunk/test/CodeGen/Generic/2010-11-04-BigByval.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/2010-11-04-BigByval.ll?rev=129875&r1=129874&r2=129875&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/Generic/2010-11-04-BigByval.ll (original) +++ llvm/trunk/test/CodeGen/Generic/2010-11-04-BigByval.ll Wed Apr 20 16:47:45 2011 @@ -1,6 +1,5 @@ ; RUN: llc < %s ; PR7170 -; XFAIL: arm %big = type [131072 x i8] From zwarich at apple.com Wed Apr 20 16:48:16 2011 From: zwarich at apple.com (Cameron Zwarich) Date: Wed, 20 Apr 2011 21:48:16 -0000 Subject: [llvm-commits] [llvm] r129876 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <20110420214816.F21AB2A6C12C@llvm.org> Author: zwarich Date: Wed Apr 20 16:48:16 2011 New Revision: 129876 URL: http://llvm.org/viewvc/llvm-project?rev=129876&view=rev Log: Cleanup some code to better use an early return style in preparation for adding more cases. Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=129876&r1=129875&r2=129876&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Apr 20 16:48:16 2011 @@ -337,16 +337,20 @@ unsigned EltSize = In->getPrimitiveSizeInBits()/8; if (IsLoadOrStore && EltSize == AllocaSize) return; + // If we're accessing something that could be an element of a vector, see // if the implied vector agrees with what we already have and if Offset is // compatible with it. - if (Offset % EltSize == 0 && AllocaSize % EltSize == 0 && - (VectorTy == 0 || - cast(VectorTy)->getElementType() - ->getPrimitiveSizeInBits()/8 == EltSize)) { - if (VectorTy == 0) + if (Offset % EltSize == 0 && AllocaSize % EltSize == 0) { + if (!VectorTy) { VectorTy = VectorType::get(In, AllocaSize/EltSize); - return; + return; + } + + unsigned CurrentEltSize = cast(VectorTy)->getElementType() + ->getPrimitiveSizeInBits()/8; + if (EltSize == CurrentEltSize) + return; } } From zwarich at apple.com Wed Apr 20 16:48:35 2011 From: zwarich at apple.com (Cameron Zwarich) Date: Wed, 20 Apr 2011 21:48:35 -0000 Subject: [llvm-commits] [llvm] r129877 - /llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Message-ID: <20110420214835.1F4D42A6C12C@llvm.org> Author: zwarich Date: Wed Apr 20 16:48:34 2011 New Revision: 129877 URL: http://llvm.org/viewvc/llvm-project?rev=129877&view=rev Log: The bitcast case here is actually handled uniformly earlier in the function, so delete it. Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=129877&r1=129876&r2=129877&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Apr 20 16:48:34 2011 @@ -914,18 +914,13 @@ return Builder.CreateBitCast(Insert, AllocaType, "tmp"); } - uint64_t EltSize = TD.getTypeAllocSizeInBits(VTy->getElementType()); - // Must be an element insertion. + assert(SV->getType() == VTy->getElementType()); + uint64_t EltSize = TD.getTypeAllocSizeInBits(VTy->getElementType()); unsigned Elt = Offset/EltSize; - - if (SV->getType() != VTy->getElementType()) - SV = Builder.CreateBitCast(SV, VTy->getElementType(), "tmp"); - - SV = Builder.CreateInsertElement(Old, SV, + return Builder.CreateInsertElement(Old, SV, ConstantInt::get(Type::getInt32Ty(SV->getContext()), Elt), "tmp"); - return SV; } // If SV is a first-class aggregate value, insert each value recursively. From zwarich at apple.com Wed Apr 20 16:48:38 2011 From: zwarich at apple.com (Cameron Zwarich) Date: Wed, 20 Apr 2011 21:48:38 -0000 Subject: [llvm-commits] [llvm] r129878 - in /llvm/trunk: lib/Transforms/Scalar/ScalarReplAggregates.cpp test/Transforms/ScalarRepl/vector_promote.ll Message-ID: <20110420214838.BE4A02A6C12D@llvm.org> Author: zwarich Date: Wed Apr 20 16:48:38 2011 New Revision: 129878 URL: http://llvm.org/viewvc/llvm-project?rev=129878&view=rev Log: Fix another case of that only occurs with code generated by llvm-gcc, since llvm-gcc uses 2 i64s for passing a 4 x float vector on ARM rather than an i64 array like Clang. Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp llvm/trunk/test/Transforms/ScalarRepl/vector_promote.ll Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=129878&r1=129877&r2=129878&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Apr 20 16:48:38 2011 @@ -351,6 +351,9 @@ ->getPrimitiveSizeInBits()/8; if (EltSize == CurrentEltSize) return; + + if (In->isIntegerTy() && isPowerOf2_32(AllocaSize / EltSize)) + return; } } @@ -661,23 +664,30 @@ } /// getScaledElementType - Gets a scaled element type for a partial vector -/// access of an alloca. The input type must be an integer or float, and -/// the resulting type must be an integer, float or double. -static const Type *getScaledElementType(const Type *OldTy, +/// access of an alloca. The input types must be integer or floating-point +/// scalar or vector types, and the resulting type is an integer, float or +/// double. +static const Type *getScaledElementType(const Type *Ty1, const Type *Ty2, unsigned NewBitWidth) { - assert((OldTy->isIntegerTy() || OldTy->isFloatTy()) && "Partial vector " - "accesses must be scaled from integer or float elements."); - - LLVMContext &Context = OldTy->getContext(); - - if (OldTy->isIntegerTy()) - return Type::getIntNTy(Context, NewBitWidth); - if (NewBitWidth == 32) - return Type::getFloatTy(Context); - if (NewBitWidth == 64) - return Type::getDoubleTy(Context); + bool IsFP1 = Ty1->isFloatingPointTy() || + (Ty1->isVectorTy() && + cast(Ty1)->getElementType()->isFloatingPointTy()); + bool IsFP2 = Ty2->isFloatingPointTy() || + (Ty2->isVectorTy() && + cast(Ty2)->getElementType()->isFloatingPointTy()); + + LLVMContext &Context = Ty1->getContext(); + + // Prefer floating-point types over integer types, as integer types may have + // been created by earlier scalar replacement. + if (IsFP1 || IsFP2) { + if (NewBitWidth == 32) + return Type::getFloatTy(Context); + if (NewBitWidth == 64) + return Type::getDoubleTy(Context); + } - llvm_unreachable("Invalid type for a partial vector access of an alloca!"); + return Type::getIntNTy(Context, NewBitWidth); } /// CreateShuffleVectorCast - Creates a shuffle vector to convert one vector @@ -744,15 +754,11 @@ return CreateShuffleVectorCast(FromVal, ToType, Builder); } - if (ToType->isVectorTy()) { - assert(isPowerOf2_64(AllocaSize / ToTypeSize) && - "Partial vector access of an alloca must have a power-of-2 size " - "ratio."); - assert(Offset == 0 && "Can't extract a value of a smaller vector type " - "from a nonzero offset."); + if (isPowerOf2_64(AllocaSize / ToTypeSize)) { + assert(!(ToType->isVectorTy() && Offset != 0) && "Can't extract a value " + "of a smaller vector type at a nonzero offset."); - const Type *ToElementTy = cast(ToType)->getElementType(); - const Type *CastElementTy = getScaledElementType(ToElementTy, + const Type *CastElementTy = getScaledElementType(FromType, ToType, ToTypeSize * 8); unsigned NumCastVectorElements = AllocaSize / ToTypeSize; @@ -760,8 +766,12 @@ const Type *CastTy = VectorType::get(CastElementTy, NumCastVectorElements); Value *Cast = Builder.CreateBitCast(FromVal, CastTy, "tmp"); + + unsigned EltSize = TD.getTypeAllocSizeInBits(CastElementTy); + unsigned Elt = Offset/EltSize; + assert(EltSize*Elt == Offset && "Invalid modulus in validity checking"); Value *Extract = Builder.CreateExtractElement(Cast, ConstantInt::get( - Type::getInt32Ty(Context), 0), "tmp"); + Type::getInt32Ty(Context), Elt), "tmp"); return Builder.CreateBitCast(Extract, ToType, "tmp"); } @@ -893,13 +903,12 @@ return CreateShuffleVectorCast(SV, VTy, Builder); } - if (SV->getType()->isVectorTy() && isPowerOf2_64(VecSize / ValSize)) { - assert(Offset == 0 && "Can't insert a value of a smaller vector type at " - "a nonzero offset."); - - const Type *ToElementTy = - cast(SV->getType())->getElementType(); - const Type *CastElementTy = getScaledElementType(ToElementTy, ValSize); + if (isPowerOf2_64(VecSize / ValSize)) { + assert(!(SV->getType()->isVectorTy() && Offset != 0) && "Can't insert a " + "value of a smaller vector type at a nonzero offset."); + + const Type *CastElementTy = getScaledElementType(VTy, SV->getType(), + ValSize); unsigned NumCastVectorElements = VecSize / ValSize; LLVMContext &Context = SV->getContext(); @@ -908,9 +917,13 @@ Value *OldCast = Builder.CreateBitCast(Old, OldCastTy, "tmp"); Value *SVCast = Builder.CreateBitCast(SV, CastElementTy, "tmp"); + + unsigned EltSize = TD.getTypeAllocSizeInBits(CastElementTy); + unsigned Elt = Offset/EltSize; + assert(EltSize*Elt == Offset && "Invalid modulus in validity checking"); Value *Insert = Builder.CreateInsertElement(OldCast, SVCast, ConstantInt::get( - Type::getInt32Ty(Context), 0), "tmp"); + Type::getInt32Ty(Context), Elt), "tmp"); return Builder.CreateBitCast(Insert, AllocaType, "tmp"); } Modified: llvm/trunk/test/Transforms/ScalarRepl/vector_promote.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ScalarRepl/vector_promote.ll?rev=129878&r1=129877&r2=129878&view=diff ============================================================================== --- llvm/trunk/test/Transforms/ScalarRepl/vector_promote.ll (original) +++ llvm/trunk/test/Transforms/ScalarRepl/vector_promote.ll Wed Apr 20 16:48:38 2011 @@ -248,3 +248,18 @@ ; CHECK: shufflevector <4 x i64> %tmpV2, <4 x i64> undef, <3 x i32> } +define <4 x float> @test16(<4 x float> %x, i64 %y0, i64 %y1) { +entry: + %tmp8 = bitcast <4 x float> undef to <2 x double> + %tmp9 = bitcast i64 %y0 to double + %tmp10 = insertelement <2 x double> %tmp8, double %tmp9, i32 0 + %tmp11 = bitcast <2 x double> %tmp10 to <4 x float> + %tmp3 = bitcast <4 x float> %tmp11 to <2 x double> + %tmp4 = bitcast i64 %y1 to double + %tmp5 = insertelement <2 x double> %tmp3, double %tmp4, i32 1 + %tmp6 = bitcast <2 x double> %tmp5 to <4 x float> + ret <4 x float> %tmp6 +; CHECK: @test16 +; CHECK-NOT: alloca +; CHECK: bitcast <4 x float> %tmp11 to <2 x double> +} From stoklund at 2pi.dk Wed Apr 20 17:14:17 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 20 Apr 2011 22:14:17 -0000 Subject: [llvm-commits] [llvm] r129882 - /llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Message-ID: <20110420221417.AB33F2A6C12C@llvm.org> Author: stoklund Date: Wed Apr 20 17:14:17 2011 New Revision: 129882 URL: http://llvm.org/viewvc/llvm-project?rev=129882&view=rev Log: Permit remat when a virtual register has multiple defs. TII::isTriviallyReMaterializable() shouldn't depend on any properties of the register being defined by the instruction. Rematerialization is going to create a new virtual register anyway. Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Modified: llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp?rev=129882&r1=129881&r2=129882&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp (original) +++ llvm/trunk/lib/CodeGen/TargetInstrInfoImpl.cpp Wed Apr 20 17:14:17 2011 @@ -388,11 +388,6 @@ if (MO.isDef() != (i == 0)) return false; - // For the def, it should be the only def of that register. - if (MO.isDef() && (llvm::next(MRI.def_begin(Reg)) != MRI.def_end() || - MRI.isLiveIn(Reg))) - return false; - // Don't allow any virtual-register uses. Rematting an instruction with // virtual register uses would length the live ranges of the uses, which // is not necessarily a good idea, certainly not "trivial". From stoklund at 2pi.dk Wed Apr 20 17:14:20 2011 From: stoklund at 2pi.dk (Jakob Stoklund Olesen) Date: Wed, 20 Apr 2011 22:14:20 -0000 Subject: [llvm-commits] [llvm] r129883 - in /llvm/trunk/lib/CodeGen: InlineSpiller.cpp LiveRangeEdit.cpp LiveRangeEdit.h Message-ID: <20110420221420.3D5EC2A6C12D@llvm.org> Author: stoklund Date: Wed Apr 20 17:14:20 2011 New Revision: 129883 URL: http://llvm.org/viewvc/llvm-project?rev=129883&view=rev Log: Add debug output for rematerializable instructions. Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp llvm/trunk/lib/CodeGen/LiveRangeEdit.h Modified: llvm/trunk/lib/CodeGen/InlineSpiller.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/InlineSpiller.cpp?rev=129883&r1=129882&r2=129883&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/InlineSpiller.cpp (original) +++ llvm/trunk/lib/CodeGen/InlineSpiller.cpp Wed Apr 20 17:14:20 2011 @@ -420,8 +420,10 @@ } if (!DefMI && !VNI->isPHIDef()) DefMI = LIS.getInstructionFromIndex(VNI->def); - if (DefMI) - Edit->checkRematerializable(VNI, DefMI, TII, AA); + if (DefMI && Edit->checkRematerializable(VNI, DefMI, TII, AA)) { + DEBUG(dbgs() << "Value " << PrintReg(Reg) << ':' << VNI->id << '@' + << VNI->def << " may remat from " << *DefMI); + } } } } Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp?rev=129883&r1=129882&r2=129883&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp (original) +++ llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp Wed Apr 20 17:14:20 2011 @@ -36,14 +36,16 @@ return LI; } -void LiveRangeEdit::checkRematerializable(VNInfo *VNI, +bool LiveRangeEdit::checkRematerializable(VNInfo *VNI, const MachineInstr *DefMI, const TargetInstrInfo &tii, AliasAnalysis *aa) { assert(DefMI && "Missing instruction"); - if (tii.isTriviallyReMaterializable(DefMI, aa)) - remattable_.insert(VNI); scannedRemattable_ = true; + if (!tii.isTriviallyReMaterializable(DefMI, aa)) + return false; + remattable_.insert(VNI); + return true; } void LiveRangeEdit::scanRemattable(LiveIntervals &lis, Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.h?rev=129883&r1=129882&r2=129883&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/LiveRangeEdit.h (original) +++ llvm/trunk/lib/CodeGen/LiveRangeEdit.h Wed Apr 20 17:14:20 2011 @@ -137,7 +137,7 @@ /// checkRematerializable - Manually add VNI to the list of rematerializable /// values if DefMI may be rematerializable. - void checkRematerializable(VNInfo *VNI, const MachineInstr *DefMI, + bool checkRematerializable(VNInfo *VNI, const MachineInstr *DefMI, const TargetInstrInfo&, AliasAnalysis*); /// Remat - Information needed to rematerialize at a specific location. From evan.cheng at apple.com Wed Apr 20 17:20:13 2011 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 20 Apr 2011 22:20:13 -0000 Subject: [llvm-commits] [llvm] r129884 - in /llvm/trunk: include/llvm/Target/TargetOptions.h lib/Target/ARM/ARMISelLowering.cpp lib/Target/ARM/ARMSubtarget.h lib/Target/TargetMachine.cpp test/CodeGen/ARM/divmod.ll Message-ID: <20110420222013.2A9562A6C12C@llvm.org> Author: evancheng Date: Wed Apr 20 17:20:12 2011 New Revision: 129884 URL: http://llvm.org/viewvc/llvm-project?rev=129884&view=rev Log: Remove -use-divmod-libcall. Let targets opt in when they are available. Modified: llvm/trunk/include/llvm/Target/TargetOptions.h llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMSubtarget.h llvm/trunk/lib/Target/TargetMachine.cpp llvm/trunk/test/CodeGen/ARM/divmod.ll Modified: llvm/trunk/include/llvm/Target/TargetOptions.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=129884&r1=129883&r2=129884&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetOptions.h (original) +++ llvm/trunk/include/llvm/Target/TargetOptions.h Wed Apr 20 17:20:12 2011 @@ -157,10 +157,6 @@ /// wth earlier copy coalescing. extern bool StrongPHIElim; - /// HasDivModLibcall - This flag indicates whether the target compiler - /// runtime library has integer divmod libcalls. - extern bool HasDivModLibcall; - /// getTrapFunctionName - If this returns a non-empty string, this means isel /// should lower Intrinsic::trap to a call to the specified function name /// instead of an ISD::TRAP node. Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=129884&r1=129883&r2=129884&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Apr 20 17:20:12 2011 @@ -398,7 +398,8 @@ setLibcallCallingConv(RTLIB::UDIV_I32, CallingConv::ARM_AAPCS); } - if (HasDivModLibcall) { + // Use divmod iOS compiler-rt calls. + if (Subtarget->getTargetTriple().getOS() == Triple::IOS) { setLibcallName(RTLIB::SDIVREM_I32, "__divmodsi4"); setLibcallName(RTLIB::UDIVREM_I32, "__udivmodsi4"); } Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.h?rev=129884&r1=129883&r2=129884&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMSubtarget.h (original) +++ llvm/trunk/lib/Target/ARM/ARMSubtarget.h Wed Apr 20 17:20:12 2011 @@ -201,6 +201,8 @@ bool hasFP16() const { return HasFP16; } bool hasD16() const { return HasD16; } + const Triple &getTargetTriple() const { return TargetTriple; } + bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); } bool isTargetELF() const { return !isTargetDarwin(); } Modified: llvm/trunk/lib/Target/TargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachine.cpp?rev=129884&r1=129883&r2=129884&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetMachine.cpp (original) +++ llvm/trunk/lib/Target/TargetMachine.cpp Wed Apr 20 17:20:12 2011 @@ -206,11 +206,6 @@ cl::desc("Use strong PHI elimination."), cl::location(StrongPHIElim), cl::init(false)); -static cl::opt -UseDivMod("use-divmod-libcall", - cl::desc("Use __{u}divmod libcalls for div / rem pairs"), - cl::location(HasDivModLibcall), - cl::init(false)); static cl::opt TrapFuncName("trap-func", cl::Hidden, cl::desc("Emit a call to trap function rather than a trap instruction"), Modified: llvm/trunk/test/CodeGen/ARM/divmod.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/divmod.ll?rev=129884&r1=129883&r2=129884&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/ARM/divmod.ll (original) +++ llvm/trunk/test/CodeGen/ARM/divmod.ll Wed Apr 20 17:20:12 2011 @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=arm-apple-darwin -use-divmod-libcall | FileCheck %s +; RUN: llc < %s -mtriple=arm-apple-ios | FileCheck %s define void @foo(i32 %x, i32 %y, i32* nocapture %P) nounwind ssp { entry: From nicholas at mxc.ca Wed Apr 20 17:52:37 2011 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 20 Apr 2011 22:52:37 -0000 Subject: [llvm-commits] [llvm] r129888 - /llvm/trunk/lib/VMCore/Core.cpp Message-ID: <20110420225237.CD9FE2A6C12C@llvm.org> Author: nicholas Date: Wed Apr 20 17:52:37 2011 New Revision: 129888 URL: http://llvm.org/viewvc/llvm-project?rev=129888&view=rev Log: Structs have elements not parameters. I'm surprised this ever compiled... Modified: llvm/trunk/lib/VMCore/Core.cpp Modified: llvm/trunk/lib/VMCore/Core.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=129888&r1=129887&r2=129888&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Core.cpp (original) +++ llvm/trunk/lib/VMCore/Core.cpp Wed Apr 20 17:52:37 2011 @@ -335,7 +335,7 @@ void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest) { StructType *Ty = unwrap(StructTy); - for (FunctionType::param_iterator I = Ty->element_begin(), + for (StructType::element_iterator I = Ty->element_begin(), E = Ty->element_end(); I != E; ++I) *Dest++ = wrap(*I); } From echristo at apple.com Wed Apr 20 18:36:53 2011 From: echristo at apple.com (Eric Christopher) Date: Wed, 20 Apr 2011 23:36:53 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r129893 - /llvm-gcc-4.2/trunk/gcc/config/darwin.c Message-ID: <20110420233653.DE8B82A6C12C@llvm.org> Author: echristo Date: Wed Apr 20 18:36:53 2011 New Revision: 129893 URL: http://llvm.org/viewvc/llvm-project?rev=129893&view=rev Log: Rewrite darwin_llvm_override_target_version to use the new triples and rewrite old triples to be either ios or macosx depending on the target. Fixes rdar://9145520 Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=129893&r1=129892&r2=129893&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Wed Apr 20 18:36:53 2011 @@ -2789,59 +2789,50 @@ /* LLVM LOCAL begin radar 6230142 */ unsigned darwin_llvm_override_target_version(const char *triple, char **new_triple) { - int len = 0, pad1 = 0, pad2 = 0, version = 0; + int os_len = 0, base_len = 0, version = 0; + int isDarwin = 0, isIOS = 0, isOSX = 0; char *substr; - - if (!darwin_macosx_version_min) - return 0; - + /* Triple string is expected to look something like 'i386-*-darwin?' or - 'i386-*-darwin9.5.0' */ - substr = strstr(triple, "darwin"); - if (!substr) + 'i386-*-darwin9.5.0' or substituting ios or macosx for the darwin. */ + if ((substr = strstr (triple, "darwin")) != 0) + isDarwin = 1; + else if ((substr = strstr (triple, "ios")) != 0) + isIOS = 1; + else if ((substr = strstr (triple, "macosx")) != 0) + isOSX = 1; + else return 0; - len = substr + 6 - triple; - - /* llvm-gcc doesn't support pre-10.0 systems. */ + + /* llvm-gcc doesn't support pre-10.0 macosx systems. */ version = strverscmp (darwin_macosx_version_min, "10.0"); if (version < 0) return 0; - /* 10.0 is darwin4. */ - version += 4; - - /* Darwin version number will be 2 digits for 10.6 and up. */ - if (version >= 10) - pad1 = 1; - - /* If darwin_macosx_version_min is something like 10.4.9, we need to append - the .9 to the new triple. */ - substr = strchr(darwin_macosx_version_min, '.'); - if (!substr) - return 0; - substr = strchr(substr+1, '.'); - if (substr) - pad2 = strlen(substr); - - *new_triple = ggc_alloc (len+pad1+pad2+1); - strncpy (*new_triple, triple, len); - if (version >= 10) - { - (*new_triple)[len] = '1'; - version -= 10; - ++len; - } - (*new_triple)[len] = '0' + version; - if (substr) - { - int i; - for (i = 0; i < pad2; ++i) - (*new_triple)[len+1+i] = substr[i]; - len += pad2; - } - (*new_triple)[len+1] = '\0'; + base_len = substr - triple; + if ((isIOS || isDarwin) && darwin_iphoneos_version_min) { + os_len = strlen(darwin_iphoneos_version_min) + strlen("ios"); + *new_triple = ggc_alloc(base_len + os_len + 1); + strncpy(*new_triple, triple, base_len); + strncpy(*new_triple + base_len, "ios", strlen("ios")); + strncpy(*new_triple + base_len + strlen ("ios"), + darwin_iphoneos_version_min, + strlen(darwin_iphoneos_version_min)); + (*new_triple)[base_len+os_len+1] = '\0'; + return 1; + } else if ((isOSX || isDarwin) && darwin_macosx_version_min) { + os_len = strlen(darwin_macosx_version_min) + strlen("macosx"); + *new_triple = ggc_alloc(base_len + os_len + 1); + strncpy(*new_triple, triple, base_len); + strncpy(*new_triple + base_len, "macosx", strlen("macosx")); + strncpy(*new_triple + base_len + strlen("macosx"), + darwin_macosx_version_min, + strlen(darwin_macosx_version_min)); + (*new_triple)[base_len+os_len+1] = '\0'; + return 1; + } - return 1; + return 0; } /* LLVM LOCAL end radar 6230142 */ #include "gt-darwin.h" From drbdneg at gmail.com Wed Apr 20 15:14:15 2011 From: drbdneg at gmail.com (Dan Bailey) Date: Wed, 20 Apr 2011 21:14:15 +0100 Subject: [llvm-commits] [llvm] r129846 - /llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h In-Reply-To: References: <20110420092719.BAA722A6C12C@llvm.org> Message-ID: <47A17150-1859-439B-9F27-547B6077D9B4@googlemail.com> Yep, I'll sort this out and familiarise myself with the testing process. Think swapping the binary search with a find will resolve this. Dan On 20 Apr 2011, at 20:44, Justin Holewinski wrote: > Forwarding to author. > > ---------- Forwarded message ---------- > From: Eli Friedman > Date: Wed, Apr 20, 2011 at 3:05 PM > Subject: Re: [llvm-commits] [llvm] r129846 - /llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h > To: Che-Liang Chiou > Cc: llvm-commits at cs.uiuc.edu > > > On Wed, Apr 20, 2011 at 2:27 AM, Che-Liang Chiou wrote: > > Author: clchiou > > Date: Wed Apr 20 04:27:19 2011 > > New Revision: 129846 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=129846&view=rev > > Log: > > ptx: fix parameter ordering > > > > Patched by Dan Bailey > > I reverted this because it was breaking the llvm-x86_64-linux-checks > buildbot; see http://google1.osuosl.org:8011/builders/llvm-x86_64-linux-checks/builds/825/steps/test.llvm.stage2/logs/st.ll > . > > -Eli > > > Modified: > > llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h > > > > Modified: llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h > > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h?rev=129846&r1=129845&r2=129846&view=diff > > ============================================================================== > > --- llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h (original) > > +++ llvm/trunk/lib/Target/PTX/PTXMachineFunctionInfo.h Wed Apr 20 04:27:19 2011 > > @@ -42,7 +42,6 @@ > > void setRetReg(unsigned reg) { reg_ret = reg; } > > > > void doneAddArg(void) { > > - std::sort(reg_arg.begin(), reg_arg.end()); > > _isDoneAddArg = true; > > } > > void doneAddLocalVar(void) { > > > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > -- > > Thanks, > > Justin Holewinski > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20110420/c97dd66b/attachment.html From pasi.parviainen at iki.fi Wed Apr 20 16:22:37 2011 From: pasi.parviainen at iki.fi (Pasi Parviainen) Date: Thu, 21 Apr 2011 00:22:37 +0300 Subject: [llvm-commits] [llvm] r129571 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfCFIException.cpp lib/Target/TargetLoweringObjectFile.cpp lib/Target/X86/X86FrameLowering.cpp lib/Target/X86/X86MCAsmInfo.cpp test/CodeGen/X86/2007-05-05-Personality.ll test/CodeGen/X86/2008-12-12-PrivateEHSymbol.ll test/CodeGen/X86/aliases.ll In-Reply-To: <20110415151106.487BD2A6C12C@llvm.org> References: <20110415151106.487BD2A6C12C@llvm.org> Message-ID: <4DAF4E9D.3070207@iki.fi> On 15.4.2011 18:11, Rafael Espindola wrote: > Modified: llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp?rev=129571&r1=129570&r2=129571&view=diff > ============================================================================== > --- llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp (original) > +++ llvm/trunk/lib/Target/X86/X86MCAsmInfo.cpp Fri Apr 15 10:11:06 2011 > @@ -89,7 +89,9 @@ > SupportsDebugInformation = true; > > // Exceptions handling > - ExceptionsType = ExceptionHandling::DwarfTable; > + ExceptionsType = ExceptionHandling::DwarfCFI; > + > + DwarfRequiresFrameSection = false; > > // OpenBSD has buggy support for .quad in 32-bit mode, just split into two > // .words. Linker in the base FreeBSD system doesn't cope really well with the Dwarf CFI EH tables generated by LLVM. When building self hosting clang+LLVM under FreeBSD. This results following kind of errors and failure to link tblgen as seen at http://google1.osuosl.org:8011/builders/clang-i686-freebsd-selfhost-rel/builds/15/steps/compile.llvm.stage2/logs/stdio llvm[2]: Linking Release+Asserts executable tblgen (without symbols) local symbol 0: discarded in section `.text._ZN4llvm13CodeGenTargetD2Ev' from /data/llvm.org-slave/clang-i686-freebsd-selfhost-rel/llvm.obj.2/utils/TableGen/Release+Asserts/AsmMatcherEmitter.o local symbol 1: discarded in section `.text._ZNSt6vectorIN4llvm20CodeGenRegisterClassESaIS1_EED2Ev' from /data/llvm.org-slave/clang-i686-freebsd-selfhost-rel/llvm.obj.2/utils/TableGen/Release+Asserts/AsmMatcherEmitter.o Linker in the base system: $ ld -v GNU ld version 2.15 [FreeBSD] 2004-05-23 Host: $ uname -a FreeBSD localhost 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010 root at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd6 So, I would suggest using Dwarf Table exception types for FreeBSD hosts by default instead of CFI. Pasi From geek4civic at gmail.com Wed Apr 20 20:32:20 2011 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Thu, 21 Apr 2011 01:32:20 -0000 Subject: [llvm-commits] [llvm] r129900 - /llvm/trunk/docs/Passes.html Message-ID: <20110421013220.2B4502A6C12C@llvm.org> Author: chapuni Date: Wed Apr 20 20:32:19 2011 New Revision: 129900 URL: http://llvm.org/viewvc/llvm-project?rev=129900&view=rev Log: docs/Passes.html: Fix a garbage. Modified: llvm/trunk/docs/Passes.html Modified: llvm/trunk/docs/Passes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Passes.html?rev=129900&r1=129899&r2=129900&view=diff ============================================================================== --- llvm/trunk/docs/Passes.html (original) +++ llvm/trunk/docs/Passes.html Wed Apr 20 20:32:19 2011 @@ -1,4 +1,4 @@ -32;10;2c From geek4civic at gmail.com Wed Apr 20 20:52:00 2011 From: geek4civic at gmail.com (NAKAMURA Takumi) Date: Thu, 21 Apr 2011 01:52:00 -0000 Subject: [llvm-commits] [llvm] r129901 - in /llvm/trunk/docs: AliasAnalysis.html ReleaseNotes.html llvm.css Message-ID: <20110421015200.B4F592A6C12C@llvm.org> Author: chapuni Date: Wed Apr 20 20:52:00 2011 New Revision: 129901 URL: http://llvm.org/viewvc/llvm-project?rev=129901&view=rev Log: docs/llvm.css: Introduce cascading style
          and

          continued on . For now, it is applied in AliasAnalysis.html and ReleaseNotes.html.

          Section Example

          Section preamble.

          Subsection Example

          Subsection body

          Modified: llvm/trunk/docs/AliasAnalysis.html llvm/trunk/docs/ReleaseNotes.html llvm/trunk/docs/llvm.css Modified: llvm/trunk/docs/AliasAnalysis.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AliasAnalysis.html?rev=129901&r1=129900&r2=129901&view=diff ============================================================================== --- llvm/trunk/docs/AliasAnalysis.html (original) +++ llvm/trunk/docs/AliasAnalysis.html Wed Apr 20 20:52:00 2011 @@ -64,7 +64,7 @@ -
          +

          Alias Analysis (aka Pointer Analysis) is a class of techniques which attempt to determine whether or not two pointers ever can point to the same object in @@ -101,7 +101,7 @@ -

          +

          The AliasAnalysis @@ -122,14 +122,12 @@ constants are all defined within the same function.

          -
          -

          Representation of Pointers

          -
          +

          Most importantly, the AliasAnalysis class provides several methods which are used to query whether or not two memory objects alias, whether @@ -185,7 +183,7 @@ The alias method -

          +

          The alias method is the primary interface used to determine whether or not two memory objects alias each other. It takes two memory objects as input and returns MustAlias, PartialAlias, MayAlias, or NoAlias as @@ -194,14 +192,13 @@

          Like all AliasAnalysis interfaces, the alias method requires that either the two pointer values be defined within the same function, or at least one of the values is a constant.

          -

          Must, May, and No Alias Responses

          -
          +

          The NoAlias response may be used when there is never an immediate dependence between any memory reference based on one pointer and any memory reference based the other. The most obvious example is when the two @@ -227,12 +224,14 @@

          +
          +

          The getModRefInfo methods

          -
          +

          The getModRefInfo methods return information about whether the execution of an instruction can read or modify a memory location. Mod/Ref @@ -254,21 +253,19 @@ Other useful AliasAnalysis methods -

          +

          Several other tidbits of information are often collected by various alias analysis implementations and can be put to good use by various clients.

          -
          -

          The pointsToConstantMemory method

          -
          +

          The pointsToConstantMemory method returns true if and only if the analysis can prove that the pointer only points to unchanging memory locations @@ -284,7 +281,7 @@ onlyReadsMemory methods -

          +

          These methods are used to provide very simple mod/ref information for function calls. The doesNotAccessMemory method returns true for a @@ -307,13 +304,17 @@

          +
          + +
          +

          Writing a new AliasAnalysis Implementation

          -
          +

          Writing a new alias analysis implementation for LLVM is quite straight-forward. There are already several implementations that you can use @@ -321,14 +322,12 @@ For a examples, take a look at the various alias analysis implementations included with LLVM.

          -
          -

          Different Pass styles

          -
          +

          The first step to determining what type of LLVM pass you need to use for your Alias @@ -356,7 +355,7 @@ Required initialization calls -

          +

          Your subclass of AliasAnalysis is required to invoke two methods on the AliasAnalysis base class: getAnalysisUsage and @@ -397,7 +396,7 @@ Interfaces which may be specified -

          +

          All of the AliasAnalysis @@ -416,7 +415,7 @@ AliasAnalysis chaining behavior -

          +

          With only two special exceptions (the basicaa and no-aa @@ -455,7 +454,7 @@ Updating analysis results for transformations -

          +

          Alias analysis information is initially computed for a static snapshot of the program, but clients will use this information to make transformations to the @@ -471,12 +470,11 @@ example, when an instruction is deleted), and clients of alias analysis must be sure to call these interfaces appropriately.

          -

          The deleteValue method

          -
          +
          The deleteValue method is called by transformations when they remove an instruction or any other value from the program (including values that do not use pointers). Typically alias analyses keep data structures that have entries @@ -487,7 +485,7 @@

          The copyValue method

          -
          +
          The copyValue method is used when a new value is introduced into the program. There is no way to introduce a value into the program that did not exist before (this doesn't make sense for a safe compiler transformation), so @@ -498,7 +496,7 @@

          The replaceWithNewValue method

          -
          +
          This method is a simple helper method that is provided to make clients easier to use. It is implemented by copying the old analysis information to the new value, then deleting the old value. This method cannot be overridden by alias @@ -508,7 +506,7 @@

          The addEscapingUse method

          -
          +

          The addEscapingUse method is used when the uses of a pointer value have changed in ways that may invalidate precomputed analysis information. Implementations may either use this callback to provide conservative responses @@ -527,12 +525,14 @@

    +
    +

    Efficiency Issues

    -
    +

    From the LLVM perspective, the only thing you need to do to provide an efficient alias analysis is to make sure that alias analysis queries are @@ -548,7 +548,7 @@ Limitations -

    +

    The AliasAnalysis infrastructure has several limitations which make writing a new AliasAnalysis implementation difficult.

    @@ -616,25 +616,25 @@
    +
    +

    Using alias analysis results

    -
    +

    There are several different ways to use alias analysis results. In order of preference, these are...

    -
    -

    Using the MemoryDependenceAnalysis Pass

    -
    +

    The memdep pass uses alias analysis to provide high-level dependence information about memory-using instructions. This will tell you which store @@ -649,7 +649,7 @@ Using the AliasSetTracker class -

    +

    Many transformations need information about alias sets that are active in some scope, rather than information about pairwise aliasing. The -

    -

    The AliasSetTracker implementation

    -
    +

    The AliasSetTracker class is implemented to be as efficient as possible. It uses the union-find algorithm to efficiently merge AliasSets when a pointer is @@ -706,12 +704,14 @@

    +
    +

    Using the AliasAnalysis interface directly

    -
    +

    If neither of these utility class are what your pass needs, you should use the interfaces exposed by the AliasAnalysis class directly. Try to use @@ -721,13 +721,15 @@

    +
    +

    Existing alias analysis implementations and clients

    -
    +

    If you're going to be working with the LLVM alias analysis infrastructure, you should know what clients and implementations of alias analysis are @@ -735,28 +737,24 @@ be aware of the the clients that are useful for monitoring and evaluating different implementations.

    -
    -

    Available AliasAnalysis implementations

    -
    +

    This section lists the various implementations of the AliasAnalysis interface. With the exception of the -no-aa and -basicaa implementations, all of these chain to other alias analysis implementations.

    -
    -

    The -no-aa pass

    -
    +

    The -no-aa pass is just like what it sounds: an alias analysis that never returns any useful information. This pass can be useful if you think that @@ -770,7 +768,7 @@ The -basicaa pass -

    +

    The -basicaa pass is an aggressive local analysis that "knows" many important facts:

    @@ -798,7 +796,7 @@ The -globalsmodref-aa pass -
    +

    This pass implements a simple context-sensitive mod/ref and alias analysis for internal global variables that don't "have their address taken". If a @@ -822,7 +820,7 @@ The -steens-aa pass -

    +

    The -steens-aa pass implements a variation on the well-known "Steensgaard's algorithm" for interprocedural alias analysis. Steensgaard's @@ -845,7 +843,7 @@ The -ds-aa pass -

    +

    The -ds-aa pass implements the full Data Structure Analysis algorithm. Data Structure Analysis is a modular unification-based, @@ -868,7 +866,7 @@ The -scev-aa pass -

    +

    The -scev-aa pass implements AliasAnalysis queries by translating them into ScalarEvolution queries. This gives it a @@ -877,22 +875,23 @@

    +
    +

    Alias analysis driven transformations

    -
    +
    LLVM includes several alias-analysis driven transformations which can be used with any of the implementations above. -

    The -adce pass

    -
    +

    The -adce pass, which implements Aggressive Dead Code Elimination uses the AliasAnalysis interface to delete calls to functions that do @@ -906,7 +905,7 @@ The -licm pass -

    +

    The -licm pass implements various Loop Invariant Code Motion related transformations. It uses the AliasAnalysis interface for several @@ -931,7 +930,7 @@ The -argpromotion pass -

    +

    The -argpromotion pass promotes by-reference arguments to be passed in by-value instead. In particular, if pointer arguments are only loaded from it @@ -947,33 +946,33 @@ passes -

    +

    These passes use AliasAnalysis information to reason about loads and stores.

    +
    +

    Clients for debugging and evaluation of implementations

    -
    +

    These passes are useful for evaluating the various alias analysis implementations. You can use them with commands like 'opt -ds-aa -aa-eval foo.bc -disable-output -stats'.

    -
    -

    The -print-alias-sets pass

    -
    +

    The -print-alias-sets pass is exposed as part of the opt tool to print out the Alias Sets formed by the The -count-aa pass -

    +

    The -count-aa pass is useful to see how many queries a particular pass is making and what responses are returned by the alias analysis. As an @@ -1018,7 +1017,7 @@ The -aa-eval pass -

    +

    The -aa-eval pass simply iterates through all pairs of pointers in a function and asks an alias analysis whether or not the pointers alias. This @@ -1028,13 +1027,17 @@

    +
    + +
    +

    Memory Dependence Analysis

    -
    +

    If you're just looking to be a client of alias analysis information, consider using the Memory Dependence Analysis interface instead. MemDep is a lazy, Modified: llvm/trunk/docs/ReleaseNotes.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=129901&r1=129900&r2=129901&view=diff ============================================================================== --- llvm/trunk/docs/ReleaseNotes.html (original) +++ llvm/trunk/docs/ReleaseNotes.html Wed Apr 20 20:52:00 2011 @@ -41,7 +41,7 @@ -

    +

    This document contains the release notes for the LLVM Compiler Infrastructure, release 2.9. Here we describe the status of LLVM, including @@ -77,7 +77,7 @@ -

    +

    The LLVM 2.9 distribution currently consists of code from the core LLVM repository (which roughly includes the LLVM optimizers, code generators @@ -86,15 +86,12 @@ development. Here we include updates on these subprojects.

    -
    - -

    Clang: C/C++/Objective-C Frontend Toolkit

    -
    +

    Clang is an LLVM front end for the C, C++, and Objective-C languages. Clang aims to provide a better user experience @@ -125,7 +122,7 @@ DragonEgg: GCC front-ends, LLVM back-end -

    +

    DragonEgg is a gcc plugin that replaces GCC's @@ -157,7 +154,7 @@ compiler-rt: Compiler Runtime Library -

    +

    The new LLVM compiler-rt project is a simple library that provides an implementation of the low-level @@ -183,7 +180,7 @@ LLDB: Low Level Debugger -

    +

    LLDB is a brand new member of the LLVM umbrella of projects. LLDB is a next generation, high-performance debugger. It @@ -205,7 +202,7 @@ libc++: C++ Standard Library -

    +

    libc++ is another new member of the LLVM family. It is an implementation of the C++ standard library, written from the @@ -230,7 +227,7 @@ LLBrowse: IR Browser -

    +

    LLBrowse is an interactive viewer for LLVM modules. It can load any LLVM @@ -245,7 +242,7 @@ VMKit -

    +

    The VMKit project is an implementation of a Java Virtual Machine (Java VM or JVM) that uses LLVM for static and just-in-time compilation. As of LLVM 2.9, VMKit now supports generational @@ -262,7 +259,7 @@ KLEE: A Symbolic Execution Virtual Machine -

    +

    KLEE is a symbolic execution framework for programs in LLVM bitcode form. KLEE tries to symbolically evaluate "all" paths @@ -274,6 +271,7 @@

    UPDATE!

    --> +

    @@ -281,18 +279,16 @@

    -
    +

    An exciting aspect of LLVM is that it is used as an enabling technology for a lot of other language and tools projects. This section lists some of the projects that have already been updated to work with LLVM 2.9.

    -
    -

    Crack Programming Language

    -
    +

    Crack aims to provide the ease of development of a scripting language with the performance of a compiled @@ -304,7 +300,7 @@

    TTA-based Codesign Environment (TCE)

    -
    +

    TCE is a toolset for designing application-specific processors (ASP) based on the Transport triggered architecture (TTA). The toolset provides a complete co-design flow from C/C++ programs down to synthesizable VHDL and parallel @@ -323,7 +319,7 @@

    PinaVM

    -
    +

    PinaVM is an open source, SystemC front-end. Unlike many other front-ends, PinaVM actually executes the elaboration of the @@ -334,7 +330,7 @@

    Pure

    -
    +

    Pure is an algebraic/functional programming language based on term rewriting. Programs are collections @@ -355,7 +351,7 @@

    IcedTea Java Virtual Machine Implementation

    -
    +

    IcedTea provides a harness to build OpenJDK using only free software build tools and to provide @@ -374,7 +370,7 @@

    Glasgow Haskell Compiler (GHC)

    -
    +

    GHC is an open source, state-of-the-art programming suite for Haskell, a standard lazy functional programming language. It includes an optimizing static compiler generating good code for a variety of @@ -388,7 +384,7 @@

    Polly - Polyhedral optimizations for LLVM

    -
    +

    Polly is a project that aims to provide advanced memory access optimizations to better take advantage of SIMD units, cache hierarchies, multiple cores or even vector accelerators for LLVM. Built around an abstract mathematical @@ -403,7 +399,7 @@

    Rubinius

    -
    +

    Rubinius is an environment for running Ruby code which strives to write as much of the implementation in Ruby as possible. Combined with a bytecode interpreting VM, it uses LLVM to @@ -418,7 +414,7 @@ FAUST Real-Time Audio Signal Processing Language -

    +

    FAUST is a compiled language for real-time audio signal processing. The name FAUST stands for Functional AUdio STream. Its @@ -428,27 +424,27 @@

    +
    +

    What's New in LLVM 2.9?

    -
    +

    This release includes a huge number of bug fixes, performance tweaks and minor improvements. Some of the major improvements and new features are listed in this section.

    -
    -

    Major New Features

    -
    +

    LLVM 2.9 includes several major new capabilities:

    @@ -478,7 +474,7 @@ LLVM IR and Core Improvements -
    +

    LLVM IR has several new features for better support of new targets and that expose new optimization opportunities:

    @@ -505,7 +501,7 @@ Optimizer Improvements -
    +

    In addition to a large array of minor performance tweaks and bug fixes, this release includes a few major enhancements and additions to the optimizers:

    @@ -573,7 +569,7 @@ MC Level Improvements -
    +

    The LLVM Machine Code (aka MC) subsystem was created to solve a number of problems in the realm of assembly, disassembly, object file format handling, @@ -627,7 +623,7 @@ Target Independent Code Generator Improvements -

    +

    We have put a significant amount of work into the code generator infrastructure, which allows us to implement more aggressive algorithms and make @@ -670,7 +666,7 @@ X86-32 and X86-64 Target Improvements -

    +

    New features and major changes in the X86 target include:

    @@ -709,7 +705,7 @@ ARM Target Improvements -
    +

    New features of the ARM target include:

    @@ -733,7 +729,7 @@ Other Target Specific Improvements -
    +
    • MicroBlaze: major updates for aggressive delay slot filler, MC-based assembly printing, assembly instruction parsing, ELF .o file emission, and MC @@ -758,7 +754,7 @@ Major Changes and Removed Features -
      +

      If you're already an LLVM user or developer with out-of-tree changes based on LLVM 2.8, this section lists some "gotchas" that you may run into upgrading @@ -794,7 +790,7 @@ Internal API Changes -

      +

      In addition, many APIs have changed in this release. Some of the major LLVM API changes are:

      @@ -815,27 +811,27 @@
    +
    +

    Known Problems

    -
    +

    This section contains significant known problems with the LLVM system, listed by component. If you run into a problem, please check the LLVM bug database and submit a bug if there isn't already one.

    -
    -

    Experimental features included with this release

    -
    +

    The following components of this LLVM release are either untested, known to be broken or unreliable, or are in early development. These components should @@ -859,7 +855,7 @@ Known problems with the X86 back-end -

    +