[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp
Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.53 -> 1.54 --- Log message: use ESP directly, not a copy of ESP into some other register for fastcc calls --- Diffs of the changes: (+1 -2) X86ISelLowering.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.53 llvm/lib/Target/X86/X86ISelLowering.cpp:1.54 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.53Mon Jan 23 23:17:12 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Tue Jan 24 00:14:44 2006 @@ -923,8 +923,7 @@ // Arguments go on the stack in reverse order, as specified by the ABI. unsigned ArgOffset = 0; - SDOperand StackPtr = DAG.getCopyFromReg(DAG.getEntryNode(), - X86::ESP, MVT::i32); + SDOperand StackPtr = DAG.getRegister(X86::ESP, MVT::i32); NumIntRegs = 0; std::vector Stores; std::vector RegValuesToPass; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Bytecode/old-intrinsics.ll
Changes in directory llvm/test/Regression/Bytecode: old-intrinsics.ll updated: 1.3 -> 1.4 --- Log message: This is still broken --- Diffs of the changes: (+2 -0) old-intrinsics.ll |2 ++ 1 files changed, 2 insertions(+) Index: llvm/test/Regression/Bytecode/old-intrinsics.ll diff -u llvm/test/Regression/Bytecode/old-intrinsics.ll:1.3 llvm/test/Regression/Bytecode/old-intrinsics.ll:1.4 --- llvm/test/Regression/Bytecode/old-intrinsics.ll:1.3 Mon Jan 23 01:07:51 2006 +++ llvm/test/Regression/Bytecode/old-intrinsics.ll Tue Jan 24 00:13:48 2006 @@ -2,3 +2,5 @@ ; RUN: llc %s.bc-16 -o /dev/null -f -march=c ; Just see if we can disassemble the bc file corresponding to this file. +; XFAIL: * + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAG.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.275 -> 1.276 SelectionDAG.cpp updated: 1.242 -> 1.243 --- Log message: Fix an infinite loop I caused by making sure to legalize the flag operand of CALLSEQ_* nodes --- Diffs of the changes: (+22 -1) LegalizeDAG.cpp | 10 +- SelectionDAG.cpp | 13 + 2 files changed, 22 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.275 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.276 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.275 Mon Jan 23 01:30:46 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jan 23 23:48:21 2006 @@ -823,6 +823,13 @@ Tmp2 = Node->getOperand(0); if (Tmp1 != Tmp2) Node->setAdjCallChain(Tmp1); + +// If this has a flag input, do legalize it. +if (Node->getOperand(Node->getNumOperands()-1).getValueType() == MVT::Flag){ + Tmp1 = LegalizeOp(Node->getOperand(Node->getNumOperands()-1)); + if (Tmp1 != Node->getOperand(Node->getNumOperands()-1)) +Node->setAdjCallFlag(Tmp1); +} // Note that we do not create new CALLSEQ_DOWN/UP nodes here. These // nodes are treated specially and are mutated in place. This makes the dag @@ -1365,7 +1372,8 @@ Tmp2, Node->getOperand(3)); } - Node = Result.Val; + Result = LegalizeOp(Result); + break; } switch (getTypeAction(Node->getOperand(1).getValueType())) { Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.242 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.243 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.242Mon Jan 23 15:51:14 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jan 23 23:48:21 2006 @@ -1276,6 +1276,19 @@ OperandList[0].Val->Uses.push_back(this); } +// setAdjCallFlag - This method changes the flag input of an +// CALLSEQ_START/END node to be the specified operand. +void SDNode::setAdjCallFlag(SDOperand N) { + assert(N.getValueType() == MVT::Flag); + assert((getOpcode() == ISD::CALLSEQ_START || + getOpcode() == ISD::CALLSEQ_END) && "Cannot adjust this node!"); + + SDOperand &FlagOp = OperandList[getNumOperands()-1]; + assert(FlagOp.getValueType() == MVT::Flag); + FlagOp.Val->removeUser(this); + FlagOp = N; + FlagOp.Val->Uses.push_back(this); +} SDOperand SelectionDAG::getLoad(MVT::ValueType VT, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAGNodes.h updated: 1.92 -> 1.93 --- Log message: add a method --- Diffs of the changes: (+1 -0) SelectionDAGNodes.h |1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.92 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.93 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.92 Mon Jan 23 15:51:14 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jan 23 23:47:05 2006 @@ -645,6 +645,7 @@ /// setAdjCallChain - This method should only be used by the legalizer. void setAdjCallChain(SDOperand N); + void setAdjCallFlag(SDOperand N); protected: friend class SelectionDAG; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp X86InstrInfo.td
Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.52 -> 1.53 X86InstrInfo.td updated: 1.216 -> 1.217 --- Log message: Emit the copies out of call return registers *after* the ISD::CALLSEQ_END node, fixing fastcc and the case where a function has a frame pointer due to dynamic allocas. --- Diffs of the changes: (+23 -7) X86ISelLowering.cpp | 28 ++-- X86InstrInfo.td |2 +- 2 files changed, 23 insertions(+), 7 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.52 llvm/lib/Target/X86/X86ISelLowering.cpp:1.53 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.52Fri Jan 20 12:41:25 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Jan 23 23:17:12 2006 @@ -521,6 +521,17 @@ Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops); SDOperand InFlag = Chain.getValue(1); +NodeTys.clear(); +NodeTys.push_back(MVT::Other); // Returns a chain +NodeTys.push_back(MVT::Flag);// Returns a flag for retval copy to use. +Ops.clear(); +Ops.push_back(Chain); +Ops.push_back(DAG.getConstant(NumBytes, getPointerTy())); +Ops.push_back(DAG.getConstant(0, getPointerTy())); +Ops.push_back(InFlag); +Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, Ops); +InFlag = Chain.getValue(1); + SDOperand RetVal; if (RetTyVT != MVT::isVoid) { switch (RetTyVT) { @@ -591,9 +602,6 @@ } } -Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain, -DAG.getConstant(NumBytes, getPointerTy()), -DAG.getConstant(0, getPointerTy())); return std::make_pair(RetVal, Chain); } else { std::vector Ops; @@ -1049,6 +1057,17 @@ Chain = DAG.getNode(X86ISD::CALL, NodeTys, Ops); InFlag = Chain.getValue(1); +NodeTys.clear(); +NodeTys.push_back(MVT::Other); // Returns a chain +NodeTys.push_back(MVT::Flag);// Returns a flag for retval copy to use. +Ops.clear(); +Ops.push_back(Chain); +Ops.push_back(DAG.getConstant(ArgOffset, getPointerTy())); +Ops.push_back(DAG.getConstant(ArgOffset, getPointerTy())); +Ops.push_back(InFlag); +Chain = DAG.getNode(ISD::CALLSEQ_END, NodeTys, Ops); +InFlag = Chain.getValue(1); + SDOperand RetVal; if (RetTyVT != MVT::isVoid) { switch (RetTyVT) { @@ -1119,9 +1138,6 @@ } } -Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain, -DAG.getConstant(ArgOffset, getPointerTy()), -DAG.getConstant(ArgOffset, getPointerTy())); return std::make_pair(RetVal, Chain); } else { std::vector Ops; Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.216 llvm/lib/Target/X86/X86InstrInfo.td:1.217 --- llvm/lib/Target/X86/X86InstrInfo.td:1.216 Fri Jan 20 20:55:41 2006 +++ llvm/lib/Target/X86/X86InstrInfo.td Mon Jan 23 23:17:12 2006 @@ -88,7 +88,7 @@ [SDNPHasChain]>; def X86callseq_end : SDNode<"ISD::CALLSEQ_END", SDT_X86CallSeqEnd, -[SDNPHasChain]>; +[SDNPHasChain, SDNPInFlag, SDNPOutFlag]>; def X86call: SDNode<"X86ISD::CALL", SDT_X86Call, [SDNPHasChain, SDNPOutFlag, SDNPOptInFlag]>; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CFrontend/2006-01-23-FileScopeAsm.c
Changes in directory llvm/test/Regression/CFrontend: 2006-01-23-FileScopeAsm.c added (r1.1) --- Log message: new c front-end testcase --- Diffs of the changes: (+8 -0) 2006-01-23-FileScopeAsm.c |8 1 files changed, 8 insertions(+) Index: llvm/test/Regression/CFrontend/2006-01-23-FileScopeAsm.c diff -c /dev/null llvm/test/Regression/CFrontend/2006-01-23-FileScopeAsm.c:1.1 *** /dev/null Mon Jan 23 23:01:49 2006 --- llvm/test/Regression/CFrontend/2006-01-23-FileScopeAsm.cMon Jan 23 23:01:39 2006 *** *** 0 --- 1,8 + // RUN: %llvmgcc %s -S -o - | gccas | llvm-dis | grep foo[12345] | wc -l | grep 5 + // XFAIL: * + + __asm__ ("foo1"); + __asm__ ("foo2"); + __asm__ ("foo3"); + __asm__ ("foo4"); + __asm__ ("foo5"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp
Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.83 -> 1.84 --- Log message: Allow jit-beta to work --- Diffs of the changes: (+0 -1) X86CodeEmitter.cpp |1 - 1 files changed, 1 deletion(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.83 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.84 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.83 Sun Jan 22 17:37:17 2006 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Mon Jan 23 22:50:48 2006 @@ -399,7 +399,6 @@ if (MO.isMachineBasicBlock()) { emitPCRelativeBlockAddress(MO.getMachineBasicBlock()); } else if (MO.isGlobalAddress()) { -assert(MO.isPCRelative() && "Call target is not PC Relative?"); bool isTailCall = Opcode == X86::TAILJMPd || Opcode == X86::TAILJMPr || Opcode == X86::TAILJMPm; emitGlobalAddressForCall(MO.getGlobal(), isTailCall); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/InlineAsm.h
Changes in directory llvm/include/llvm: InlineAsm.h updated: 1.1 -> 1.2 --- Log message: Be consistent in using class/struct to keep Visual Studio happy. --- Diffs of the changes: (+1 -1) InlineAsm.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/InlineAsm.h diff -u llvm/include/llvm/InlineAsm.h:1.1 llvm/include/llvm/InlineAsm.h:1.2 --- llvm/include/llvm/InlineAsm.h:1.1 Mon Jan 23 22:12:40 2006 +++ llvm/include/llvm/InlineAsm.h Mon Jan 23 22:41:48 2006 @@ -19,7 +19,7 @@ namespace llvm { -class AssemblyAnnotationWriter; +struct AssemblyAnnotationWriter; class PointerType; class FunctionType; class Module; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAGSimple.cpp updated: 1.4 -> 1.5 --- Log message: Fix VC++ compilation error. --- Diffs of the changes: (+1 -0) ScheduleDAGSimple.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.4 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.5 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.4 Mon Jan 23 02:25:34 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Mon Jan 23 22:43:17 2006 @@ -19,6 +19,7 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Support/Debug.h" +#include using namespace llvm; namespace { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.13 -> 1.14 --- Log message: Remove unused variables. --- Diffs of the changes: (+0 -3) DwarfWriter.cpp |3 --- 1 files changed, 3 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.13 llvm/lib/CodeGen/DwarfWriter.cpp:1.14 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.13 Mon Jan 23 18:49:18 2006 +++ llvm/lib/CodeGen/DwarfWriter.cppMon Jan 23 22:42:53 2006 @@ -875,9 +875,6 @@ DIE *DWContext::NewBasicType(const Type *Ty, unsigned Size, unsigned Align) { DIE *TypeDie = Types[Ty]; - char *Name; - unsigned Encoding; - // If first occurance of type. if (!TypeDie) { const char *Name; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/win32/CodeGen/CodeGen.vcproj
Changes in directory llvm/win32/CodeGen: CodeGen.vcproj updated: 1.19 -> 1.20 --- Log message: Add new files to Visual Studio. --- Diffs of the changes: (+3 -0) CodeGen.vcproj |3 +++ 1 files changed, 3 insertions(+) Index: llvm/win32/CodeGen/CodeGen.vcproj diff -u llvm/win32/CodeGen/CodeGen.vcproj:1.19 llvm/win32/CodeGen/CodeGen.vcproj:1.20 --- llvm/win32/CodeGen/CodeGen.vcproj:1.19 Sun Jan 22 14:37:25 2006 +++ llvm/win32/CodeGen/CodeGen.vcproj Mon Jan 23 22:40:54 2006 @@ -190,6 +190,9 @@ RelativePath="..\..\lib\CodeGen\SelectionDAG\ScheduleDAG.cpp"> + + http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/win32/config.h
Changes in directory llvm/win32: config.h updated: 1.1 -> 1.2 --- Log message: Track changes in config.h.in. --- Diffs of the changes: (+2 -4) config.h |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) Index: llvm/win32/config.h diff -u llvm/win32/config.h:1.1 llvm/win32/config.h:1.2 --- llvm/win32/config.h:1.1 Thu Jan 19 22:34:45 2006 +++ llvm/win32/config.h Mon Jan 23 22:40:19 2006 @@ -9,14 +9,12 @@ #define HAVE_STDLIB_H 1 #define HAVE_STDIO_H 1 #define HAVE_STRING_H 1 +#define HAVE_CEILF 1 +#define HAVE_FLOORF 1 #define SHLIBEXT ".lib" #define error_t int #define HAVE_ERRNO_H 1 #define LTDL_DLOPEN_DEPLIBS 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 #define LTDL_OBJDIR "_libs" #define LTDL_SHLIBPATH_VAR "PATH" #define LTDL_SHLIB_EXT ".dll" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/win32/VMCore/VMCore.vcproj
Changes in directory llvm/win32/VMCore: VMCore.vcproj updated: 1.13 -> 1.14 --- Log message: Add new files to Visual Studio. --- Diffs of the changes: (+6 -0) VMCore.vcproj |6 ++ 1 files changed, 6 insertions(+) Index: llvm/win32/VMCore/VMCore.vcproj diff -u llvm/win32/VMCore/VMCore.vcproj:1.13 llvm/win32/VMCore/VMCore.vcproj:1.14 --- llvm/win32/VMCore/VMCore.vcproj:1.13Mon Jan 16 23:13:22 2006 +++ llvm/win32/VMCore/VMCore.vcproj Mon Jan 23 22:40:54 2006 @@ -136,6 +136,9 @@ RelativePath="..\..\lib\VMCore\Globals.cpp"> + + + + http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneModule.cpp
Changes in directory llvm/lib/Transforms/Utils: CloneModule.cpp updated: 1.16 -> 1.17 --- Log message: rename method --- Diffs of the changes: (+1 -1) CloneModule.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/CloneModule.cpp diff -u llvm/lib/Transforms/Utils/CloneModule.cpp:1.16 llvm/lib/Transforms/Utils/CloneModule.cpp:1.17 --- llvm/lib/Transforms/Utils/CloneModule.cpp:1.16 Mon Jan 23 17:06:28 2006 +++ llvm/lib/Transforms/Utils/CloneModule.cpp Mon Jan 23 22:16:34 2006 @@ -31,7 +31,7 @@ New->setEndianness(M->getEndianness()); New->setPointerSize(M->getPointerSize()); New->setTargetTriple(M->getTargetTriple()); - New->setInlineAsm(M->getInlineAsm()); + New->setModuleInlineAsm(M->getModuleInlineAsm()); // Copy all of the type symbol table entries over. const SymbolTable &SymTab = M->getSymbolTable(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.38 -> 1.39 --- Log message: rename method --- Diffs of the changes: (+4 -3) AsmPrinter.cpp |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.38 llvm/lib/CodeGen/AsmPrinter.cpp:1.39 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.38Mon Jan 23 17:47:53 2006 +++ llvm/lib/CodeGen/AsmPrinter.cpp Mon Jan 23 22:15:29 2006 @@ -72,9 +72,10 @@ bool AsmPrinter::doInitialization(Module &M) { Mang = new Mangler(M, GlobalPrefix); - if (!M.getInlineAsm().empty()) -O << CommentString << " Start File Scope Asm Blocks:\n" << M.getInlineAsm() - << "\n" << CommentString << " End File Scope Asm Blocks\n"; + if (!M.getModuleInlineAsm().empty()) +O << CommentString << " Start of file scope inline assembly\n" + << M.getModuleInlineAsm() + << "\n" << CommentString << " End of file scope inline assembly\n"; SwitchSection("", 0); // Reset back to no section. return false; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp
Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.110 -> 1.111 --- Log message: Rename method --- Diffs of the changes: (+5 -4) LinkModules.cpp |9 + 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.110 llvm/lib/Linker/LinkModules.cpp:1.111 --- llvm/lib/Linker/LinkModules.cpp:1.110 Mon Jan 23 17:08:37 2006 +++ llvm/lib/Linker/LinkModules.cpp Mon Jan 23 22:14:29 2006 @@ -833,11 +833,12 @@ Dest->getTargetTriple() != Src->getTargetTriple()) std::cerr << "WARNING: Linking two modules of different target triples!\n"; - if (!Src->getInlineAsm().empty()) { -if (Dest->getInlineAsm().empty()) - Dest->setInlineAsm(Src->getInlineAsm()); + if (!Src->getModuleInlineAsm().empty()) { +if (Dest->getModuleInlineAsm().empty()) + Dest->setModuleInlineAsm(Src->getModuleInlineAsm()); else - Dest->setInlineAsm(Dest->getInlineAsm()+"\n"+Src->getInlineAsm()); + Dest->setModuleInlineAsm(Dest->getModuleInlineAsm()+"\n"+ + Src->getModuleInlineAsm()); } // Update the destination module's dependent libraries list with the libraries ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/InlineAsm.cpp AsmWriter.cpp Globals.cpp Module.cpp
Changes in directory llvm/lib/VMCore: InlineAsm.cpp added (r1.1) AsmWriter.cpp updated: 1.188 -> 1.189 Globals.cpp updated: 1.12 -> 1.13 Module.cpp updated: 1.62 -> 1.63 --- Log message: Initial checkin of the InlineAsm class --- Diffs of the changes: (+80 -5) AsmWriter.cpp | 12 ++-- Globals.cpp |4 ++-- InlineAsm.cpp | 50 ++ Module.cpp| 19 ++- 4 files changed, 80 insertions(+), 5 deletions(-) Index: llvm/lib/VMCore/InlineAsm.cpp diff -c /dev/null llvm/lib/VMCore/InlineAsm.cpp:1.1 *** /dev/null Mon Jan 23 22:13:21 2006 --- llvm/lib/VMCore/InlineAsm.cpp Mon Jan 23 22:13:11 2006 *** *** 0 --- 1,50 + //===-- InlineAsm.cpp - Implement the InlineAsm class -===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Chris Lattner and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===--===// + // + // This file implements the InlineAsm class. + // + //===--===// + + #include "llvm/InlineAsm.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Module.h" + #include "llvm/Support/LeakDetector.h" + using namespace llvm; + + InlineAsm::InlineAsm(const FunctionType *Ty, const std::string &asmString, + const std::string &constraints, bool hasSideEffects, + const std::string &name, Module *ParentModule) + : Value(PointerType::get(Ty), Value::InlineAsmVal, name), + Parent(0), AsmString(asmString), Constraints(constraints), + AsmHasSideEffects(hasSideEffects) { + LeakDetector::addGarbageObject(this); + + if (ParentModule) + ParentModule->getInlineAsmList().push_back(this); + } + + const FunctionType *InlineAsm::getFunctionType() const { + return cast(getType()->getElementType()); + } + + void InlineAsm::setParent(Module *parent) { + if (getParent()) + LeakDetector::addGarbageObject(this); + Parent = parent; + if (getParent()) + LeakDetector::removeGarbageObject(this); + } + + void InlineAsm::removeFromParent() { + getParent()->getInlineAsmList().remove(this); + } + + void InlineAsm::eraseFromParent() { + getParent()->getInlineAsmList().erase(this); + } Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.188 llvm/lib/VMCore/AsmWriter.cpp:1.189 --- llvm/lib/VMCore/AsmWriter.cpp:1.188 Mon Jan 23 18:45:30 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Jan 23 22:13:11 2006 @@ -775,9 +775,9 @@ if (!M->getTargetTriple().empty()) Out << "target triple = \"" << M->getTargetTriple() << "\"\n"; - if (!M->getInlineAsm().empty()) { + if (!M->getModuleInlineAsm().empty()) { // Split the string into lines, to make it easier to read the .ll file. -std::string Asm = M->getInlineAsm(); +std::string Asm = M->getModuleInlineAsm(); size_t CurPos = 0; size_t NewLine = Asm.find_first_of('\n', CurPos); while (NewLine != std::string::npos) { @@ -1269,6 +1269,14 @@ W.write(this); } +void InlineAsm::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const { + SlotMachine SlotTable(getParent()); + AssemblyWriter W(o, SlotTable, getParent(), AAW); + + assert(0 && "Inline asm printing unimplemented!"); + //W.write(this); +} + void BasicBlock::print(std::ostream &o, AssemblyAnnotationWriter *AAW) const { SlotMachine SlotTable(getParent()); AssemblyWriter W(o, SlotTable, Index: llvm/lib/VMCore/Globals.cpp diff -u llvm/lib/VMCore/Globals.cpp:1.12 llvm/lib/VMCore/Globals.cpp:1.13 --- llvm/lib/VMCore/Globals.cpp:1.12Tue Oct 4 13:13:04 2005 +++ llvm/lib/VMCore/Globals.cpp Mon Jan 23 22:13:11 2006 @@ -1,4 +1,4 @@ -//===-- Globals.cpp - Implement the Global object classes -===// +//===-- Globals.cpp - Implement the GlobalValue & GlobalVariable class ===// // // The LLVM Compiler Infrastructure // @@ -12,8 +12,8 @@ // //===--===// -#include "llvm/DerivedTypes.h" #include "llvm/GlobalVariable.h" +#include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/SymbolTable.h" #include "llvm/Support/LeakDetector.h" Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.62 llvm/lib/VMCore/Module.cpp:1.63 --- llvm/lib/VMCore/Module.cpp:1.62 Sun Dec 4 23:30:21 2005 +++ llvm/lib/VMCore/Module.cpp Mon Jan 23 22:13:11 2006 @@ -44,17 +44,30 @@ return Ret; } +InlineAsm *ilist_traits::createSentinel() { + InlineAsm *Ret = new InlineAsm(FunctionType::get(Type::VoidTy, +std::vector(), false), "", "", + false); + // This should not be garbage monitored. + LeakDetector::rem
[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.183 -> 1.184 --- Log message: Rename method --- Diffs of the changes: (+1 -1) Reader.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.183 llvm/lib/Bytecode/Reader/Reader.cpp:1.184 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.183 Mon Jan 23 17:43:17 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Jan 23 22:14:29 2006 @@ -2111,7 +2111,7 @@ // If the file has module-level inline asm, read it now. if (!hasAlignment && At != BlockEnd) - TheModule->setInlineAsm(read_str()); + TheModule->setModuleInlineAsm(read_str()); } // If any globals are in specified sections, assign them now. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp
Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.117 -> 1.118 --- Log message: Rename method --- Diffs of the changes: (+1 -1) Writer.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.117 llvm/lib/Bytecode/Writer/Writer.cpp:1.118 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.117 Mon Jan 23 17:43:17 2006 +++ llvm/lib/Bytecode/Writer/Writer.cpp Mon Jan 23 22:14:29 2006 @@ -1032,7 +1032,7 @@ output(SectionNames[i]); // Output the inline asm string. - output(M->getInlineAsm()); + output(M->getModuleInlineAsm()); } void BytecodeWriter::outputInstructions(const Function *F) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/InlineAsm.h Value.h Module.h
Changes in directory llvm/include/llvm: InlineAsm.h added (r1.1) Value.h updated: 1.81 -> 1.82 Module.h updated: 1.67 -> 1.68 --- Log message: Initial checkin of the InlineAsm class --- Diffs of the changes: (+139 -18) InlineAsm.h | 89 Module.h| 65 --- Value.h |3 +- 3 files changed, 139 insertions(+), 18 deletions(-) Index: llvm/include/llvm/InlineAsm.h diff -c /dev/null llvm/include/llvm/InlineAsm.h:1.1 *** /dev/null Mon Jan 23 22:12:50 2006 --- llvm/include/llvm/InlineAsm.h Mon Jan 23 22:12:40 2006 *** *** 0 --- 1,89 + //===-- llvm/InlineAsm.h - Class to represent inline asm strings-*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Chris Lattner and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===--===// + // + // This class represents the inline asm strings, which are Value*'s that are + // used as the callee operand of call instructions. + // + //===--===// + + #ifndef LLVM_INLINEASM_H + #define LLVM_INLINEASM_H + + #include "llvm/Value.h" + + namespace llvm { + + class AssemblyAnnotationWriter; + class PointerType; + class FunctionType; + class Module; + template struct ilist_traits; + template class SymbolTableListTraits; + + class InlineAsm : public Value { + friend class SymbolTableListTraits >; + InlineAsm(const InlineAsm &); // do not implement + void operator=(const InlineAsm&); // do not implement + + void setParent(Module *Parent); + InlineAsm *Prev, *Next; + void setNext(InlineAsm *N) { Next = N; } + void setPrev(InlineAsm *N) { Prev = N; } + InlineAsm *getNext() { return Next; } + const InlineAsm *getNext() const { return Next; } + InlineAsm *getPrev() { return Prev; } + const InlineAsm *getPrev() const { return Prev; } + + Module *Parent; + std::string AsmString, Constraints; + bool AsmHasSideEffects; + public: + InlineAsm(const FunctionType *Ty, const std::string &AsmString, + const std::string &Constraints, bool hasSideEffects, + const std::string &Name = "", Module *ParentModule = 0); + + bool getHasSideEffects() const { return AsmHasSideEffects; } + void setSideEffects(bool X) { AsmHasSideEffects = X; } + + /// getType - InlineAsm's are always pointers. + /// + const PointerType *getType() const { + return reinterpret_cast(Value::getType()); + } + + /// getFunctionType - InlineAsm's are always pointers to functions. + /// + const FunctionType *getFunctionType() const; + + /// getParent - Get the module that this global value is contained inside + /// of... + Module *getParent() { return Parent; } + const Module *getParent() const { return Parent; } + + + /// removeFromParent/eraseFromParent - Unlink and unlink/delete this object + /// from the module it is embedded into. + void removeFromParent(); + void eraseFromParent(); + + virtual void print(std::ostream &O) const { print(O, 0); } + void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const; + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const InlineAsm *) { return true; } + static inline bool classof(const Value *V) { + return V->getValueType() == Value::InlineAsmVal; + } + }; + + } // End llvm namespace + + #endif Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.81 llvm/include/llvm/Value.h:1.82 --- llvm/include/llvm/Value.h:1.81 Tue Jan 10 03:45:57 2006 +++ llvm/include/llvm/Value.h Mon Jan 23 22:12:40 2006 @@ -155,6 +155,7 @@ ConstantStructVal,// This is an instance of ConstantStruct ConstantPackedVal,// This is an instance of ConstantPacked ConstantPointerNullVal, // This is an instance of ConstantPointerNull +InlineAsmVal, // This is an instance of InlineAsm InstructionVal, // This is an instance of Instruction // Markers: @@ -166,7 +167,7 @@ } // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const Value * /*V*/) { + static inline bool classof(const Value *) { return true; // Values are always values. } Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.67 llvm/include/llvm/Module.h:1.68 --- llvm/include/llvm/Module.h:1.67 Mon Jan 23 17:02:28 2006 +++ llvm/include/llvm/Module.h Mon Jan 23 22:12:40 2006 @@ -21,6 +21,7 @@ #include "llvm/Function.h" #include "llvm/GlobalVariable.h" +#include "llvm/InlineAsm.h" #include "llvm/ADT/SetVector.h" #include "llvm/Support
[llvm-commits] CVS: llvm/include/llvm/CodeGen/DwarfWriter.h
Changes in directory llvm/include/llvm/CodeGen: DwarfWriter.h updated: 1.15 -> 1.16 --- Log message: Crude Dwarf global variable debugging. --- Diffs of the changes: (+50 -29) DwarfWriter.h | 79 -- 1 files changed, 50 insertions(+), 29 deletions(-) Index: llvm/include/llvm/CodeGen/DwarfWriter.h diff -u llvm/include/llvm/CodeGen/DwarfWriter.h:1.15 llvm/include/llvm/CodeGen/DwarfWriter.h:1.16 --- llvm/include/llvm/CodeGen/DwarfWriter.h:1.15Fri Jan 20 19:13:18 2006 +++ llvm/include/llvm/CodeGen/DwarfWriter.h Mon Jan 23 18:49:18 2006 @@ -445,13 +445,17 @@ class DwarfWriter; class DWContext; class MachineDebugInfo; + class MachineFunction; + class Module; + class Type; //======// // DWLabel - Labels are used to track locations in the assembler file. // Labels appear in the form debug_, where the tag is a // category of label (Ex. location) and number is a value unique in that // category. - struct DWLabel { + class DWLabel { + public: const char *Tag;// Label category tag. Should always be // a staticly declared C string. unsignedNumber; // Unique number. @@ -620,15 +624,15 @@ }; //======// - // DIELabel - A simple label expression DIE. + // DIEDwarfLabel - A Dwarf internal label expression DIE. // - struct DIELabel : public DIEValue { + struct DIEDwarfLabel : public DIEValue { const DWLabel Label; -DIELabel(const DWLabel &L) : DIEValue(isLabel), Label(L) {} +DIEDwarfLabel(const DWLabel &L) : DIEValue(isLabel), Label(L) {} // Implement isa/cast/dyncast. -static bool classof(const DIELabel *) { return true; } +static bool classof(const DIEDwarfLabel *) { return true; } static bool classof(const DIEValue *L) { return L->Type == isLabel; } /// EmitValue - Emit label value. @@ -642,15 +646,15 @@ //======// - // DIEAsIsLabel - An exact name of a label. + // DIEObjectLabel - A label to an object in code or data. // - struct DIEAsIsLabel : public DIEValue { + struct DIEObjectLabel : public DIEValue { const std::string Label; -DIEAsIsLabel(const std::string &L) : DIEValue(isAsIsLabel), Label(L) {} +DIEObjectLabel(const std::string &L) : DIEValue(isAsIsLabel), Label(L) {} // Implement isa/cast/dyncast. -static bool classof(const DIEAsIsLabel *) { return true; } +static bool classof(const DIEObjectLabel *) { return true; } static bool classof(const DIEValue *L){ return L->Type == isAsIsLabel; } /// EmitValue - Emit label value. @@ -752,10 +756,10 @@ /// void AddLabel(unsigned Attribute, unsigned Form, const DWLabel &Label); -/// AddAsIsLabel - Add a non-Dwarf label attribute data and value. +/// AddObjectLabel - Add a non-Dwarf label attribute data and value. /// -void AddAsIsLabel(unsigned Attribute, unsigned Form, - const std::string &Label); +void AddObjectLabel(unsigned Attribute, unsigned Form, +const std::string &Label); /// AddDelta - Add a label delta attribute data and value. /// @@ -781,13 +785,15 @@ class DWContext { private: DwarfWriter &DW;// DwarfWriter for global information. +DWContext *Parent; // Next context level searched. DIE *Owner; // Owning debug information entry. -std::map Types; // Named types in context. +std::map Types; // Named types in context. std::map Variables;// Named variables in context. public: -DWContext(DwarfWriter &D, DIE *O) +DWContext(DwarfWriter &D, DWContext *P, DIE *O) : DW(D) +, Parent(P) , Owner(O) , Types() , Variables() @@ -796,16 +802,15 @@ } ~DWContext() {} -/// NewBasicType - Creates a new basic type, if necessary, then adds in the +/// NewBasicType - Creates a new basic type, if necessary, then adds to the /// context and owner. -DIE *NewBasicType(const std::string &Name, unsigned Size, - unsigned Encoding); +DIE *NewBasicType(const Type *Ty, unsigned Size, unsigned Align); -/// NewVariable - Creates a basic variable, if necessary, then adds in the +/// NewVariable - Creates a basic variable, if necessary, then adds to the /// context and owner. -DIE *NewVariable(const std::string &Name, - unsigned SourceFileID, unsigned Line, - DIE *Type, bool IsExternal); +DIE *NewGlobalVariable(const std::string &N
[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.12 -> 1.13 --- Log message: Crude Dwarf global variable debugging. --- Diffs of the changes: (+246 -136) DwarfWriter.cpp | 382 1 files changed, 246 insertions(+), 136 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.12 llvm/lib/CodeGen/DwarfWriter.cpp:1.13 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.12 Fri Jan 20 19:13:18 2006 +++ llvm/lib/CodeGen/DwarfWriter.cppMon Jan 23 18:49:18 2006 @@ -14,9 +14,13 @@ #include "llvm/CodeGen/DwarfWriter.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Module.h" +#include "llvm/Type.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/MachineDebugInfo.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Mangler.h" +#include "llvm/Target/TargetMachine.h" #include @@ -588,7 +592,7 @@ if (ChildrenFlag != DA.ChildrenFlag) return false; if (Data.size() != DA.Data.size()) return false; - for (unsigned i = 0, N = Data.size(); i < N; i++) { + for (unsigned i = 0, N = Data.size(); i < N; ++i) { if (Data[i] != DA.Data[i]) return false; } @@ -602,7 +606,7 @@ if (ChildrenFlag != DA.ChildrenFlag) return ChildrenFlag < DA.ChildrenFlag; if (Data.size() != DA.Data.size()) return Data.size() < DA.Data.size(); - for (unsigned i = 0, N = Data.size(); i < N; i++) { + for (unsigned i = 0, N = Data.size(); i < N; ++i) { if (Data[i] != DA.Data[i]) return Data[i] < DA.Data[i]; } @@ -621,7 +625,7 @@ DW.EOL(ChildrenString(ChildrenFlag)); // For each attribute description. - for (unsigned i = 0, N = Data.size(); i < N; i++) { + for (unsigned i = 0, N = Data.size(); i < N; ++i) { const DIEAbbrevData &AttrData = Data[i]; // Emit attribute type. @@ -648,7 +652,7 @@ << ChildrenString(ChildrenFlag) << "\n"; -for (unsigned i = 0, N = Data.size(); i < N; i++) { +for (unsigned i = 0, N = Data.size(); i < N; ++i) { O << " " << AttributeString(Data[i].getAttribute()) << " " @@ -708,13 +712,13 @@ /// EmitValue - Emit label value. /// -void DIELabel::EmitValue(const DwarfWriter &DW, unsigned Form) const { +void DIEDwarfLabel::EmitValue(const DwarfWriter &DW, unsigned Form) const { DW.EmitReference(Label); } /// SizeOf - Determine size of label value in bytes. /// -unsigned DIELabel::SizeOf(const DwarfWriter &DW, unsigned Form) const { +unsigned DIEDwarfLabel::SizeOf(const DwarfWriter &DW, unsigned Form) const { return DW.getAddressSize(); } @@ -722,14 +726,20 @@ /// EmitValue - Emit label value. /// -void DIEAsIsLabel::EmitValue(const DwarfWriter &DW, unsigned Form) const { +void DIEObjectLabel::EmitValue(const DwarfWriter &DW, unsigned Form) const { + DW.EmitByte(sizeof(int8_t) + DW.getAddressSize()); + DW.EOL("DW_FORM_block1 length"); + + DW.EmitByte(DW_OP_addr); + DW.EOL("DW_OP_addr"); + DW.EmitReference(Label); } /// SizeOf - Determine size of label value in bytes. /// -unsigned DIEAsIsLabel::SizeOf(const DwarfWriter &DW, unsigned Form) const { - return DW.getAddressSize(); +unsigned DIEObjectLabel::SizeOf(const DwarfWriter &DW, unsigned Form) const { + return sizeof(int8_t) + sizeof(int8_t) + DW.getAddressSize(); } //===--===// @@ -774,11 +784,11 @@ DIE::~DIE() { if (Abbrev) delete Abbrev; - for (unsigned i = 0, N = Children.size(); i < N; i++) { + for (unsigned i = 0, N = Children.size(); i < N; ++i) { delete Children[i]; } - for (unsigned j = 0, M = Values.size(); j < M; j++) { + for (unsigned j = 0, M = Values.size(); j < M; ++j) { delete Values[j]; } @@ -817,15 +827,15 @@ void DIE::AddLabel(unsigned Attribute, unsigned Form, const DWLabel &Label) { Abbrev->AddAttribute(Attribute, Form); - Values.push_back(new DIELabel(Label)); + Values.push_back(new DIEDwarfLabel(Label)); } -/// AddAsIsLabel - Add an non-Dwarf label attribute data and value. +/// AddObjectLabel - Add an non-Dwarf label attribute data and value. /// -void DIE::AddAsIsLabel(unsigned Attribute, unsigned Form, - const std::string &Label) { +void DIE::AddObjectLabel(unsigned Attribute, unsigned Form, + const std::string &Label) { Abbrev->AddAttribute(Attribute, Form); - Values.push_back(new DIEAsIsLabel(Label)); + Values.push_back(new DIEObjectLabel(Label)); } /// AddDelta - Add a label delta attribute data and value. @@ -860,67 +870,112 @@ //===--===// -/// NewBasicType - Creates a new basic type if necessary, then adds in the +/// NewBasicType - Creates a new basic type if necessary, then adds to the /// context and owner. -DIE *DWContext::NewBasicType(const std::str
[llvm-commits] CVS: llvm/test/Feature/inlineasm.ll
Changes in directory llvm/test/Feature: inlineasm.ll updated: 1.1 -> 1.2 --- Log message: minor syntax change --- Diffs of the changes: (+2 -2) inlineasm.ll |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Feature/inlineasm.ll diff -u llvm/test/Feature/inlineasm.ll:1.1 llvm/test/Feature/inlineasm.ll:1.2 --- llvm/test/Feature/inlineasm.ll:1.1 Mon Jan 23 17:24:13 2006 +++ llvm/test/Feature/inlineasm.ll Mon Jan 23 18:37:20 2006 @@ -3,6 +3,6 @@ ; RUN: diff Output/t1.ll Output/t2.ll -asm "this is an inline asm block" -asm "this is another inline asm block" +module asm "this is an inline asm block" +module asm "this is another inline asm block" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.141 -> 1.142 --- Log message: Crude Dwarf global variable debugging. --- Diffs of the changes: (+4 -4) PPCAsmPrinter.cpp |8 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.141 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.142 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.141 Sun Jan 22 17:37:17 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Mon Jan 23 18:49:18 2006 @@ -438,7 +438,7 @@ O << "\n\n"; // Emit pre-function debug information. - DW.BeginFunction(); + DW.BeginFunction(MF); // Print out constants referenced by the function EmitConstantPool(MF.getConstantPool()); @@ -486,7 +486,7 @@ } // Emit post-function debug information. - DW.EndFunction(); + DW.EndFunction(MF); // We didn't modify anything. return false; @@ -502,7 +502,7 @@ Mang->setUseQuotes(true); // Emit initial debug information. - DW.BeginModule(); + DW.BeginModule(M); return false; } @@ -619,7 +619,7 @@ } // Emit initial debug information. - DW.EndModule(); + DW.EndModule(M); // Funny Darwin hack: This flag tells the linker that no global symbols // contain code that falls through to other global symbols (e.g. the obvious ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Lexer.l
Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.246 -> 1.247 Lexer.l updated: 1.69 -> 1.70 --- Log message: syntax change --- Diffs of the changes: (+4 -3) Lexer.l |1 + llvmAsmParser.y |6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.246 llvm/lib/AsmParser/llvmAsmParser.y:1.247 --- llvm/lib/AsmParser/llvmAsmParser.y:1.246Mon Jan 23 17:05:15 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Jan 23 18:40:17 2006 @@ -967,7 +967,7 @@ %token DECLARE GLOBAL CONSTANT SECTION VOLATILE %token TO DOTDOTDOT NULL_TOK UNDEF CONST INTERNAL LINKONCE WEAK APPENDING %token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG ALIGN -%token DEPLIBS CALL TAIL ASM_TOK +%token DEPLIBS CALL TAIL ASM_TOK MODULE %token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK %type OptCallingConv @@ -1571,7 +1571,7 @@ | FunctionList FunctionProto { $$ = $1; } - | FunctionList ASM_TOK AsmBlock { + | FunctionList MODULE ASM_TOK AsmBlock { $$ = $1; } | FunctionList IMPLEMENTATION { @@ -1612,7 +1612,7 @@ } | ConstPool FunctionProto { // Function prototypes can be in const pool } - | ConstPool ASM_TOK AsmBlock {// Asm blocks can be in the const pool + | ConstPool MODULE ASM_TOK AsmBlock { // Asm blocks can be in the const pool } | ConstPool OptAssign OptLinkage GlobalType ConstVal { if ($5 == 0) ThrowException("Global value initializer is not a constant!"); Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.69 llvm/lib/AsmParser/Lexer.l:1.70 --- llvm/lib/AsmParser/Lexer.l:1.69 Mon Jan 23 17:05:15 2006 +++ llvm/lib/AsmParser/Lexer.l Mon Jan 23 18:40:17 2006 @@ -212,6 +212,7 @@ volatile{ return VOLATILE; } align { return ALIGN; } section { return SECTION; } +module { return MODULE; } asm { return ASM_TOK; } cc { return CC_TOK; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.187 -> 1.188 --- Log message: Pretty print file-scope asm blocks. --- Diffs of the changes: (+15 -1) AsmWriter.cpp | 16 +++- 1 files changed, 15 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.187 llvm/lib/VMCore/AsmWriter.cpp:1.188 --- llvm/lib/VMCore/AsmWriter.cpp:1.187 Mon Jan 23 18:37:56 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Jan 23 18:45:30 2006 @@ -776,8 +776,22 @@ Out << "target triple = \"" << M->getTargetTriple() << "\"\n"; if (!M->getInlineAsm().empty()) { +// Split the string into lines, to make it easier to read the .ll file. +std::string Asm = M->getInlineAsm(); +size_t CurPos = 0; +size_t NewLine = Asm.find_first_of('\n', CurPos); +while (NewLine != std::string::npos) { + // We found a newline, print the portion of the asm string from the + // last newline up to this newline. + Out << "module asm \""; + PrintEscapedString(std::string(Asm.begin()+CurPos, Asm.begin()+NewLine), + Out); + Out << "\"\n"; + CurPos = NewLine+1; + NewLine = Asm.find_first_of('\n', CurPos); +} Out << "module asm \""; -PrintEscapedString(M->getInlineAsm(), Out); +PrintEscapedString(std::string(Asm.begin()+CurPos, Asm.end()), Out); Out << "\"\n"; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.132 -> 1.133 --- Log message: minor syntax change --- Diffs of the changes: (+3 -3) LangRef.html |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.132 llvm/docs/LangRef.html:1.133 --- llvm/docs/LangRef.html:1.132Mon Jan 23 17:23:47 2006 +++ llvm/docs/LangRef.html Mon Jan 23 18:37:10 2006 @@ -595,8 +595,8 @@ - asm "inline asm code goes here" - asm "more can go here" + module asm "inline asm code goes here" + module asm "more can go here" The strings can contain any character by escaping non-printable characters. @@ -3679,7 +3679,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.cs.uiuc.edu";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/01/23 23:23:47 $ + Last modified: $Date: 2006/01/24 00:37:10 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.186 -> 1.187 --- Log message: syntax change --- Diffs of the changes: (+1 -1) AsmWriter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.186 llvm/lib/VMCore/AsmWriter.cpp:1.187 --- llvm/lib/VMCore/AsmWriter.cpp:1.186 Mon Jan 23 17:03:36 2006 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Jan 23 18:37:56 2006 @@ -776,7 +776,7 @@ Out << "target triple = \"" << M->getTargetTriple() << "\"\n"; if (!M->getInlineAsm().empty()) { -Out << "asm \""; +Out << "module asm \""; PrintEscapedString(M->getInlineAsm(), Out); Out << "\"\n"; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.37 -> 1.38 --- Log message: Print file-scope inline asm blocks at the start of the output file. --- Diffs of the changes: (+5 -0) AsmPrinter.cpp |5 + 1 files changed, 5 insertions(+) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.37 llvm/lib/CodeGen/AsmPrinter.cpp:1.38 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.37Thu Jan 12 13:17:23 2006 +++ llvm/lib/CodeGen/AsmPrinter.cpp Mon Jan 23 17:47:53 2006 @@ -71,6 +71,11 @@ bool AsmPrinter::doInitialization(Module &M) { Mang = new Mangler(M, GlobalPrefix); + + if (!M.getInlineAsm().empty()) +O << CommentString << " Start File Scope Asm Blocks:\n" << M.getInlineAsm() + << "\n" << CommentString << " End File Scope Asm Blocks\n"; + SwitchSection("", 0); // Reset back to no section. return false; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.182 -> 1.183 --- Log message: Add support for reading/writing inline asm --- Diffs of the changes: (+5 -1) Reader.cpp |6 +- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.182 llvm/lib/Bytecode/Reader/Reader.cpp:1.183 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.182 Mon Jan 23 02:11:03 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Jan 23 17:43:17 2006 @@ -2102,12 +2102,16 @@ if (Handler) Handler->handleTargetTriple(triple); -if (At != BlockEnd && !hasAlignment) { +if (!hasAlignment && At != BlockEnd) { // If the file has section info in it, read the section names now. unsigned NumSections = read_vbr_uint(); while (NumSections--) SectionNames.push_back(read_str()); } + +// If the file has module-level inline asm, read it now. +if (!hasAlignment && At != BlockEnd) + TheModule->setInlineAsm(read_str()); } // If any globals are in specified sections, assign them now. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp
Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.116 -> 1.117 --- Log message: Add support for reading/writing inline asm --- Diffs of the changes: (+3 -0) Writer.cpp |3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.116 llvm/lib/Bytecode/Writer/Writer.cpp:1.117 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.116 Sat Nov 12 12:34:09 2005 +++ llvm/lib/Bytecode/Writer/Writer.cpp Mon Jan 23 17:43:17 2006 @@ -1030,6 +1030,9 @@ output_vbr((unsigned)SectionNames.size()); for (unsigned i = 0, e = SectionNames.size(); i != e; ++i) output(SectionNames[i]); + + // Output the inline asm string. + output(M->getInlineAsm()); } void BytecodeWriter::outputInstructions(const Function *F) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/BytecodeFormat.html
Changes in directory llvm/docs: BytecodeFormat.html updated: 1.48 -> 1.49 --- Log message: Update for file-scope inline asm --- Diffs of the changes: (+12 -15) BytecodeFormat.html | 27 --- 1 files changed, 12 insertions(+), 15 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.48 llvm/docs/BytecodeFormat.html:1.49 --- llvm/docs/BytecodeFormat.html:1.48 Fri Nov 11 19:46:21 2005 +++ llvm/docs/BytecodeFormat.html Mon Jan 23 17:38:09 2006 @@ -955,8 +955,7 @@ block - Module global info identifier (0x05) + size - + Module global info identifier (0x05) + size zlist(globalvar) @@ -969,28 +968,26 @@ occurring in the module. - llist(string) - + llist(string) A length list of strings that specify the names of the libraries that this module -depends upon. - +depends upon. - string - + string The target triple for the module (blank means no target triple specified, i.e. a -platform independent module). - +platform independent module). - llist(string) - + llist(string) A length list of strings that defines a table of section strings for globals. A global's -SectionID is an index into this table. - +SectionID is an index into this table. + + + string + The inline asm block for this module. @@ -2099,7 +2096,7 @@ mailto:[EMAIL PROTECTED]">Reid Spencer and mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.cs.uiuc.edu";>The LLVM Compiler Infrastructure -Last modified: $Date: 2005/11/12 01:46:21 $ +Last modified: $Date: 2006/01/23 23:38:09 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.131 -> 1.132 --- Log message: document module-level inline asm support. --- Diffs of the changes: (+31 -2) LangRef.html | 33 +++-- 1 files changed, 31 insertions(+), 2 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.131 llvm/docs/LangRef.html:1.132 --- llvm/docs/LangRef.html:1.131Mon Jan 16 16:38:59 2006 +++ llvm/docs/LangRef.html Mon Jan 23 17:23:47 2006 @@ -23,7 +23,8 @@ Linkage Types Calling Conventions Global Variables - Function Structure + Functions + Module-Level Inline Assembly Type System @@ -580,6 +581,34 @@ + + + Module-Level Inline Assembly + + + + +Modules may contain "module-level inline asm" blocks, which corresponds to the +GCC "file scope inline asm" blocks. These blocks are internally concatenated by +LLVM and treated as a single unit, but may be separated in the .ll file if +desired. The syntax is very simple: + + + + asm "inline asm code goes here" + asm "more can go here" + + +The strings can contain any character by escaping non-printable characters. + The escape sequence used is simply "\xx" where "xx" is the two digit hex code + for the number. + + + + The inline asm code is simply printed to the machine code .s file when + assembly code is generated. + + @@ -3650,7 +3679,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.cs.uiuc.edu";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/01/16 22:38:59 $ + Last modified: $Date: 2006/01/23 23:23:47 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Feature/inlineasm.ll
Changes in directory llvm/test/Feature: inlineasm.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+8 -0) inlineasm.ll |8 1 files changed, 8 insertions(+) Index: llvm/test/Feature/inlineasm.ll diff -c /dev/null llvm/test/Feature/inlineasm.ll:1.1 *** /dev/null Mon Jan 23 17:24:23 2006 --- llvm/test/Feature/inlineasm.ll Mon Jan 23 17:24:13 2006 *** *** 0 --- 1,8 + ; RUN: llvm-as %s -o - | llvm-dis > Output/t1.ll + ; RUN: llvm-as Output/t1.ll -o - | llvm-dis > Output/t2.ll + ; RUN: diff Output/t1.ll Output/t2.ll + + + asm "this is an inline asm block" + asm "this is another inline asm block" + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneModule.cpp
Changes in directory llvm/lib/Transforms/Utils: CloneModule.cpp updated: 1.15 -> 1.16 --- Log message: When cloning a module, clone the inline asm. --- Diffs of the changes: (+1 -0) CloneModule.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Transforms/Utils/CloneModule.cpp diff -u llvm/lib/Transforms/Utils/CloneModule.cpp:1.15 llvm/lib/Transforms/Utils/CloneModule.cpp:1.16 --- llvm/lib/Transforms/Utils/CloneModule.cpp:1.15 Wed Jan 18 15:32:45 2006 +++ llvm/lib/Transforms/Utils/CloneModule.cpp Mon Jan 23 17:06:28 2006 @@ -31,6 +31,7 @@ New->setEndianness(M->getEndianness()); New->setPointerSize(M->getPointerSize()); New->setTargetTriple(M->getTargetTriple()); + New->setInlineAsm(M->getInlineAsm()); // Copy all of the type symbol table entries over. const SymbolTable &SymTab = M->getSymbolTable(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp
Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.109 -> 1.110 --- Log message: Add support for linking inline asm --- Diffs of the changes: (+7 -0) LinkModules.cpp |7 +++ 1 files changed, 7 insertions(+) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.109 llvm/lib/Linker/LinkModules.cpp:1.110 --- llvm/lib/Linker/LinkModules.cpp:1.109 Thu Jan 19 17:15:58 2006 +++ llvm/lib/Linker/LinkModules.cpp Mon Jan 23 17:08:37 2006 @@ -833,6 +833,13 @@ Dest->getTargetTriple() != Src->getTargetTriple()) std::cerr << "WARNING: Linking two modules of different target triples!\n"; + if (!Src->getInlineAsm().empty()) { +if (Dest->getInlineAsm().empty()) + Dest->setInlineAsm(Src->getInlineAsm()); +else + Dest->setInlineAsm(Dest->getInlineAsm()+"\n"+Src->getInlineAsm()); + } + // Update the destination module's dependent libraries list with the libraries // from the source module. There's no opportunity for duplicates here as the // Module ensures that duplicate insertions are discarded. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/AsmParser/Lexer.l llvmAsmParser.y
Changes in directory llvm/lib/AsmParser: Lexer.l updated: 1.68 -> 1.69 llvmAsmParser.y updated: 1.245 -> 1.246 --- Log message: Add support for parsing global asm blocks --- Diffs of the changes: (+22 -4) Lexer.l |1 + llvmAsmParser.y | 25 + 2 files changed, 22 insertions(+), 4 deletions(-) Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.68 llvm/lib/AsmParser/Lexer.l:1.69 --- llvm/lib/AsmParser/Lexer.l:1.68 Tue Jan 17 14:06:24 2006 +++ llvm/lib/AsmParser/Lexer.l Mon Jan 23 17:05:15 2006 @@ -212,6 +212,7 @@ volatile{ return VOLATILE; } align { return ALIGN; } section { return SECTION; } +asm { return ASM_TOK; } cc { return CC_TOK; } ccc { return CCC_TOK; } Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.245 llvm/lib/AsmParser/llvmAsmParser.y:1.246 --- llvm/lib/AsmParser/llvmAsmParser.y:1.245Wed Jan 18 19:21:04 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Jan 23 17:05:15 2006 @@ -967,7 +967,7 @@ %token DECLARE GLOBAL CONSTANT SECTION VOLATILE %token TO DOTDOTDOT NULL_TOK UNDEF CONST INTERNAL LINKONCE WEAK APPENDING %token OPAQUE NOT EXTERNAL TARGET TRIPLE ENDIAN POINTERSIZE LITTLE BIG ALIGN -%token DEPLIBS CALL TAIL +%token DEPLIBS CALL TAIL ASM_TOK %token CC_TOK CCC_TOK FASTCC_TOK COLDCC_TOK %type OptCallingConv @@ -1256,11 +1256,12 @@ " when array has size " + itostr(NumElements) + "!"); std::vector Vals; if (ETy == Type::SByteTy) { - for (char *C = $3; C != EndStr; ++C) + for (signed char *C = (signed char *)$3; C != (signed char *)EndStr; ++C) Vals.push_back(ConstantSInt::get(ETy, *C)); } else if (ETy == Type::UByteTy) { - for (char *C = $3; C != EndStr; ++C) -Vals.push_back(ConstantUInt::get(ETy, (unsigned char)*C)); + for (unsigned char *C = (unsigned char *)$3; + C != (unsigned char*)EndStr; ++C) +Vals.push_back(ConstantUInt::get(ETy, *C)); } else { free($3); ThrowException("Cannot build string arrays of non byte sized elements!"); @@ -1570,6 +1571,9 @@ | FunctionList FunctionProto { $$ = $1; } + | FunctionList ASM_TOK AsmBlock { +$$ = $1; + } | FunctionList IMPLEMENTATION { $$ = $1; } @@ -1608,6 +1612,8 @@ } | ConstPool FunctionProto { // Function prototypes can be in const pool } + | ConstPool ASM_TOK AsmBlock {// Asm blocks can be in the const pool + } | ConstPool OptAssign OptLinkage GlobalType ConstVal { if ($5 == 0) ThrowException("Global value initializer is not a constant!"); CurGV = ParseGlobalVariable($2, $3, $4, $5->getType(), $5); @@ -1629,6 +1635,17 @@ }; +AsmBlock : STRINGCONSTANT { + const std::string &AsmSoFar = CurModule.CurrentModule->getInlineAsm(); + char *EndStr = UnEscapeLexed($1, true); + std::string NewAsm($1, EndStr); + free($1); + + if (AsmSoFar.empty()) +CurModule.CurrentModule->setInlineAsm(NewAsm); + else +CurModule.CurrentModule->setInlineAsm(AsmSoFar+"\n"+NewAsm); +}; BigOrLittle : BIG{ $$ = Module::BigEndian; }; BigOrLittle : LITTLE { $$ = Module::LittleEndian; }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp
Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.185 -> 1.186 --- Log message: Print out inline asm strings --- Diffs of the changes: (+23 -22) AsmWriter.cpp | 45 +++-- 1 files changed, 23 insertions(+), 22 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.185 llvm/lib/VMCore/AsmWriter.cpp:1.186 --- llvm/lib/VMCore/AsmWriter.cpp:1.185 Fri Nov 11 18:10:19 2005 +++ llvm/lib/VMCore/AsmWriter.cpp Mon Jan 23 17:03:36 2006 @@ -398,6 +398,21 @@ } } +// PrintEscapedString - Print each character of the specified string, escaping +// it if it is not printable or if it is an escape char. +static void PrintEscapedString(const std::string &Str, std::ostream &Out) { + for (unsigned i = 0, e = Str.size(); i != e; ++i) { +unsigned char C = Str[i]; +if (isprint(C) && C != '"' && C != '\\') { + Out << C; +} else { + Out << '\\' + << (char) ((C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A')) + << (char)(((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A')); +} + } +} + /// @brief Internal constant writer. static void WriteConstantInt(std::ostream &Out, const Constant *CV, bool PrintName, @@ -443,29 +458,9 @@ // ubytes or an array of sbytes with positive values. // const Type *ETy = CA->getType()->getElementType(); -bool isString = (ETy == Type::SByteTy || ETy == Type::UByteTy); - -if (ETy == Type::SByteTy) - for (unsigned i = 0; i < CA->getNumOperands(); ++i) -if (cast(CA->getOperand(i))->getValue() < 0) { - isString = false; - break; -} - -if (isString) { +if (CA->isString()) { Out << "c\""; - for (unsigned i = 0; i < CA->getNumOperands(); ++i) { -unsigned char C = - (unsigned char)cast(CA->getOperand(i))->getRawValue(); - -if (isprint(C) && C != '"' && C != '\\') { - Out << C; -} else { - Out << '\\' - << (char) ((C/16 < 10) ? ( C/16 +'0') : ( C/16 -10+'A')) - << (char)(((C&15) < 10) ? ((C&15)+'0') : ((C&15)-10+'A')); -} - } + PrintEscapedString(CA->getAsString(), Out); Out << "\""; } else {// Cannot output in string format... @@ -780,6 +775,12 @@ if (!M->getTargetTriple().empty()) Out << "target triple = \"" << M->getTargetTriple() << "\"\n"; + if (!M->getInlineAsm().empty()) { +Out << "asm \""; +PrintEscapedString(M->getInlineAsm(), Out); +Out << "\"\n"; + } + // Loop over the dependent libraries and emit them. Module::lib_iterator LI = M->lib_begin(); Module::lib_iterator LE = M->lib_end(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Module.h
Changes in directory llvm/include/llvm: Module.h updated: 1.66 -> 1.67 --- Log message: Add global scope asm support --- Diffs of the changes: (+5 -1) Module.h |6 +- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.66 llvm/include/llvm/Module.h:1.67 --- llvm/include/llvm/Module.h:1.66 Sat Jan 7 20:32:52 2006 +++ llvm/include/llvm/Module.h Mon Jan 23 17:02:28 2006 @@ -70,10 +70,10 @@ GlobalListType GlobalList; // The Global Variables in the module FunctionListType FunctionList; // The Functions in the module LibraryListType LibraryList; // The Libraries needed by the module + std::string GlobalScopeAsm;// Inline Asm at global scope. SymbolTable *SymTab; // Symbol Table for the module std::string ModuleID; // Human readable identifier for the module std::string TargetTriple; // Platform target triple Module compiled on - Endianness Endian; // Endianness assumed in the module PointerSize PtrSize;// Pointer size assumed in the module @@ -97,6 +97,10 @@ PointerSize getPointerSize() const { return PtrSize; } void setPointerSize(PointerSize PS) { PtrSize = PS; } + // Access to any module-scope inline asm blocks. + const std::string &getInlineAsm() const { return GlobalScopeAsm; } + void setInlineAsm(const std::string &Asm) { GlobalScopeAsm = Asm; } + //======// // Methods for easy access to the functions in the module. // ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.241 -> 1.242 --- Log message: another couple selects --- Diffs of the changes: (+22 -0) SelectionDAG.cpp | 22 ++ 1 files changed, 22 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.241 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.242 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.241Mon Jan 23 14:59:12 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jan 23 15:51:14 2006 @@ -1671,6 +1671,28 @@ ON = N; // Memoize the new node. return SDOperand(N, 0); } +SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3,SDOperand Op4, + SDOperand Op5, SDOperand Op6, +SDOperand Op7, SDOperand Op8) { + // If an identical node already exists, use it. + std::vector OpList; + OpList.push_back(Op1); OpList.push_back(Op2); OpList.push_back(Op3); + OpList.push_back(Op4); OpList.push_back(Op5); OpList.push_back(Op6); + OpList.push_back(Op7); OpList.push_back(Op8); + SDNode *&ON = OneResultNodes[std::make_pair(ISD::BUILTIN_OP_END+TargetOpc, + std::make_pair(VT, OpList))]; + if (ON) return SDOperand(ON, 0); + + RemoveNodeFromCSEMaps(N); + N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); + N->setValueTypes(VT); + N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8); + + ON = N; // Memoize the new node. + return SDOperand(N, 0); +} SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/Makefile.programs
Changes in directory llvm-test: Makefile.programs updated: 1.185 -> 1.186 --- Log message: change alpha beta to lsmark --- Diffs of the changes: (+1 -1) Makefile.programs |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.185 llvm-test/Makefile.programs:1.186 --- llvm-test/Makefile.programs:1.185 Thu Jan 19 08:17:29 2006 +++ llvm-test/Makefile.programs Mon Jan 23 15:57:27 2006 @@ -190,7 +190,7 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),Alpha) -LLCBETAOPTION := -disable-alpha-dag-isel +LLCBETAOPTION := -enable-alpha-lsmark # -enable-alpha-FTOI -enable-alpha-intfpdiv endif ifeq ($(ARCH),IA64) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp AlphaISelLowering.h AlphaInstrInfo.td
Changes in directory llvm/lib/Target/Alpha: AlphaISelLowering.cpp updated: 1.26 -> 1.27 AlphaISelLowering.h updated: 1.10 -> 1.11 AlphaInstrInfo.td updated: 1.106 -> 1.107 --- Log message: added stores to lsmark --- Diffs of the changes: (+74 -4) AlphaISelLowering.cpp | 51 ++ AlphaISelLowering.h |2 - AlphaInstrInfo.td | 25 +--- 3 files changed, 74 insertions(+), 4 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.26 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.27 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.26Mon Jan 23 15:23:26 2006 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Mon Jan 23 15:51:33 2006 @@ -166,6 +166,12 @@ case AlphaISD::LDL_: return "Alpha::LDL_"; case AlphaISD::LDWU_: return "Alpha::LDWU_"; case AlphaISD::LDBU_: return "Alpha::LDBU_"; + case AlphaISD::STQ_: return "Alpha::STQ_"; + case AlphaISD::STT_: return "Alpha::STT_"; + case AlphaISD::STS_: return "Alpha::STS_"; + case AlphaISD::STL_: return "Alpha::STL_"; + case AlphaISD::STW_: return "Alpha::STW_"; + case AlphaISD::STB_: return "Alpha::STB_"; } } @@ -631,6 +637,51 @@ return DAG.getNode(Opc, VTS, ARGS); } + case ISD::TRUNCSTORE: + case ISD::STORE: +{ + SDOperand Chain = Op.getOperand(0); + SDOperand Value = Op.getOperand(1); + SDOperand Address = Op.getOperand(2); + + unsigned Opc; + unsigned opcode = Op.getOpcode(); + + if (opcode == ISD::STORE) { +switch(Value.getValueType()) { +default: assert(0 && "unknown Type in store"); +case MVT::i64: Opc = AlphaISD::STQ_; break; +case MVT::f64: Opc = AlphaISD::STT_; break; +case MVT::f32: Opc = AlphaISD::STS_; break; +} + } else { //ISD::TRUNCSTORE +switch(cast(Op.getOperand(4))->getVT()) { +default: assert(0 && "unknown Type in store"); +case MVT::i8: Opc = AlphaISD::STB_; break; +case MVT::i16: Opc = AlphaISD::STW_; break; +case MVT::i32: Opc = AlphaISD::STL_; break; +} + } + + int i, j, k; + getValueInfo(cast(Op.getOperand(3))->getValue(), i, j, k); + + SDOperand Zero = DAG.getConstant(0, MVT::i64); + std::vector VTS; + VTS.push_back(MVT::Other); + std::vector ARGS; + ARGS.push_back(Chain); + ARGS.push_back(Value); + ARGS.push_back(Zero); + ARGS.push_back(Address); + ARGS.push_back(DAG.getConstant(i, MVT::i64)); + ARGS.push_back(DAG.getConstant(j, MVT::i64)); + ARGS.push_back(DAG.getConstant(k, MVT::i64)); + ARGS.push_back(DAG.getConstant(getUID(), MVT::i64)); + return DAG.getNode(Opc, VTS, ARGS); +} + + } return SDOperand(); Index: llvm/lib/Target/Alpha/AlphaISelLowering.h diff -u llvm/lib/Target/Alpha/AlphaISelLowering.h:1.10 llvm/lib/Target/Alpha/AlphaISelLowering.h:1.11 --- llvm/lib/Target/Alpha/AlphaISelLowering.h:1.10 Mon Jan 23 14:59:50 2006 +++ llvm/lib/Target/Alpha/AlphaISelLowering.h Mon Jan 23 15:51:33 2006 @@ -43,7 +43,7 @@ ///LD, ST LDQ_, LDT_, LDS_, LDL_, LDWU_, LDBU_, - + STQ_, STT_, STS_, STL_, STW_, STB_, }; } Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.106 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.107 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.106 Mon Jan 23 15:23:26 2006 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Mon Jan 23 15:51:33 2006 @@ -22,6 +22,9 @@ def SDTLoadA : SDTypeProfile<1, 6, [ // load SDTCisInt<1>, SDTCisPtrTy<2>, SDTCisInt<3>, SDTCisInt<4>, SDTCisInt<5>, SDTCisInt<6> ]>; +def SDTStoreA : SDTypeProfile<0, 7, [ // load + SDTCisInt<1>, SDTCisPtrTy<2>, SDTCisInt<3>, SDTCisInt<4>, SDTCisInt<5>, SDTCisInt<6> +]>; def Alpha_itoft : SDNode<"AlphaISD::ITOFT_",SDTIntToFPOp, []>; def Alpha_ftoit : SDNode<"AlphaISD::FTOIT_",SDTFPToIntOp, []>; @@ -37,6 +40,12 @@ def Alpha_ldl : SDNode<"AlphaISD::LDL_", SDTLoadA, [SDNPHasChain]>; def Alpha_ldwu: SDNode<"AlphaISD::LDWU_", SDTLoadA, [SDNPHasChain]>; def Alpha_ldbu: SDNode<"AlphaISD::LDBU_", SDTLoadA, [SDNPHasChain]>; +def Alpha_stq : SDNode<"AlphaISD::STQ_", SDTStoreA, [SDNPHasChain]>; +def Alpha_stl : SDNode<"AlphaISD::STL_", SDTStoreA, [SDNPHasChain]>; +def Alpha_stw : SDNode<"AlphaISD::STW_", SDTStoreA, [SDNPHasChain]>; +def Alpha_stb : SDNode<"AlphaISD::STB_", SDTStoreA, [SDNPHasChain]>; +def Alpha_sts : SDNode<"AlphaISD::STS_", SDTStoreA, [SDNPHasChain]>; +def Alpha_stt : SDNode<"AlphaISD::STT_", SDTStoreA, [SDNPHasChain]>; // These are target-independent nodes, but have target-specific formats. def SDT_AlphaCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i64> ]>; @@ -442,9 +451,9 @@ [(set GPRC:$RA, (load (add GPRC:$RB, immSExt16:$DISP)))]>;
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.86 -> 1.87 SelectionDAGNodes.h updated: 1.91 -> 1.92 --- Log message: another couple selects --- Diffs of the changes: (+38 -0) SelectionDAG.h | 20 SelectionDAGNodes.h | 18 ++ 2 files changed, 38 insertions(+) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.86 llvm/include/llvm/CodeGen/SelectionDAG.h:1.87 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.86 Mon Jan 23 14:58:48 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Jan 23 15:51:14 2006 @@ -318,6 +318,10 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7); + SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, +SDOperand Op7, SDOperand Op8); SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, @@ -384,6 +388,22 @@ return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops); } SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, + SDOperand Op7, SDOperand Op8) { +std::vector Ops; +Ops.reserve(8); +Ops.push_back(Op1); +Ops.push_back(Op2); +Ops.push_back(Op3); +Ops.push_back(Op4); +Ops.push_back(Op5); +Ops.push_back(Op6); +Ops.push_back(Op7); +Ops.push_back(Op8); +return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops); + } + SDOperand getTargetNode(unsigned Opcode, MVT::ValueType VT, std::vector &Ops) { return getNode(ISD::BUILTIN_OP_END+Opcode, VT, Ops); } Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.91 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.92 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.91 Mon Jan 23 14:58:48 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jan 23 15:51:14 2006 @@ -856,6 +856,24 @@ Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); Op6.Val->Uses.push_back(this); } + void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { +assert(NumOperands == 0 && "Should not have operands yet!"); +OperandList = new SDOperand[8]; +OperandList[0] = Op0; +OperandList[1] = Op1; +OperandList[2] = Op2; +OperandList[3] = Op3; +OperandList[4] = Op4; +OperandList[5] = Op5; +OperandList[6] = Op6; +OperandList[7] = Op7; +NumOperands = 8; +Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); +Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); +Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); +Op6.Val->Uses.push_back(this); Op7.Val->Uses.push_back(this); + } void addUser(SDNode *User) { Uses.push_back(User); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp AlphaTargetMachine.cpp AlphaISelPattern.cpp
Changes in directory llvm/lib/Target/Alpha: AlphaISelLowering.cpp updated: 1.27 -> 1.28 AlphaTargetMachine.cpp updated: 1.20 -> 1.21 AlphaISelPattern.cpp (r1.199) removed --- Log message: bye bye Pattern ISEL --- Diffs of the changes: (+5 -14) AlphaISelLowering.cpp |6 +++--- AlphaTargetMachine.cpp | 13 ++--- 2 files changed, 5 insertions(+), 14 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.27 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.28 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.27Mon Jan 23 15:51:33 2006 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Mon Jan 23 15:56:07 2006 @@ -27,9 +27,9 @@ using namespace llvm; namespace llvm { - extern cl::opt EnableAlphaIDIV; - extern cl::opt EnableAlphaCount; - extern cl::opt EnableAlphaLSMark; + cl::opt EnableAlphaLSMark("enable-alpha-lsmark", +cl::desc("Emit symbols to correlate Mem ops to LLVM Values"), +cl::Hidden); } /// AddLiveIn - This helper function adds the specified physical register to the Index: llvm/lib/Target/Alpha/AlphaTargetMachine.cpp diff -u llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.20 llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.21 --- llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.20 Fri Jan 13 12:49:47 2006 +++ llvm/lib/Target/Alpha/AlphaTargetMachine.cppMon Jan 23 15:56:07 2006 @@ -28,12 +28,6 @@ RegisterTarget X("alpha", " Alpha (incomplete)"); } -namespace llvm { - cl::opt DisableAlphaDAG("disable-alpha-dag-isel", - cl::desc("Disable DAG ISEL for Alpha"), - cl::Hidden); -} - unsigned AlphaTargetMachine::getModuleMatchQuality(const Module &M) { // We strongly match "alpha*". std::string TT = M.getTargetTriple(); @@ -94,10 +88,7 @@ // Make sure that no unreachable blocks are instruction selected. PM.add(createUnreachableBlockEliminationPass()); - if (!DisableAlphaDAG) -PM.add(createAlphaISelDag(*this)); - else -PM.add(createAlphaPatternInstructionSelector(*this)); + PM.add(createAlphaISelDag(*this)); if (PrintMachineCode) PM.add(createMachineFunctionPrinterPass(&std::cerr)); @@ -135,7 +126,7 @@ // Make sure that no unreachable blocks are instruction selected. PM.add(createUnreachableBlockEliminationPass()); - PM.add(createAlphaPatternInstructionSelector(TM)); + PM.add(createAlphaISelDag(TM)); if (PrintMachineCode) PM.add(createMachineFunctionPrinterPass(&std::cerr)); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp AlphaInstrInfo.td
Changes in directory llvm/lib/Target/Alpha: AlphaISelLowering.cpp updated: 1.25 -> 1.26 AlphaInstrInfo.td updated: 1.105 -> 1.106 --- Log message: fix up more lsmark stuff --- Diffs of the changes: (+22 -15) AlphaISelLowering.cpp | 11 ++- AlphaInstrInfo.td | 26 -- 2 files changed, 22 insertions(+), 15 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.25 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.26 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.25Mon Jan 23 14:59:50 2006 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Mon Jan 23 15:23:26 2006 @@ -73,6 +73,14 @@ setOperationAction(ISD::LOAD, MVT::i64, Custom); setOperationAction(ISD::LOAD, MVT::f64, Custom); setOperationAction(ISD::LOAD, MVT::f32, Custom); + +setOperationAction(ISD::ZEXTLOAD, MVT::i8, Custom); +setOperationAction(ISD::ZEXTLOAD, MVT::i16, Custom); +setOperationAction(ISD::SEXTLOAD, MVT::i32, Custom); + +setOperationAction(ISD::EXTLOAD, MVT::i8, Custom); +setOperationAction(ISD::EXTLOAD, MVT::i16, Custom); +setOperationAction(ISD::EXTLOAD, MVT::i32, Custom); } setOperationAction(ISD::FREM, MVT::f32, Expand); @@ -578,6 +586,7 @@ case ISD::LOAD: case ISD::SEXTLOAD: case ISD::ZEXTLOAD: + case ISD::EXTLOAD: { SDOperand Chain = Op.getOperand(0); SDOperand Address = Op.getOperand(1); @@ -612,13 +621,13 @@ VTS.push_back(Op.Val->getValueType(0)); VTS.push_back(MVT::Other); std::vector ARGS; + ARGS.push_back(Chain); ARGS.push_back(Zero); ARGS.push_back(Address); ARGS.push_back(DAG.getConstant(i, MVT::i64)); ARGS.push_back(DAG.getConstant(j, MVT::i64)); ARGS.push_back(DAG.getConstant(k, MVT::i64)); ARGS.push_back(DAG.getConstant(getUID(), MVT::i64)); - ARGS.push_back(Chain); return DAG.getNode(Opc, VTS, ARGS); } Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.105 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.106 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.105 Mon Jan 23 14:59:50 2006 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Mon Jan 23 15:23:26 2006 @@ -31,12 +31,12 @@ def Alpha_gprello : SDNode<"AlphaISD::GPRelLo", SDTIntBinOp, []>; def Alpha_gprelhi : SDNode<"AlphaISD::GPRelHi", SDTIntBinOp, []>; def Alpha_rellit : SDNode<"AlphaISD::RelLit",SDTIntBinOp, []>; -def Alpha_ldq : SDNode<"AlphaISD::LDQ_", SDTLoadA, [SDNPInFlag]>; -def Alpha_ldt : SDNode<"AlphaISD::LDT_", SDTLoadA, [SDNPInFlag]>; -def Alpha_lds : SDNode<"AlphaISD::LDS_", SDTLoadA, [SDNPInFlag]>; -def Alpha_ldl : SDNode<"AlphaISD::LDL_", SDTLoadA, [SDNPInFlag]>; -def Alpha_ldwu: SDNode<"AlphaISD::LDWU_", SDTLoadA, [SDNPInFlag]>; -def Alpha_ldbu: SDNode<"AlphaISD::LDBU_", SDTLoadA, [SDNPInFlag]>; +def Alpha_ldq : SDNode<"AlphaISD::LDQ_", SDTLoadA, [SDNPHasChain]>; +def Alpha_ldt : SDNode<"AlphaISD::LDT_", SDTLoadA, [SDNPHasChain]>; +def Alpha_lds : SDNode<"AlphaISD::LDS_", SDTLoadA, [SDNPHasChain]>; +def Alpha_ldl : SDNode<"AlphaISD::LDL_", SDTLoadA, [SDNPHasChain]>; +def Alpha_ldwu: SDNode<"AlphaISD::LDWU_", SDTLoadA, [SDNPHasChain]>; +def Alpha_ldbu: SDNode<"AlphaISD::LDBU_", SDTLoadA, [SDNPHasChain]>; // These are target-independent nodes, but have target-specific formats. def SDT_AlphaCallSeq : SDTypeProfile<0, 1, [ SDTCisVT<0, i64> ]>; @@ -123,7 +123,6 @@ } def ALTENT : PseudoInstAlpha<(ops s64imm:$TARGET), "$$$TARGET..ng:\n", []>; def PCLABEL : PseudoInstAlpha<(ops s64imm:$num), "PCMARKER_$num:\n",[]>; -let noResults = 1 in def MEMLABEL : PseudoInstAlpha<(ops s64imm:$i, s64imm:$j, s64imm:$k, s64imm:$m), "LSMARKER$$$i$$$j$$$k$$$m:", []>; @@ -584,6 +583,12 @@ s64imm:$i, s64imm:$j, s64imm:$k, s64imm:$m) in { def LDQlbl : MForm<0x29, 0, 1, "LSMARKER$$$i$$$j$$$k$$$m:\n\t ldq $RA,$DISP($RB)", [(set GPRC:$RA, (Alpha_ldq imm:$DISP, GPRC:$RB, imm:$i, imm:$j, imm:$k, imm:$m))]>; +def LDLlbl : MForm<0x29, 0, 1, "LSMARKER$$$i$$$j$$$k$$$m:\n\t ldl $RA,$DISP($RB)", + [(set GPRC:$RA, (Alpha_ldl imm:$DISP, GPRC:$RB, imm:$i, imm:$j, imm:$k, imm:$m))]>; +def LDBUlbl : MForm<0x0A, 0, 1, "LSMARKER$$$i$$$j$$$k$$$m:\n\t ldbu $RA,$DISP($RB)", + [(set GPRC:$RA, (Alpha_ldwu imm:$DISP, GPRC:$RB, imm:$i, imm:$j, imm:$k, imm:$m))]>; +def LDWUlbl : MForm<0x0C, 0, 1, "LSMARKER$$$i$$$j$$$k$$$m:\n\t ldwu $RA,$DISP($RB)", + [(set GPRC:$RA, (Alpha_ldbu imm:$DISP, GPRC:$RB, imm:$i, imm:$j, imm:$k, imm:$m))]>; } let OperandList = (ops F8RC:$RA, s64imm:$DISP, GPRC:$RB, @@ -596,13 +601,6 @@ def LDSlbl : MForm<0x29, 0, 1, "LSMARKER$$$i$$$j$$$k$$$m:\n\t lds $RA,$DISP($RB)", [(set F4RC:$RA, (Alpha_lds imm:$DIS
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.85 -> 1.86 SelectionDAGNodes.h updated: 1.90 -> 1.91 --- Log message: another selectto --- Diffs of the changes: (+22 -0) SelectionDAG.h |4 SelectionDAGNodes.h | 18 ++ 2 files changed, 22 insertions(+) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.85 llvm/include/llvm/CodeGen/SelectionDAG.h:1.86 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.85 Mon Jan 16 18:32:38 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.hMon Jan 23 14:58:48 2006 @@ -314,6 +314,10 @@ SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6); + SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, + SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6, +SDOperand Op7); SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2); SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.90 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.91 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.90 Thu Jan 12 20:39:03 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Jan 23 14:58:48 2006 @@ -839,6 +839,24 @@ Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); } + void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3, + SDOperand Op4, SDOperand Op5, SDOperand Op6) { +assert(NumOperands == 0 && "Should not have operands yet!"); +OperandList = new SDOperand[7]; +OperandList[0] = Op0; +OperandList[1] = Op1; +OperandList[2] = Op2; +OperandList[3] = Op3; +OperandList[4] = Op4; +OperandList[5] = Op5; +OperandList[6] = Op6; +NumOperands = 7; +Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this); +Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this); +Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this); +Op6.Val->Uses.push_back(this); + } + void addUser(SDNode *User) { Uses.push_back(User); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.240 -> 1.241 --- Log message: another selectto --- Diffs of the changes: (+23 -0) SelectionDAG.cpp | 23 +++ 1 files changed, 23 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.240 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.241 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.240Mon Jan 16 02:07:10 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Jan 23 14:59:12 2006 @@ -1649,6 +1649,29 @@ return SDOperand(N, 0); } +SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, + MVT::ValueType VT, SDOperand Op1, + SDOperand Op2, SDOperand Op3,SDOperand Op4, + SDOperand Op5, SDOperand Op6, +SDOperand Op7) { + // If an identical node already exists, use it. + std::vector OpList; + OpList.push_back(Op1); OpList.push_back(Op2); OpList.push_back(Op3); + OpList.push_back(Op4); OpList.push_back(Op5); OpList.push_back(Op6); + OpList.push_back(Op7); + SDNode *&ON = OneResultNodes[std::make_pair(ISD::BUILTIN_OP_END+TargetOpc, + std::make_pair(VT, OpList))]; + if (ON) return SDOperand(ON, 0); + + RemoveNodeFromCSEMaps(N); + N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); + N->setValueTypes(VT); + N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7); + + ON = N; // Memoize the new node. + return SDOperand(N, 0); +} + SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelLowering.cpp AlphaISelLowering.h AlphaInstrInfo.td
Changes in directory llvm/lib/Target/Alpha: AlphaISelLowering.cpp updated: 1.24 -> 1.25 AlphaISelLowering.h updated: 1.9 -> 1.10 AlphaInstrInfo.td updated: 1.104 -> 1.105 --- Log message: yea, lowering this stuff will basically work --- Diffs of the changes: (+154 -11) AlphaISelLowering.cpp | 108 +- AlphaISelLowering.h |3 + AlphaInstrInfo.td | 54 - 3 files changed, 154 insertions(+), 11 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.24 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.25 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.24Thu Jan 19 15:10:38 2006 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Mon Jan 23 14:59:50 2006 @@ -20,6 +20,7 @@ #include "llvm/CodeGen/SSARegMap.h" #include "llvm/Constants.h" #include "llvm/Function.h" +#include "llvm/Module.h" #include "llvm/Support/CommandLine.h" #include @@ -68,6 +69,12 @@ setOperationAction(ISD::TRUNCSTORE, MVT::i1, Promote); + if (EnableAlphaLSMark) { +setOperationAction(ISD::LOAD, MVT::i64, Custom); +setOperationAction(ISD::LOAD, MVT::f64, Custom); +setOperationAction(ISD::LOAD, MVT::f32, Custom); + } + setOperationAction(ISD::FREM, MVT::f32, Expand); setOperationAction(ISD::FREM, MVT::f64, Expand); @@ -145,6 +152,12 @@ case AlphaISD::RelLit: return "Alpha::RelLit"; case AlphaISD::GlobalBaseReg: return "Alpha::GlobalBaseReg"; case AlphaISD::DivCall: return "Alpha::DivCall"; + case AlphaISD::LDQ_: return "Alpha::LDQ_"; + case AlphaISD::LDT_: return "Alpha::LDT_"; + case AlphaISD::LDS_: return "Alpha::LDS_"; + case AlphaISD::LDL_: return "Alpha::LDL_"; + case AlphaISD::LDWU_: return "Alpha::LDWU_"; + case AlphaISD::LDBU_: return "Alpha::LDBU_"; } } @@ -396,7 +409,6 @@ return std::make_pair(Result, Update); } - SDOperand AlphaTargetLowering:: LowerVACopy(SDOperand Chain, SDOperand SrcP, Value *SrcV, SDOperand DestP, Value *DestV, SelectionDAG &DAG) { @@ -425,6 +437,53 @@ } + +static void getValueInfo(const Value* v, int& type, int& fun, int& offset) +{ + fun = type = offset = 0; + if (v == NULL) { +type = 0; + } else if (const GlobalValue* GV = dyn_cast(v)) { +type = 1; +const Module* M = GV->getParent(); +for(Module::const_global_iterator ii = M->global_begin(); &*ii != GV; ++ii) + ++offset; + } else if (const Argument* Arg = dyn_cast(v)) { +type = 2; +const Function* F = Arg->getParent(); +const Module* M = F->getParent(); +for(Module::const_iterator ii = M->begin(); &*ii != F; ++ii) + ++fun; +for(Function::const_arg_iterator ii = F->arg_begin(); &*ii != Arg; ++ii) + ++offset; + } else if (const Instruction* I = dyn_cast(v)) { +assert(dyn_cast(I->getType())); +type = 3; +const BasicBlock* bb = I->getParent(); +const Function* F = bb->getParent(); +const Module* M = F->getParent(); +for(Module::const_iterator ii = M->begin(); &*ii != F; ++ii) + ++fun; +for(Function::const_iterator ii = F->begin(); &*ii != bb; ++ii) + offset += ii->size(); +for(BasicBlock::const_iterator ii = bb->begin(); &*ii != I; ++ii) + ++offset; + } else if (const Constant* C = dyn_cast(v)) { +//Don't know how to look these up yet +type = 0; + } else { +assert(0 && "Error in value marking"); + } + //type = 4: register spilling + //type = 5: global address loading or constant loading +} + +static int getUID() +{ + static int id = 0; + return ++id; +} + /// LowerOperation - Provide custom lowering hooks for some operations. /// SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { @@ -516,6 +575,53 @@ } break; + case ISD::LOAD: + case ISD::SEXTLOAD: + case ISD::ZEXTLOAD: +{ + SDOperand Chain = Op.getOperand(0); + SDOperand Address = Op.getOperand(1); + + unsigned Opc; + unsigned opcode = Op.getOpcode(); + + if (opcode == ISD::LOAD) +switch (Op.Val->getValueType(0)) { +default: Op.Val->dump(); assert(0 && "Bad load!"); +case MVT::i64: Opc = AlphaISD::LDQ_; break; +case MVT::f64: Opc = AlphaISD::LDT_; break; +case MVT::f32: Opc = AlphaISD::LDS_; break; +} + else +switch (cast(Op.getOperand(3))->getVT()) { +default: Op.Val->dump(); assert(0 && "Bad sign extend!"); +case MVT::i32: Opc = AlphaISD::LDL_; + assert(opcode != ISD::ZEXTLOAD && "Not sext"); break; +case MVT::i16: Opc = AlphaISD::LDWU_; + assert(opcode != ISD::SEXTLOAD && "Not zext"); break; +case MVT::i1: //FIXME: Treat i1 as i8 since there are problems otherwise +case MVT::i8: Opc = AlphaISD::LDBU_; + assert(opcode != ISD::SEXTLOAD && "Not zext"); break; +} + + int i, j, k; + getValueInfo(dyn_cast(Op.getOperand(2))->getValue(),
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c
Changes in directory llvm-test/SingleSource/UnitTests: 2006-01-23-InitializedBitField.c updated: 1.1 -> 1.2 --- Log message: Add some new testcases from bugzilla bugs --- Diffs of the changes: (+17 -0) 2006-01-23-InitializedBitField.c | 17 + 1 files changed, 17 insertions(+) Index: llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c diff -u llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c:1.1 llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c:1.2 --- llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c:1.1 Mon Jan 23 12:56:36 2006 +++ llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c Mon Jan 23 13:43:24 2006 @@ -1,4 +1,5 @@ #include +// PR269, PR285 // Test that static initializers for things with bitfields work. @@ -80,6 +81,19 @@ int B; } s11 = { 1, 3}; +struct S12 { // PR269 + unsigned long long A: 33; + unsigned long long B: 40; + unsigned long long C: 41; +} s12 = { 0x1ULL, 0, 100 }; + +struct S13 { // PR285 + unsigned A:1; + char B[4096 +1]; + int C; +} s13 = { 1, "hello S13 world", 12314 }; + + int main() { printf("s0 = %d, %d, %d\n", s0.A, s0.B, s0.C); printf("s1 = %f, %d, %d, %d\n", s1.F, s1.A, s1.B, (int)s1.C); @@ -94,4 +108,7 @@ printf("s9 = %d, %d, %d\n", s9.A, s9.B, (int)s9.C); printf("s10 = %d, %d, %d, %d\n", s10.D, s10.D2, s10.D3, s10.B); printf("s11 = %d, %d\n", s11.D, s11.B); + printf("s12 = %lld, %lld, %lld\n", (long long) s12.A, (long long) s12.B, + (long long)s12.C); + printf("s13 = %d, %s, %d\n", s13.A, s13.B, s13.C); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c
Changes in directory llvm-test/SingleSource/UnitTests: 2006-01-23-InitializedBitField.c added (r1.1) --- Log message: new test for craziness bitfield layouts and static initialization thereof. The old llvm-gcc front-end crashes on this, but the new one does it right. --- Diffs of the changes: (+97 -0) 2006-01-23-InitializedBitField.c | 97 +++ 1 files changed, 97 insertions(+) Index: llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c diff -c /dev/null llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c:1.1 *** /dev/null Mon Jan 23 12:56:47 2006 --- llvm-test/SingleSource/UnitTests/2006-01-23-InitializedBitField.c Mon Jan 23 12:56:36 2006 *** *** 0 --- 1,97 + #include + + // Test that static initializers for things with bitfields work. + + struct S0 { + unsigned int A:2; + unsigned short B:3; + unsigned C:24; + } s0 = { 2, 7, 123479 }; + + struct S1 { + float F; + int A : 31; + int B : 1; + long long C : 31; + } s1 = { 123.456f, 12 }; + + struct S2 { + int A : 31; + int B : 2; + long long C : 31; + } s2 = { 123456, -1, 45123 }; + + struct S3 { + int A; + long long B : 31; + int C : 4; + } s3 = { 4567812, -123, 2 }; + + struct S4 { + short A; + int B : 16; + } s4 = { 0x1234, 0x5678 }; + + struct S5 { + short A; + long long B : 48; + } s5 = { 0x1234, 0x56789ABCDE1LL}; + + struct S6 { + int A : 31; + int B : 1; + long long C : 31; + long long D : 2; + } s6 = { 1243, -1, 24112412, 3}; + + struct S7 { + _Bool D : 8; + _Bool D2 : 8; + int D3 : 8; + long long : 9; + float B; + } s7 = { 1, 0, 123, 1.023f }; + + struct S8 { + int A : 31; + int B : 1; + long long C : 31; + long long D : 34; + long long E : 2; + } s8 = { 123412312, 0, 1231231241, 12312312312LL, 1 }; + + struct S9 { + int A : 31; + int B : 2; + long long C : 31; + } s9 = {12312412, 1, 123123124 }; + + struct S10 { + _Bool D : 8; + _Bool D2 : 8; + int D3 : 15; + long long : 9; + int B; + } s10 = { 1, 0, 21321, 4 }; + + struct S11 { + _Bool D : 8; + int : 0; + int B; + } s11 = { 1, 3}; + + int main() { + printf("s0 = %d, %d, %d\n", s0.A, s0.B, s0.C); + printf("s1 = %f, %d, %d, %d\n", s1.F, s1.A, s1.B, (int)s1.C); + printf("s2 = %d, %d, %d\n", s2.A, s2.B, (int)s2.C); + printf("s3 = %d, %d, %d\n", s3.A, (int)s3.B, s3.C); + printf("s4 = %d, %d\n", s4.A, s4.B); + printf("s5 = %d %lld\n", s5.A, s5.B); + printf("s6 = %d, %d, %d, %d\n", s6.A, s6.B, (int)s6.C, (int)s6.D); + printf("s7 = %d, %d, %d, %f\n", s7.D, s7.D2, (int)s7.D3, s7.B); + printf("s8 = %d, %d, %d, %lld, %d\n", s8.A, s8.B, (int)s8.C, (long long)s8.D, + s8.E); + printf("s9 = %d, %d, %d\n", s9.A, s9.B, (int)s9.C); + printf("s10 = %d, %d, %d, %d\n", s10.D, s10.D2, s10.D3, s10.B); + printf("s11 = %d, %d\n", s11.D, s11.B); + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.134 -> 1.135 --- Log message: Typo. --- Diffs of the changes: (+1 -1) SelectionDAGISel.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.134 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.135 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.134Mon Jan 23 02:26:10 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jan 23 07:34:04 2006 @@ -62,7 +62,7 @@ cl::init(noScheduling), cl::values( clEnumValN(noScheduling, "none", - "No scheduling: breath first sequencing"), + "No scheduling: breadth first sequencing"), clEnumValN(simpleScheduling, "simple", "Simple two pass scheduling: minimize critical path " "and maximize processor utilization"), ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Config/config.h.in
Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.61 -> 1.62 --- Log message: Update for including additional function tests. --- Diffs of the changes: (+7 -10) config.h.in | 17 +++-- 1 files changed, 7 insertions(+), 10 deletions(-) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.61 llvm/include/llvm/Config/config.h.in:1.62 --- llvm/include/llvm/Config/config.h.in:1.61 Thu Jan 19 02:31:08 2006 +++ llvm/include/llvm/Config/config.h.inMon Jan 23 02:15:53 2006 @@ -51,9 +51,6 @@ /* Does not have bi-directional iterator */ #undef HAVE_BI_ITERATOR -/* Define to 1 if you have the `ceil' function. */ -#undef HAVE_CEIL - /* Define to 1 if you have the `ceilf' function. */ #undef HAVE_CEILF @@ -103,9 +100,6 @@ /* Set to 1 if the finite function is found in */ #undef HAVE_FINITE_IN_IEEEFP_H -/* Define to 1 if you have the `floor' function. */ -#undef HAVE_FLOOR - /* Define to 1 if you have the `floorf' function. */ #undef HAVE_FLOORF @@ -240,6 +234,9 @@ /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H +/* Define to 1 if you have the `nearbyintf' function. */ +#undef HAVE_NEARBYINTF + /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR @@ -267,11 +264,11 @@ /* Define to 1 if you have the `rindex' function. */ #undef HAVE_RINDEX -/* Define to 1 if you have the header file. */ -#undef HAVE_RW_STDEX_HASH_MAP_H +/* Define to 1 if you have the `rintf' function. */ +#undef HAVE_RINTF -/* Define to 1 if you have the header file. */ -#undef HAVE_RW_STDEX_HASH_SET_H +/* Define to 1 if you have the `roundf' function. */ +#undef HAVE_ROUNDF /* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAGSimple.cpp updated: 1.3 -> 1.4 --- Log message: Minor clean up. --- Diffs of the changes: (+2 -1) ScheduleDAGSimple.cpp |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.3 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.4 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp:1.3 Mon Jan 23 01:21:01 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp Mon Jan 23 02:25:34 2006 @@ -202,11 +202,12 @@ virtual ~ScheduleDAGSimple() {}; + void Schedule(); + private: static bool isDefiner(NodeInfo *A, NodeInfo *B); void IncludeNode(NodeInfo *NI); void VisitAll(); - void Schedule(); void GatherSchedulingInfo(); void FakeGroupDominators(); bool isStrongDependency(NodeInfo *A, NodeInfo *B); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/ScheduleDAG.h
Changes in directory llvm/include/llvm/CodeGen: ScheduleDAG.h updated: 1.3 -> 1.4 --- Log message: Skeleton of the list schedule. --- Diffs of the changes: (+9 -3) ScheduleDAG.h | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) Index: llvm/include/llvm/CodeGen/ScheduleDAG.h diff -u llvm/include/llvm/CodeGen/ScheduleDAG.h:1.3 llvm/include/llvm/CodeGen/ScheduleDAG.h:1.4 --- llvm/include/llvm/CodeGen/ScheduleDAG.h:1.3 Mon Jan 23 01:01:07 2006 +++ llvm/include/llvm/CodeGen/ScheduleDAG.h Mon Jan 23 02:26:10 2006 @@ -37,9 +37,10 @@ // Scheduling heuristics enum SchedHeuristics { -noScheduling, -simpleScheduling, -simpleNoItinScheduling +noScheduling, // No scheduling, emit breath first sequence. +simpleScheduling, // Two pass, min. critical path, max. utilization. +simpleNoItinScheduling, // Same as above exact using generic latency. +listSchedulingBURR, // Bottom up reg reduction list scheduling. }; @@ -332,6 +333,11 @@ ScheduleDAG* createSimpleDAGScheduler(SchedHeuristics Heuristic, SelectionDAG &DAG, MachineBasicBlock *BB); + + /// createBURRListDAGScheduler - This creates a bottom up register usage + /// reduction list scheduler. + ScheduleDAG* createBURRListDAGScheduler(SelectionDAG &DAG, + MachineBasicBlock *BB); } #endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp SelectionDAGISel.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAGList.cpp added (r1.1) SelectionDAGISel.cpp updated: 1.133 -> 1.134 --- Log message: Skeleton of the list schedule. --- Diffs of the changes: (+65 -0) ScheduleDAGList.cpp | 61 +++ SelectionDAGISel.cpp |4 +++ 2 files changed, 65 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp diff -c /dev/null llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.1 *** /dev/null Mon Jan 23 02:26:20 2006 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Mon Jan 23 02:26:10 2006 *** *** 0 --- 1,61 + //===-- ScheduleDAGSimple.cpp - Implement a list scheduler for isel DAG ---===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Evan Cheng and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===--===// + // + // This implements a simple two pass scheduler. The first pass attempts to push + // backward any lengthy instructions and critical paths. The second pass packs + // instructions into semi-optimal time slots. + // + //===--===// + + #define DEBUG_TYPE "sched" + #include "llvm/CodeGen/ScheduleDAG.h" + #include "llvm/CodeGen/SelectionDAG.h" + #include "llvm/Target/TargetMachine.h" + #include "llvm/Target/TargetInstrInfo.h" + #include + #include + using namespace llvm; + + + namespace llvm { + /// Sorting functions for ready queue. + struct LSSortPred : public std::binary_function { + bool operator()(const SDOperand* left, const SDOperand* right) const { + return true; + } + }; + + /// ScheduleDAGList - List scheduler. + + class ScheduleDAGList : public ScheduleDAG { + private: + LSSortPred &Cmp; + + // Ready queue + std::priority_queue, LSSortPred> Ready; + + public: + ScheduleDAGList(SelectionDAG &dag, MachineBasicBlock *bb, + const TargetMachine &tm, LSSortPred cmp) + : ScheduleDAG(listSchedulingBURR, dag, bb, tm), Cmp(cmp), Ready(Cmp) + {}; + + void Schedule(); + }; + } // end namespace llvm + + void ScheduleDAGList::Schedule() { + } + + + llvm::ScheduleDAG* + llvm::createBURRListDAGScheduler(SelectionDAG &DAG, + MachineBasicBlock *BB) { + return new ScheduleDAGList(DAG, BB, DAG.getTarget(), LSSortPred()); + } Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.133 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.134 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.133Mon Jan 23 01:01:07 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jan 23 02:26:10 2006 @@ -69,6 +69,8 @@ clEnumValN(simpleNoItinScheduling, "simple-noitin", "Simple two pass scheduling: Same as simple " "except using generic latency"), + clEnumValN(listSchedulingBURR, "list-BURR", + "Bottom up register reduction list scheduling"), clEnumValEnd)); } // namespace @@ -1775,6 +1777,8 @@ case simpleNoItinScheduling: SL = createSimpleDAGScheduler(ISHeuristic, DAG, BB); break; + case listSchedulingBURR: +SL = createBURRListDAGScheduler(DAG, BB); } BB = SL->Run(); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/configure
Changes in directory llvm: configure updated: 1.207 -> 1.208 --- Log message: Update for including additional function tests. --- Diffs of the changes: (+5 -155) configure | 160 +- 1 files changed, 5 insertions(+), 155 deletions(-) Index: llvm/configure diff -u llvm/configure:1.207 llvm/configure:1.208 --- llvm/configure:1.207Thu Jan 19 02:31:08 2006 +++ llvm/configure Mon Jan 23 02:15:53 2006 @@ -27045,157 +27045,6 @@ done - - -for ac_header in rw/stdex/hash_map.h rw/stdex/hash_set.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && -{ ac_try='test -z "$ac_c_werror_flag" -|| test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && -{ ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then -ac_cpp_err=$ac_c_preproc_warn_flag -ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else -ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) -{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -ac_header_preproc=yes -;; - no:yes:* ) -{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -{ echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -{ echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -{ echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with th
[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp
Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.181 -> 1.182 --- Log message: Revert last patch because it messes up the JIT, amongst other things. --- Diffs of the changes: (+14 -5) Reader.cpp | 19 ++- 1 files changed, 14 insertions(+), 5 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.181 llvm/lib/Bytecode/Reader/Reader.cpp:1.182 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.181 Mon Jan 23 01:39:03 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Jan 23 02:11:03 2006 @@ -1033,6 +1033,13 @@ BB->getInstList().push_back(Result); + if (this->hasUpgradedIntrinsicFunctions && isCall) +if (Instruction* inst = UpgradeIntrinsicCall(cast(Result))) { + Result->replaceAllUsesWith(inst); + Result->eraseFromParent(); + Result = inst; +} + unsigned TypeSlot; if (Result->getType() == InstTy) TypeSlot = iType; @@ -2025,6 +2032,13 @@ Function *Func = new Function(FTy, GlobalValue::ExternalLinkage, "", TheModule); +// Replace with upgraded intrinsic function, if applicable. +if (Function* upgrdF = UpgradeIntrinsicFunction(Func)) { + hasUpgradedIntrinsicFunctions = true; + Func->eraseFromParent(); + Func = upgrdF; +} + insertValue(Func, (FnSignature & (~0U >> 1)) >> 5, ModuleValues); // Flags are not used yet. @@ -2388,11 +2402,6 @@ // Parse the module contents this->ParseModule(); -// Look for intrinsic functions and CallInst that need to be upgraded -for (Module::iterator FI = TheModule->begin(), FE = TheModule->end(); - FI != FE; ++FI) - UpgradeCallsToIntrinsic(FI); - // Check for missing functions if (hasFunctions()) error("Function expected, but bytecode stream ended!"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits