[llvm-commits] CVS: llvm/docs/CodeGenerator.html
Changes in directory llvm/docs: CodeGenerator.html updated: 1.43 -> 1.44 --- Log message: Pass html validation. --- Diffs of the changes: (+18 -19) CodeGenerator.html | 37 ++--- 1 files changed, 18 insertions(+), 19 deletions(-) Index: llvm/docs/CodeGenerator.html diff -u llvm/docs/CodeGenerator.html:1.43 llvm/docs/CodeGenerator.html:1.44 --- llvm/docs/CodeGenerator.html:1.43 Thu Dec 14 11:19:50 2006 +++ llvm/docs/CodeGenerator.htmlFri Dec 15 04:40:48 2006 @@ -2,6 +2,7 @@ "http://www.w3.org/TR/html4/strict.dtd";> + The LLVM Target-Independent Code Generator @@ -84,15 +85,14 @@ Target-specific Implementation Notes The X86 backend -The PowerPC backend +The PowerPC backend LLVM PowerPC ABI Frame Layout Prolog/Epilog Dynamic Allocation - - - + + @@ -381,7 +381,7 @@ the type to use for shift amounts various high-level characteristics, like whether it is profitable to turn division by a constant into a multiplication sequence - + @@ -1114,7 +1114,7 @@ fragment can match multiple different patterns. We don't automatically infer flags like isStore/isLoad yet. We don't automatically generate the set of supported registers and -operations for the Legalizer yet. +operations for the Legalizer yet. We don't have a way of tying in custom legalized nodes yet. @@ -1155,7 +1155,6 @@ Optional function-at-a-time selection. Auto-generate entire selector from .td file. - @@ -1246,8 +1245,6 @@ More to come... - - @@ -1307,10 +1304,10 @@ -bool RegMapping_Fer::compatible_class(MachineFunction &mf, +bool RegMapping_Fer::compatible_class(MachineFunction &mf, unsigned v_reg, unsigned p_reg) { - assert(MRegisterInfo::isPhysicalRegister(p_reg) && + assert(MRegisterInfo::isPhysicalRegister(p_reg) && "Target register must be physical"); const TargetRegisterClass *trc = mf.getSSARegMap()->getRegClass(v_reg); return trc->contains(p_reg); @@ -1753,11 +1750,11 @@ is used. Second, r31 is used as a frame pointer to allow dynamic growth of a stack frame. LLVM takes advantage of having no TOC to provide space to save the frame pointer in the PowerPC linkage area of the caller frame. Other -details of PowerPC ABI can be found at http://developer.apple.com/documentation/DeveloperTools/Conceptual/ -LowLevelABI/Articles/32bitPowerPC.html" target="_blank">PowerPC ABI. Note: -This link describes the 32 bit ABI. The 64 bit ABI is similar except space for -GPRs are 8 bytes wide (not 4) and r13 is reserved for system use. +details of PowerPC ABI can be found at http://developer.apple.com/documentation/DeveloperTools/Conceptual/LowLevelABI/Articles/32bitPowerPC.html"; +>PowerPC ABI. Note: This link describes the 32 bit ABI. The +64 bit ABI is similar except space for GPRs are 8 bytes wide (not 4) and r13 is +reserved for system use. @@ -1767,7 +1764,7 @@ The size of a PowerPC frame is usually fixed for the duration of a -function's invocation. Since the frame is fixed size, all references into +function’s invocation. Since the frame is fixed size, all references into the frame can be accessed via fixed offsets from the stack pointer. The exception to this is when dynamic alloca or variable sized arrays are present, then a base pointer (r31) is used as a proxy for the stack pointer and stack @@ -1942,7 +1939,9 @@ -TODO - More to come. + +TODO - More to come. + @@ -1955,7 +1954,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/14 17:19:50 $ + Last modified: $Date: 2006/12/15 10:40:48 $ ___ 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/PPCInstr64Bit.td
Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.34 -> 1.35 --- Log message: Provide 64-bit support for i64 sextload. --- Diffs of the changes: (+4 -0) PPCInstr64Bit.td |4 1 files changed, 4 insertions(+) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.34 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.35 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.34 Tue Dec 12 07:23:43 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.tdFri Dec 15 08:34:11 2006 @@ -491,6 +491,10 @@ (LBZ8 iaddr:$src)>; def : Pat<(extloadi1 xaddr:$src), (LBZX8 xaddr:$src)>; +def : Pat<(sextloadi8 iaddr:$src), + (EXTSB8 (LBZ8 iaddr:$src))>; +def : Pat<(sextloadi8 xaddr:$src), + (EXTSB8 (LBZX8 xaddr:$src))>; def : Pat<(extloadi8 iaddr:$src), (LBZ8 iaddr:$src)>; def : Pat<(extloadi8 xaddr:$src), ___ 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/PPCISelLowering.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.244 -> 1.245 --- Log message: Provide support for FP_TO_UINT. --- Diffs of the changes: (+3 -1) PPCISelLowering.cpp |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.244 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.245 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.244 Mon Dec 11 17:22:45 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Fri Dec 15 08:32:57 2006 @@ -181,9 +181,11 @@ if (TM.getSubtarget().has64BitSupport()) { // They also have instructions for converting between i64 and fp. setOperationAction(ISD::FP_TO_SINT, MVT::i64, Custom); +setOperationAction(ISD::FP_TO_UINT, MVT::i64, Expand); setOperationAction(ISD::SINT_TO_FP, MVT::i64, Custom); setOperationAction(ISD::UINT_TO_FP, MVT::i64, Expand); - +setOperationAction(ISD::FP_TO_UINT, MVT::i32, Expand); + // FIXME: disable this lowered code. This generates 64-bit register values, // and we don't model the fact that the top part is clobbered by calls. We // need to flag these together so that the value isn't live across a call. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Should read Provide ppc64 support for FP_TO_UINT On 15-Dec-06, at 10:33 AM, Jim Laskey wrote: Provide support for FP_TO_UINT. smime.p7s Description: S/MIME cryptographic signature ___ 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/PPCCodeEmitter.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCCodeEmitter.cpp updated: 1.73 -> 1.74 --- Log message: Missing load/store relocations. --- Diffs of the changes: (+7 -1) PPCCodeEmitter.cpp |8 +++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.73 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.74 --- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.73 Mon Dec 11 17:22:44 2006 +++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp Fri Dec 15 10:44:10 2006 @@ -152,17 +152,23 @@ case PPC::LA: // Loads. case PPC::LBZ: + case PPC::LBZ8: case PPC::LHA: + case PPC::LHA8: case PPC::LHZ: + case PPC::LHZ8: case PPC::LWZ: + case PPC::LWZ8: case PPC::LFS: case PPC::LFD: - case PPC::LWZ8: // Stores. case PPC::STB: + case PPC::STB8: case PPC::STH: + case PPC::STH8: case PPC::STW: + case PPC::STW8: case PPC::STFS: case PPC::STFD: Reloc = PPC::reloc_absolute_low; ___ 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.123 -> 1.124 --- Log message: extern_weak linkage. fixes PR1038: http://llvm.org/PR1038 --- Diffs of the changes: (+5 -1) LinkModules.cpp |6 +- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.123 llvm/lib/Linker/LinkModules.cpp:1.124 --- llvm/lib/Linker/LinkModules.cpp:1.123 Mon Dec 11 23:04:59 2006 +++ llvm/lib/Linker/LinkModules.cpp Fri Dec 15 11:35:32 2006 @@ -365,6 +365,10 @@ LinkFromSrc = true; LT = Src->getLinkage(); } +} else if (Dest->hasExternalWeakLinkage()) { + //If the Dest is weak, use the source linkage + LinkFromSrc = true; + LT = Src->getLinkage(); } else { LinkFromSrc = false; LT = Dest->getLinkage(); @@ -446,7 +450,7 @@ if (DGV && DGV->hasInternalLinkage()) DGV = 0; -assert(SGV->hasInitializer() || +assert(SGV->hasInitializer() || SGV->hasExternalWeakLinkage() || SGV->hasExternalLinkage() || SGV->hasDLLImportLinkage() && "Global must either be external or have an initializer!"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Linker/weakextern.ll testlink1.ll
Changes in directory llvm/test/Regression/Linker: weakextern.ll added (r1.1) testlink1.ll updated: 1.12 -> 1.13 --- Log message: extern_weak link test --- Diffs of the changes: (+15 -0) testlink1.ll |2 ++ weakextern.ll | 13 + 2 files changed, 15 insertions(+) Index: llvm/test/Regression/Linker/weakextern.ll diff -c /dev/null llvm/test/Regression/Linker/weakextern.ll:1.1 *** /dev/null Fri Dec 15 11:34:47 2006 --- llvm/test/Regression/Linker/weakextern.ll Fri Dec 15 11:34:37 2006 *** *** 0 --- 1,13 + ; RUN: llvm-as < %s > %t.bc + ; RUN: llvm-as < `dirname %s`/testlink1.ll > %t2.bc + ; RUN: llvm-link %t.bc %t.bc %t2.bc -o %t1.bc + ; RUN: llvm-dis < %t1.bc |grep "kallsyms_names = extern_weak" && + ; RUN: llvm-dis < %t1.bc |grep "MyVar = external global int" && + ; RUN: llvm-dis < %t1.bc |grep "Inte = global int" + + %kallsyms_names = extern_weak global [0 x ubyte] + %MyVar = extern_weak global int + %Inte = extern_weak global int + + implementation + Index: llvm/test/Regression/Linker/testlink1.ll diff -u llvm/test/Regression/Linker/testlink1.ll:1.12 llvm/test/Regression/Linker/testlink1.ll:1.13 --- llvm/test/Regression/Linker/testlink1.ll:1.12 Thu Nov 23 09:14:52 2006 +++ llvm/test/Regression/Linker/testlink1.llFri Dec 15 11:34:37 2006 @@ -6,6 +6,8 @@ %MyIntList = global { \2 *, int } { { \2, int }* null, int 17 } external global int ; int*:0 +%Inte = global int 1 + %AConst= linkonce constant int 123 %Intern1 = internal constant int 42 ___ 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/PPCInstr64Bit.td
Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.36 -> 1.37 --- Log message: Not all test cases are created equal. This fix is needed. --- Diffs of the changes: (+4 -0) PPCInstr64Bit.td |4 1 files changed, 4 insertions(+) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.36 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.37 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.36 Fri Dec 15 12:45:32 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.tdFri Dec 15 12:51:01 2006 @@ -491,6 +491,10 @@ (LBZ8 iaddr:$src)>; def : Pat<(extloadi1 xaddr:$src), (LBZX8 xaddr:$src)>; +def : Pat<(sextloadi8 iaddr:$src), + (EXTSB8 (LBZ8 iaddr:$src))>; +def : Pat<(sextloadi8 xaddr:$src), + (EXTSB8 (LBZX8 xaddr:$src))>; def : Pat<(extloadi8 iaddr:$src), (LBZ8 iaddr:$src)>; def : Pat<(extloadi8 xaddr:$src), ___ 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/PPCInstr64Bit.td
Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.35 -> 1.36 --- Log message: Not needed. Misinterpreted error message from other bug (Missing load/store relocations.) --- Diffs of the changes: (+0 -4) PPCInstr64Bit.td |4 1 files changed, 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.35 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.36 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.35 Fri Dec 15 08:34:11 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.tdFri Dec 15 12:45:32 2006 @@ -491,10 +491,6 @@ (LBZ8 iaddr:$src)>; def : Pat<(extloadi1 xaddr:$src), (LBZX8 xaddr:$src)>; -def : Pat<(sextloadi8 iaddr:$src), - (EXTSB8 (LBZ8 iaddr:$src))>; -def : Pat<(sextloadi8 xaddr:$src), - (EXTSB8 (LBZX8 xaddr:$src))>; def : Pat<(extloadi8 iaddr:$src), (LBZ8 iaddr:$src)>; def : Pat<(extloadi8 xaddr:$src), ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.103 -> 1.104 --- Log message: Move PMTopLevelManager and TImingInfo into anon namespace. --- Diffs of the changes: (+15 -8) PassManager.cpp | 23 +++ 1 files changed, 15 insertions(+), 8 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.103 llvm/lib/VMCore/PassManager.cpp:1.104 --- llvm/lib/VMCore/PassManager.cpp:1.103 Thu Dec 14 18:08:26 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 15 13:39:30 2006 @@ -21,7 +21,9 @@ #include "llvm/Support/ManagedStatic.h" #include #include + using namespace llvm; +class llvm::PMDataManager; //===--===// // Overview: @@ -114,16 +116,14 @@ } // End of llvm namespace #ifndef USE_OLD_PASSMANAGER -namespace llvm { - -class PMDataManager; +namespace { //===--===// // PMTopLevelManager // /// PMTopLevelManager manages LastUser info and collects common APIs used by /// top level pass managers. -class PMTopLevelManager { +class VISIBILITY_HIDDEN PMTopLevelManager { public: inline std::vector::iterator passManagersBegin() { @@ -210,10 +210,13 @@ /// Immutable passes are managed by top level manager. std::vector ImmutablePasses; }; + +} // End of anon namespace //===--===// // PMDataManager +namespace llvm { /// PMDataManager provides the common place to manage the analysis data /// used by pass managers. class PMDataManager { @@ -365,7 +368,7 @@ /// BasicBlockPassManager manages BasicBlockPass. It batches all the /// pass together and sequence them to process one basic block before /// processing next basic block. -class BasicBlockPassManager : public PMDataManager, +class VISIBILITY_HIDDEN BasicBlockPassManager : public PMDataManager, public FunctionPass { public: @@ -390,7 +393,7 @@ // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { -llvm::cerr << std::string(Offset*2, ' ') << "BasicBLockPass Manager\n"; +llvm::cerr << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n"; for (std::vector::iterator I = passVectorBegin(), E = passVectorEnd(); I != E; ++I) { (*I)->dumpPassStructure(Offset + 1); @@ -574,13 +577,17 @@ ModulePassManager *activeManager; }; +} // End of llvm namespace + +namespace { + //===--===// // TimingInfo Class - This class is used to calculate information about the // amount of time each pass takes to execute. This only happens when // -time-passes is enabled on the command line. // -class TimingInfo { +class VISIBILITY_HIDDEN TimingInfo { std::map TimingData; TimerGroup TG; @@ -623,7 +630,7 @@ static TimingInfo *TheTimeInfo; -} // End of llvm namespace +} // End of anon namespace //===--===// // PMTopLevelManager implementation ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Bytecode/Archive/Archive.cpp ArchiveReader.cpp ArchiveWriter.cpp
Changes in directory llvm/lib/Bytecode/Archive: Archive.cpp updated: 1.14 -> 1.15 ArchiveReader.cpp updated: 1.47 -> 1.48 ArchiveWriter.cpp updated: 1.32 -> 1.33 --- Log message: For PR1050: http://llvm.org/PR1050 : Convert asserts into error messages. --- Diffs of the changes: (+27 -6) Archive.cpp |7 ++- ArchiveReader.cpp | 13 +++-- ArchiveWriter.cpp | 13 ++--- 3 files changed, 27 insertions(+), 6 deletions(-) Index: llvm/lib/Bytecode/Archive/Archive.cpp diff -u llvm/lib/Bytecode/Archive/Archive.cpp:1.14 llvm/lib/Bytecode/Archive/Archive.cpp:1.15 --- llvm/lib/Bytecode/Archive/Archive.cpp:1.14 Thu Aug 24 18:45:08 2006 +++ llvm/lib/Bytecode/Archive/Archive.cpp Fri Dec 15 13:44:51 2006 @@ -62,7 +62,12 @@ // different file, presumably as an update to the member. It also makes sure // the flags are reset correctly. bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) { - assert(newFile.exists() && "Can't replace with a non-existent file"); + if (!newFile.exists()) { +if (ErrMsg) + *ErrMsg = "Can not replace an archive member with a non-existent file"; +return true; + } + data = 0; path = newFile; Index: llvm/lib/Bytecode/Archive/ArchiveReader.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.47 llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.48 --- llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.47Fri Aug 25 12:43:11 2006 +++ llvm/lib/Bytecode/Archive/ArchiveReader.cpp Fri Dec 15 13:44:51 2006 @@ -68,7 +68,11 @@ ArchiveMember* Archive::parseMemberHeader(const char*& At, const char* End, std::string* error) { - assert(At + sizeof(ArchiveMemberHeader) < End && "Not enough data"); + if (At + sizeof(ArchiveMemberHeader) >= End) { +if (error) + *error = "Unexpected end of file"; +return 0; + } // Cast archive member header ArchiveMemberHeader* Hdr = (ArchiveMemberHeader*)At; @@ -498,7 +502,12 @@ std::set& result, std::string* error) { - assert(mapfile && base && "Can't findModulesDefiningSymbols on new archive"); + if (!mapfile || !base) { +if (error) + *error = "Empty archive invalid for finding modules defining symbols"; +return false; + } + if (symTab.empty()) { // We don't have a symbol table, so we must build it now but lets also // make sure that we populate the modules table as we do this to ensure Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.32 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.33 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.32Tue Nov 28 16:49:32 2006 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Fri Dec 15 13:44:51 2006 @@ -153,7 +153,11 @@ bool Archive::addFileBefore(const sys::Path& filePath, iterator where, std::string* ErrMsg) { - assert(filePath.exists() && "Can't add a non-existent file"); + if (!filePath.exists()) { +if (ErrMsg) + *ErrMsg = "Can not add a non-existent file to archive"; +return true; + } ArchiveMember* mbr = new ArchiveMember(this); @@ -385,8 +389,11 @@ { // Make sure they haven't opened up the file, not loaded it, // but are now trying to write it which would wipe out the file. - assert(!(members.empty() && mapfile->size() > 8) && - "Can't write an archive not opened for writing"); + if (members.empty() && mapfile->size() > 8) { +if (ErrMsg) + *ErrMsg = "Can't write an archive not opened for writing"; +return true; + } // Create a temporary file to store the archive in sys::Path TmpArchive = archPath; ___ 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 ReaderWrappers.cpp
Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.213 -> 1.214 ReaderWrappers.cpp updated: 1.59 -> 1.60 --- Log message: Fix long standing issue with propagating error message back to caller. This has been a problem since exceptions were removed from the BytecodeReader. Error messages are now captured from ModuleProvider::releaseModule as well as after a longjmp. --- Diffs of the changes: (+17 -7) Reader.cpp | 14 -- ReaderWrappers.cpp | 10 +- 2 files changed, 17 insertions(+), 7 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.213 llvm/lib/Bytecode/Reader/Reader.cpp:1.214 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.213 Mon Dec 11 17:20:20 2006 +++ llvm/lib/Bytecode/Reader/Reader.cpp Fri Dec 15 13:49:23 2006 @@ -1758,8 +1758,13 @@ /// @see ParseBytecode bool BytecodeReader::ParseFunction(Function* Func, std::string* ErrMsg) { - if (setjmp(context)) + if (setjmp(context)) { +// Set caller's error message, if requested +if (ErrMsg) + *ErrMsg = ErrorMsg; +// Indicate an error occurred return true; + } // Find {start, end} pointers and slot in the map. If not there, we're done. LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.find(Func); @@ -1788,8 +1793,13 @@ /// to materialize the functions. /// @see ParseBytecode bool BytecodeReader::ParseAllFunctionBodies(std::string* ErrMsg) { - if (setjmp(context)) + if (setjmp(context)) { +// Set caller's error message, if requested +if (ErrMsg) + *ErrMsg = ErrorMsg; +// Indicate an error occurred return true; + } LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.begin(); LazyFunctionMap::iterator Fe = LazyFunctionLoadMap.end(); Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.59 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.60 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.59Thu Dec 7 14:28:15 2006 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Fri Dec 15 13:49:23 2006 @@ -309,7 +309,7 @@ ModuleProvider *MP = getBytecodeBufferModuleProvider(Buffer, Length, ModuleID, ErrMsg, 0); if (!MP) return 0; - Module *M = MP->releaseModule(); + Module *M = MP->releaseModule(ErrMsg); delete MP; return M; } @@ -341,7 +341,7 @@ std::string *ErrMsg) { ModuleProvider* MP = getBytecodeModuleProvider(Filename, ErrMsg); if (!MP) return 0; - Module *M = MP->releaseModule(); + Module *M = MP->releaseModule(ErrMsg); delete MP; return M; } @@ -356,7 +356,7 @@ BytecodeHandler* AH = createBytecodeAnalyzerHandler(bca,output); ModuleProvider* MP = getBytecodeModuleProvider(Filename, ErrMsg, AH); if (!MP) return 0; - Module *M = MP->releaseModule(); + Module *M = MP->releaseModule(ErrMsg); delete MP; return M; } @@ -375,7 +375,7 @@ ModuleProvider* MP = getBytecodeBufferModuleProvider(Buffer, Length, ModuleID, ErrMsg, hdlr); if (!MP) return 0; - Module *M = MP->releaseModule(); + Module *M = MP->releaseModule(ErrMsg); delete MP; return M; } @@ -388,7 +388,7 @@ deplibs.clear(); return true; } - Module* M = MP->releaseModule(); + Module* M = MP->releaseModule(ErrMsg); deplibs = M->getLibraries(); delete M; delete MP; ___ 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/X86InstrX86-64.td
Changes in directory llvm/lib/Target/X86: X86InstrX86-64.td updated: 1.13 -> 1.14 --- Log message: Some AT&T syntax assembler (e.g. Mac OS X) does not recognize the movq alias for i64 <-> XMM moves. --- Diffs of the changes: (+8 -8) X86InstrX86-64.td | 16 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/Target/X86/X86InstrX86-64.td diff -u llvm/lib/Target/X86/X86InstrX86-64.td:1.13 llvm/lib/Target/X86/X86InstrX86-64.td:1.14 --- llvm/lib/Target/X86/X86InstrX86-64.td:1.13 Thu Dec 14 15:55:39 2006 +++ llvm/lib/Target/X86/X86InstrX86-64.td Fri Dec 15 13:58:58 2006 @@ -1110,33 +1110,33 @@ // Move instructions... def MOV64toPQIrr : RPDI<0x6E, MRMSrcReg, (ops VR128:$dst, GR64:$src), -"movq {$src, $dst|$dst, $src}", +"mov{d|q} {$src, $dst|$dst, $src}", [(set VR128:$dst, (v2i64 (scalar_to_vector GR64:$src)))]>; def MOV64toPQIrm : RPDI<0x6E, MRMSrcMem, (ops VR128:$dst, i64mem:$src), -"movq {$src, $dst|$dst, $src}", +"mov{d|q} {$src, $dst|$dst, $src}", [(set VR128:$dst, (v2i64 (scalar_to_vector (loadi64 addr:$src]>; def MOVPQIto64rr : RPDI<0x7E, MRMDestReg, (ops GR64:$dst, VR128:$src), - "movq {$src, $dst|$dst, $src}", + "mov{d|q} {$src, $dst|$dst, $src}", [(set GR64:$dst, (vector_extract (v2i64 VR128:$src), (iPTR 0)))]>; def MOVPQIto64mr : RPDI<0x7E, MRMDestMem, (ops i64mem:$dst, VR128:$src), - "movq {$src, $dst|$dst, $src}", + "mov{d|q} {$src, $dst|$dst, $src}", [(store (i64 (vector_extract (v2i64 VR128:$src), (iPTR 0))), addr:$dst)]>; def MOV64toSDrr : RPDI<0x6E, MRMSrcReg, (ops FR64:$dst, GR64:$src), - "movq {$src, $dst|$dst, $src}", + "mov{d|q} {$src, $dst|$dst, $src}", [(set FR64:$dst, (bitconvert GR64:$src))]>; def MOV64toSDrm : RPDI<0x6E, MRMSrcMem, (ops FR64:$dst, i64mem:$src), - "movq {$src, $dst|$dst, $src}", + "mov{d|q} {$src, $dst|$dst, $src}", [(set FR64:$dst, (bitconvert (loadi64 addr:$src)))]>; def MOVSDto64rr : RPDI<0x7E, MRMDestReg, (ops GR64:$dst, FR64:$src), -"movq {$src, $dst|$dst, $src}", +"mov{d|q} {$src, $dst|$dst, $src}", [(set GR64:$dst, (bitconvert FR64:$src))]>; def MOVSDto64mr : RPDI<0x7E, MRMDestMem, (ops i64mem:$dst, FR64:$src), -"movq {$src, $dst|$dst, $src}", +"mov{d|q} {$src, $dst|$dst, $src}", [(store (i64 (bitconvert FR64:$src)), addr:$dst)]>; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.104 -> 1.105 --- Log message: Mark dump* routines const routines. --- Diffs of the changes: (+61 -54) PassManager.cpp | 115 +--- 1 files changed, 61 insertions(+), 54 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.104 llvm/lib/VMCore/PassManager.cpp:1.105 --- llvm/lib/VMCore/PassManager.cpp:1.104 Fri Dec 15 13:39:30 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 15 14:13:01 2006 @@ -191,8 +191,8 @@ } // Print passes managed by this top level manager. - void dumpPasses(); - void dumpArguments(); + void dumpPasses() const; + void dumpArguments() const; private: @@ -284,55 +284,14 @@ PMTopLevelManager *getTopLevelManager() { return TPM; } void setTopLevelManager(PMTopLevelManager *T) { TPM = T; } - unsigned getDepth() { return Depth; } - - // Print list of passes that are last used by P. - void dumpLastUses(Pass *P, unsigned Offset) { - -std::vector LUses; - -assert (TPM && "Top Level Manager is missing"); -TPM->collectLastUses(LUses, P); - -for (std::vector::iterator I = LUses.begin(), - E = LUses.end(); I != E; ++I) { - llvm::cerr << "--" << std::string(Offset*2, ' '); - (*I)->dumpPassStructure(0); -} - } - - void dumpPassArguments() { -for(std::vector::iterator I = PassVector.begin(), - E = PassVector.end(); I != E; ++I) { - if (PMDataManager *PMD = dynamic_cast(*I)) -PMD->dumpPassArguments(); - else -if (const PassInfo *PI = (*I)->getPassInfo()) - if (!PI->isAnalysisGroup()) -cerr << " -" << PI->getPassArgument(); -} - } - - void dumpPassInfo(Pass *P, std::string &Msg1, std::string &Msg2) { -if (PassDebugging_New < Executions) - return; -cerr << (void*)this << std::string(getDepth()*2+1, ' '); -cerr << Msg1; -cerr << P->getPassName(); -cerr << Msg2; - } + unsigned getDepth() const { return Depth; } + // Print routines used by debug-pass + void dumpLastUses(Pass *P, unsigned Offset) const; + void dumpPassArguments() const; + void dumpPassInfo(Pass *P, std::string &Msg1, std::string &Msg2) const; void dumpAnalysisSetInfo(const char *Msg, Pass *P, - const std::vector &Set) { -if (PassDebugging_New >= Details && !Set.empty()) { - cerr << (void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; - for (unsigned i = 0; i != Set.size(); ++i) { -if (i) cerr << ","; -cerr << " " << Set[i]->getPassName(); - } - cerr << "\n"; -} - } + const std::vector &Set) const; std::vector& getTransferredLastUses() { return TransferLastUses; @@ -728,26 +687,25 @@ } // Print passes managed by this top level manager. -void PMTopLevelManager::dumpPasses() { +void PMTopLevelManager::dumpPasses() const { // Print out the immutable passes for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i) { ImmutablePasses[i]->dumpPassStructure(0); } - for (std::vector::iterator I = PassManagers.begin(), + for (std::vector::const_iterator I = PassManagers.begin(), E = PassManagers.end(); I != E; ++I) (*I)->dumpPassStructure(1); - } -void PMTopLevelManager::dumpArguments() { +void PMTopLevelManager::dumpArguments() const { if (PassDebugging_New < Arguments) return; cerr << "Pass Arguments: "; - for (std::vector::iterator I = PassManagers.begin(), + for (std::vector::const_iterator I = PassManagers.begin(), E = PassManagers.end(); I != E; ++I) { PMDataManager *PMD = dynamic_cast(*I); assert(PMD && "This is not a PassManager"); @@ -948,6 +906,55 @@ return NULL; } +// Print list of passes that are last used by P. +void PMDataManager::dumpLastUses(Pass *P, unsigned Offset) const{ + + std::vector LUses; + + assert (TPM && "Top Level Manager is missing"); + TPM->collectLastUses(LUses, P); + + for (std::vector::iterator I = LUses.begin(), + E = LUses.end(); I != E; ++I) { +llvm::cerr << "--" << std::string(Offset*2, ' '); +(*I)->dumpPassStructure(0); + } +} + +void PMDataManager::dumpPassArguments() const { + for(std::vector::const_iterator I = PassVector.begin(), +E = PassVector.end(); I != E; ++I) { +if (PMDataManager *PMD = dynamic_cast(*I)) + PMD->dumpPassArguments(); +else + if (const PassInfo *PI = (*I)->getPassInfo()) +if (!PI->isAnalysisGroup()) + cerr << " -" << PI->getPassArgument(); + } +} + +void PMDataManager:: dumpPassInfo(Pass *P, std::string &Msg1, + std::string &Msg2) const { + if (PassDebugging_New < Executions) +return; + cerr << (void*)this << std::string(getDepth()*2+1, ' '); + cerr << Msg1; + cerr << P->getPassName(); + cerr << Msg2; +} + +void P
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.261 -> 1.262 --- Log message: This code was usurping the sextload expand in teh legalizer. Just make sure the right conditions are checked. --- Diffs of the changes: (+9 -7) DAGCombiner.cpp | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.261 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.262 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.261 Mon Dec 11 22:16:14 2006 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Fri Dec 15 15:38:30 2006 @@ -1943,13 +1943,15 @@ if ((ISD::isSEXTLoad(N0.Val) || ISD::isEXTLoad(N0.Val)) && N0.hasOneUse()) { LoadSDNode *LN0 = cast(N0); MVT::ValueType EVT = LN0->getLoadedVT(); -SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), - LN0->getBasePtr(), LN0->getSrcValue(), - LN0->getSrcValueOffset(), EVT); -CombineTo(N, ExtLoad); -CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), - ExtLoad.getValue(1)); -return SDOperand(N, 0); // Return N so it doesn't get rechecked! +if (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT)) { + SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), + LN0->getBasePtr(), LN0->getSrcValue(), + LN0->getSrcValueOffset(), EVT); + CombineTo(N, ExtLoad); + CombineTo(N0.Val, DAG.getNode(ISD::TRUNCATE, N0.getValueType(), ExtLoad), +ExtLoad.getValue(1)); + return SDOperand(N, 0); // Return N so it doesn't get rechecked! +} } return SDOperand(); ___ 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/PPCInstr64Bit.td
Changes in directory llvm/lib/Target/PowerPC: PPCInstr64Bit.td updated: 1.37 -> 1.38 --- Log message: Patterns no longer needed due to fix in the DAG combiner. --- Diffs of the changes: (+0 -4) PPCInstr64Bit.td |4 1 files changed, 4 deletions(-) Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.37 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.38 --- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.37 Fri Dec 15 12:51:01 2006 +++ llvm/lib/Target/PowerPC/PPCInstr64Bit.tdFri Dec 15 15:39:31 2006 @@ -491,10 +491,6 @@ (LBZ8 iaddr:$src)>; def : Pat<(extloadi1 xaddr:$src), (LBZX8 xaddr:$src)>; -def : Pat<(sextloadi8 iaddr:$src), - (EXTSB8 (LBZ8 iaddr:$src))>; -def : Pat<(sextloadi8 xaddr:$src), - (EXTSB8 (LBZX8 xaddr:$src))>; def : Pat<(extloadi8 iaddr:$src), (LBZ8 iaddr:$src)>; def : Pat<(extloadi8 xaddr:$src), ___ 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/Analyzer.cpp
Changes in directory llvm/lib/Bytecode/Reader: Analyzer.cpp updated: 1.25 -> 1.26 --- Log message: Remove an extraneous { at the end of a block. --- Diffs of the changes: (+1 -1) Analyzer.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Reader/Analyzer.cpp diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.25 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.26 --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.25 Mon Nov 13 22:47:22 2006 +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Fri Dec 15 15:46:37 2006 @@ -387,7 +387,7 @@ virtual void handleBasicBlockEnd(unsigned blocknum) { if (os) - *os << " } END BLOCK: BasicBlock #" << blocknum << "{\n"; + *os << " } END BLOCK: BasicBlock #" << blocknum << "\n"; } virtual void handleGlobalConstantsBegin() { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp
Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.187 -> 1.188 --- Log message: Partial unbreak of VC++ (stream stuff has no easy fix). --- Diffs of the changes: (+1 -0) Constants.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.187 llvm/lib/VMCore/Constants.cpp:1.188 --- llvm/lib/VMCore/Constants.cpp:1.187 Tue Dec 12 17:36:14 2006 +++ llvm/lib/VMCore/Constants.cpp Fri Dec 15 15:47:01 2006 @@ -1371,6 +1371,7 @@ return new CompareConstantExpr(Instruction::FCmp, V.predicate, V.operands[0], V.operands[1]); assert(0 && "Invalid ConstantExpr!"); + return 0; } }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/win32/Analysis/Analysis.vcproj
Changes in directory llvm/win32/Analysis: Analysis.vcproj updated: 1.21 -> 1.22 --- Log message: Partial unbreak of VC++ (stream stuff has no easy fix). --- Diffs of the changes: (+0 -68) Analysis.vcproj | 68 1 files changed, 68 deletions(-) Index: llvm/win32/Analysis/Analysis.vcproj diff -u llvm/win32/Analysis/Analysis.vcproj:1.21 llvm/win32/Analysis/Analysis.vcproj:1.22 --- llvm/win32/Analysis/Analysis.vcproj:1.21Fri Dec 1 20:22:01 2006 +++ llvm/win32/Analysis/Analysis.vcproj Fri Dec 15 15:47:01 2006 @@ -193,52 +193,6 @@ RelativePath="..\..\lib\Analysis\Ipa\GlobalsModRef.cpp"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ___ 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.23 -> 1.24 --- Log message: Partial unbreak of VC++ (stream stuff has no easy fix). --- Diffs of the changes: (+0 -9) VMCore.vcproj |9 - 1 files changed, 9 deletions(-) Index: llvm/win32/VMCore/VMCore.vcproj diff -u llvm/win32/VMCore/VMCore.vcproj:1.23 llvm/win32/VMCore/VMCore.vcproj:1.24 --- llvm/win32/VMCore/VMCore.vcproj:1.23Fri Dec 1 20:22:01 2006 +++ llvm/win32/VMCore/VMCore.vcproj Fri Dec 15 15:47:01 2006 @@ -113,9 +113,6 @@ RelativePath="..\..\lib\VMCore\AsmWriter.cpp"> - - - - - - http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h MachineInstr.h
Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.30 -> 1.31 MachineInstr.h updated: 1.205 -> 1.206 --- Log message: Complete unbreak of VC++ (Chris identified the simple fix). --- Diffs of the changes: (+2 -0) LiveInterval.h |1 + MachineInstr.h |1 + 2 files changed, 2 insertions(+) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.30 llvm/include/llvm/CodeGen/LiveInterval.h:1.31 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.30 Wed Dec 6 19:30:31 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.hFri Dec 15 16:06:08 2006 @@ -26,6 +26,7 @@ #include #include #include +#include namespace llvm { class MRegisterInfo; Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.205 llvm/include/llvm/CodeGen/MachineInstr.h:1.206 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.205 Wed Dec 6 19:30:31 2006 +++ llvm/include/llvm/CodeGen/MachineInstr.hFri Dec 15 16:06:08 2006 @@ -22,6 +22,7 @@ #include #include #include +#include namespace llvm { ___ 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
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.443 -> 1.444 --- Log message: Fix select_cc, select expansion to soft-fp bugs. --- Diffs of the changes: (+11 -3) LegalizeDAG.cpp | 14 +++--- 1 files changed, 11 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.443 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.444 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.443 Fri Dec 15 01:36:19 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 15 16:42:55 2006 @@ -4705,18 +4705,24 @@ SDOperand LL, LH, RL, RH; ExpandOp(Node->getOperand(1), LL, LH); ExpandOp(Node->getOperand(2), RL, RH); +if (getTypeAction(NVT) == Expand) + NVT = TLI.getTypeToExpandTo(NVT); Lo = DAG.getNode(ISD::SELECT, NVT, Node->getOperand(0), LL, RL); -Hi = DAG.getNode(ISD::SELECT, NVT, Node->getOperand(0), LH, RH); +if (VT != MVT::f32) + Hi = DAG.getNode(ISD::SELECT, NVT, Node->getOperand(0), LH, RH); break; } case ISD::SELECT_CC: { SDOperand TL, TH, FL, FH; ExpandOp(Node->getOperand(2), TL, TH); ExpandOp(Node->getOperand(3), FL, FH); +if (getTypeAction(NVT) == Expand) + NVT = TLI.getTypeToExpandTo(NVT); Lo = DAG.getNode(ISD::SELECT_CC, NVT, Node->getOperand(0), Node->getOperand(1), TL, FL, Node->getOperand(4)); -Hi = DAG.getNode(ISD::SELECT_CC, NVT, Node->getOperand(0), - Node->getOperand(1), TH, FH, Node->getOperand(4)); +if (VT != MVT::f32) + Hi = DAG.getNode(ISD::SELECT_CC, NVT, Node->getOperand(0), + Node->getOperand(1), TH, FH, Node->getOperand(4)); break; } case ISD::ANY_EXTEND: @@ -4761,6 +4767,8 @@ // f32 / f64 must be expanded to i32 / i64. if (VT == MVT::f32 || VT == MVT::f64) { Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0)); + if (getTypeAction(NVT) == Expand) +ExpandOp(Lo, Lo, Hi); break; } ___ 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/LiveInterval.h MachineBasicBlock.h MachineInstr.h
Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.31 -> 1.32 MachineBasicBlock.h updated: 1.51 -> 1.52 MachineInstr.h updated: 1.206 -> 1.207 --- Log message: An even better unbreakage... --- Diffs of the changes: (+4 -18) LiveInterval.h |6 +- MachineBasicBlock.h |5 + MachineInstr.h | 11 ++- 3 files changed, 4 insertions(+), 18 deletions(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.31 llvm/include/llvm/CodeGen/LiveInterval.h:1.32 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.31 Fri Dec 15 16:06:08 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.hFri Dec 15 16:57:14 2006 @@ -26,7 +26,6 @@ #include #include #include -#include namespace llvm { class MRegisterInfo; @@ -63,10 +62,7 @@ }; std::ostream& operator<<(std::ostream& os, const LiveRange &LR); - inline OStream& operator<<(OStream& os, const LiveRange &LR) { -if (os.stream()) *os.stream() << LR; -return os; - } + OStream& operator<<(OStream& os, const LiveRange &LR); inline bool operator<(unsigned V, const LiveRange &LR) { return V < LR.start; Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.51 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.52 --- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.51 Wed Dec 6 19:30:31 2006 +++ llvm/include/llvm/CodeGen/MachineBasicBlock.h Fri Dec 15 16:57:14 2006 @@ -226,10 +226,7 @@ }; std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB); -inline OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB){ - if (OS.stream()) *OS.stream() << MBB; - return OS; -} +OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB); //======// // GraphTraits specializations for machine basic block graphs (machine-CFGs) Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.206 llvm/include/llvm/CodeGen/MachineInstr.h:1.207 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.206 Fri Dec 15 16:06:08 2006 +++ llvm/include/llvm/CodeGen/MachineInstr.hFri Dec 15 16:57:14 2006 @@ -22,7 +22,6 @@ #include #include #include -#include namespace llvm { @@ -286,10 +285,7 @@ IsDead = false; } - friend OStream& operator<<(OStream& os, const MachineOperand& mop) { -if (os.stream()) *os.stream() << mop; -return os; - } + friend OStream& operator<<(OStream& os, const MachineOperand& mop); friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop); friend class MachineInstr; @@ -403,10 +399,7 @@ } void print(std::ostream &OS, const TargetMachine *TM) const; void dump() const; - friend OStream& operator<<(OStream& os, const MachineInstr& minstr){ -if (os.stream()) *os.stream() << minstr; -return os; - } + friend OStream& operator<<(OStream& os, const MachineInstr& minstr); friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr); //======// ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.105 -> 1.106 --- Log message: Cosmetic changes, based on Chris's review. --- Diffs of the changes: (+21 -27) PassManager.cpp | 48 +--- 1 files changed, 21 insertions(+), 27 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.105 llvm/lib/VMCore/PassManager.cpp:1.106 --- llvm/lib/VMCore/PassManager.cpp:1.105 Fri Dec 15 14:13:01 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 15 16:57:49 2006 @@ -221,7 +221,7 @@ /// used by pass managers. class PMDataManager { public: - PMDataManager(int D) : TPM(NULL), Depth(D) { + PMDataManager(int Depth) : TPM(NULL), Depth(Depth) { initializeAnalysisInfo(); } @@ -331,7 +331,7 @@ public FunctionPass { public: - BasicBlockPassManager(int D) : PMDataManager(D) { } + BasicBlockPassManager(int Depth) : PMDataManager(Depth) { } /// Add a pass into a passmanager queue. bool addPass(Pass *p); @@ -372,7 +372,7 @@ public PMDataManager, public PMTopLevelManager { public: - FunctionPassManagerImpl_New(int D) : PMDataManager(D) { + FunctionPassManagerImpl_New(int Depth) : PMDataManager(Depth) { activeBBPassManager = NULL; } ~FunctionPassManagerImpl_New() { /* TODO */ }; @@ -449,7 +449,7 @@ class ModulePassManager : public Pass, public PMDataManager { public: - ModulePassManager(int D) : PMDataManager(D) { + ModulePassManager(int Depth) : PMDataManager(Depth) { activeFunctionPassManager = NULL; } @@ -490,7 +490,7 @@ public: - PassManagerImpl_New(int D) : PMDataManager(D) { + PassManagerImpl_New(int Depth) : PMDataManager(Depth) { activeManager = NULL; } @@ -674,12 +674,9 @@ // If Pass not found then check the interfaces implemented by Immutable Pass if (!P) { - const std::vector &ImmPI = -PI->getInterfacesImplemented(); - for (unsigned Index = 0, End = ImmPI.size(); - P == NULL && Index != End; ++Index) -if (ImmPI[Index] == AID) - P = *I; + const std::vector &ImmPI = PI->getInterfacesImplemented(); + if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end()) +P = *I; } } @@ -756,16 +753,13 @@ const std::vector &PreservedSet = AnUsage.getPreservedSet(); for (std::map::iterator I = AvailableAnalysis.begin(), E = AvailableAnalysis.end(); I != E; ) { -if (std::find(PreservedSet.begin(), PreservedSet.end(), I->first) == +std::map::iterator Info = I++; +if (std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == PreservedSet.end()) { // Remove this analysis - if (!dynamic_cast(I->second)) { -std::map::iterator J = I++; -AvailableAnalysis.erase(J); - } else -++I; -} else - ++I; + if (!dynamic_cast(Info->second)) +AvailableAnalysis.erase(Info); +} } } @@ -975,8 +969,8 @@ if (!BP) return false; - // If this pass does not preserve anlysis that is used by other passes - // managed by this manager than it is not a suiable pass for this manager. + // If this pass does not preserve analysis that is used by other passes + // managed by this manager than it is not a suitable pass for this manager. if (!manageablePass(P)) return false; @@ -1026,7 +1020,7 @@ recordAvailableAnalysis(P); removeDeadPasses(P, Msg2); } - return Changed | doFinalization(F); + return Changed |= doFinalization(F); } // Implement doInitialization and doFinalization @@ -1197,8 +1191,8 @@ if (!FP) return false; - // If this pass does not preserve anlysis that is used by other passes - // managed by this manager than it is not a suiable pass for this manager. + // If this pass does not preserve analysis that is used by other passes + // managed by this manager than it is not a suitable pass for this manager. if (!manageablePass(P)) return false; @@ -1224,7 +1218,7 @@ for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) this->runOnFunction(*I); - return Changed | doFinalization(M); + return Changed |= doFinalization(M); } /// Execute all of the passes scheduled for execution by invoking @@ -1366,8 +1360,8 @@ if (!MP) return false; - // If this pass does not preserve anlysis that is used by other passes - // managed by this manager than it is not a suiable pass for this manager. + // If this pass does not preserve analysis that is used by other passes + // managed by this manager than it is not a suitable pass for this manager. if (!manageablePass(P)) 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/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.40 -> 1.41 MachineBasicBlock.cpp updated: 1.36 -> 1.37 MachineInstr.cpp updated: 1.138 -> 1.139 --- Log message: An even better unbreakage... --- Diffs of the changes: (+24 -0) LiveInterval.cpp |7 +++ MachineBasicBlock.cpp |5 + MachineInstr.cpp | 12 3 files changed, 24 insertions(+) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.40 llvm/lib/CodeGen/LiveInterval.cpp:1.41 --- llvm/lib/CodeGen/LiveInterval.cpp:1.40 Wed Dec 6 19:30:31 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Fri Dec 15 16:57:14 2006 @@ -24,6 +24,7 @@ #include "llvm/Target/MRegisterInfo.h" #include #include +#include using namespace llvm; // An example for liveAt(): @@ -509,3 +510,9 @@ void LiveInterval::dump() const { cerr << *this << "\n"; } + + +OStream& llvm::operator<<(OStream& os, const LiveRange &LR) { + if (os.stream()) *os.stream() << LR; + return os; +} Index: llvm/lib/CodeGen/MachineBasicBlock.cpp diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36 llvm/lib/CodeGen/MachineBasicBlock.cpp:1.37 --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36 Thu Dec 7 14:28:15 2006 +++ llvm/lib/CodeGen/MachineBasicBlock.cpp Fri Dec 15 16:57:14 2006 @@ -31,6 +31,11 @@ return OS; } +OStream& llvm::operator<<(OStream &OS, const MachineBasicBlock &MBB) { + if (OS.stream()) *OS.stream() << MBB; + return OS; +} + // MBBs start out as #-1. When a MBB is added to a MachineFunction, it // gets the next available unique MBB number. If it is removed from a // MachineFunction, it goes back to being #-1. Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.138 llvm/lib/CodeGen/MachineInstr.cpp:1.139 --- llvm/lib/CodeGen/MachineInstr.cpp:1.138 Wed Dec 6 19:30:31 2006 +++ llvm/lib/CodeGen/MachineInstr.cpp Fri Dec 15 16:57:14 2006 @@ -18,6 +18,7 @@ #include "llvm/Target/MRegisterInfo.h" #include "llvm/Support/LeakDetector.h" #include "llvm/Support/Streams.h" +#include using namespace llvm; /// MachineInstr ctor - This constructor creates a dummy MachineInstr with @@ -363,3 +364,14 @@ return OS; } + +OStream& llvm::operator<<(OStream& os, const MachineInstr& minstr) { + if (os.stream()) *os.stream() << minstr; + return os; +} + +OStream& llvm::operator<<(OStream& os, const MachineOperand& mop) { + if (os.stream()) *os.stream() << mop; + return os; +} + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
Hold on. If you make these non-inlined, then the only chance for the compiler to remove potentially dead code (when o.stream() == 0) is through link time optimizations. Because this is still compiled by GCC right now, this won't be done and debug outputs will still be in the code. That is, they won't output anything, but the call will still be there. -bw On Dec 15, 2006, at 2:57 PM, Jeff Cohen wrote: > > > Changes in directory llvm/lib/CodeGen: > > LiveInterval.cpp updated: 1.40 -> 1.41 > MachineBasicBlock.cpp updated: 1.36 -> 1.37 > MachineInstr.cpp updated: 1.138 -> 1.139 > --- > Log message: > > An even better unbreakage... > > --- > Diffs of the changes: (+24 -0) > > LiveInterval.cpp |7 +++ > MachineBasicBlock.cpp |5 + > MachineInstr.cpp | 12 > 3 files changed, 24 insertions(+) > > > Index: llvm/lib/CodeGen/LiveInterval.cpp > diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.40 llvm/lib/CodeGen/ > LiveInterval.cpp:1.41 > --- llvm/lib/CodeGen/LiveInterval.cpp:1.40Wed Dec 6 19:30:31 2006 > +++ llvm/lib/CodeGen/LiveInterval.cpp Fri Dec 15 16:57:14 2006 > @@ -24,6 +24,7 @@ > #include "llvm/Target/MRegisterInfo.h" > #include > #include > +#include > using namespace llvm; > > // An example for liveAt(): > @@ -509,3 +510,9 @@ > void LiveInterval::dump() const { >cerr << *this << "\n"; > } > + > + > +OStream& llvm::operator<<(OStream& os, const LiveRange &LR) { > + if (os.stream()) *os.stream() << LR; > + return os; > +} > > > Index: llvm/lib/CodeGen/MachineBasicBlock.cpp > diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36 llvm/lib/ > CodeGen/MachineBasicBlock.cpp:1.37 > --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36 Thu Dec 7 14:28:15 > 2006 > +++ llvm/lib/CodeGen/MachineBasicBlock.cppFri Dec 15 16:57:14 2006 > @@ -31,6 +31,11 @@ >return OS; > } > > +OStream& llvm::operator<<(OStream &OS, const MachineBasicBlock > &MBB) { > + if (OS.stream()) *OS.stream() << MBB; > + return OS; > +} > + > // MBBs start out as #-1. When a MBB is added to a > MachineFunction, it > // gets the next available unique MBB number. If it is removed from a > // MachineFunction, it goes back to being #-1. > > > Index: llvm/lib/CodeGen/MachineInstr.cpp > diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.138 llvm/lib/CodeGen/ > MachineInstr.cpp:1.139 > --- llvm/lib/CodeGen/MachineInstr.cpp:1.138 Wed Dec 6 19:30:31 2006 > +++ llvm/lib/CodeGen/MachineInstr.cpp Fri Dec 15 16:57:14 2006 > @@ -18,6 +18,7 @@ > #include "llvm/Target/MRegisterInfo.h" > #include "llvm/Support/LeakDetector.h" > #include "llvm/Support/Streams.h" > +#include > using namespace llvm; > > /// MachineInstr ctor - This constructor creates a dummy > MachineInstr with > @@ -363,3 +364,14 @@ > >return OS; > } > + > +OStream& llvm::operator<<(OStream& os, const MachineInstr& minstr) { > + if (os.stream()) *os.stream() << minstr; > + return os; > +} > + > +OStream& llvm::operator<<(OStream& os, const MachineOperand& mop) { > + if (os.stream()) *os.stream() << mop; > + return os; > +} > + > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
Chris asked me to not include from header files, and to move stuff out of the header files if possible to make it so. Bill Wendling wrote: > Hold on. If you make these non-inlined, then the only chance for the > compiler to remove potentially dead code (when o.stream() == 0) is > through link time optimizations. Because this is still compiled by GCC > right now, this won't be done and debug outputs will still be in the > code. That is, they won't output anything, but the call will still be > there. > > -bw > > On Dec 15, 2006, at 2:57 PM, Jeff Cohen wrote: > >> >> >> Changes in directory llvm/lib/CodeGen: >> >> LiveInterval.cpp updated: 1.40 -> 1.41 >> MachineBasicBlock.cpp updated: 1.36 -> 1.37 >> MachineInstr.cpp updated: 1.138 -> 1.139 >> --- >> Log message: >> >> An even better unbreakage... >> >> --- >> Diffs of the changes: (+24 -0) >> >> LiveInterval.cpp |7 +++ >> MachineBasicBlock.cpp |5 + >> MachineInstr.cpp | 12 >> 3 files changed, 24 insertions(+) >> >> >> Index: llvm/lib/CodeGen/LiveInterval.cpp >> diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.40 >> llvm/lib/CodeGen/LiveInterval.cpp:1.41 >> --- llvm/lib/CodeGen/LiveInterval.cpp:1.40Wed Dec 6 19:30:31 2006 >> +++ llvm/lib/CodeGen/LiveInterval.cppFri Dec 15 16:57:14 2006 >> @@ -24,6 +24,7 @@ >> #include "llvm/Target/MRegisterInfo.h" >> #include >> #include >> +#include >> using namespace llvm; >> >> // An example for liveAt(): >> @@ -509,3 +510,9 @@ >> void LiveInterval::dump() const { >>cerr << *this << "\n"; >> } >> + >> + >> +OStream& llvm::operator<<(OStream& os, const LiveRange &LR) { >> + if (os.stream()) *os.stream() << LR; >> + return os; >> +} >> >> >> Index: llvm/lib/CodeGen/MachineBasicBlock.cpp >> diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36 >> llvm/lib/CodeGen/MachineBasicBlock.cpp:1.37 >> --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36Thu Dec 7 >> 14:28:15 2006 >> +++ llvm/lib/CodeGen/MachineBasicBlock.cppFri Dec 15 16:57:14 2006 >> @@ -31,6 +31,11 @@ >>return OS; >> } >> >> +OStream& llvm::operator<<(OStream &OS, const MachineBasicBlock &MBB) { >> + if (OS.stream()) *OS.stream() << MBB; >> + return OS; >> +} >> + >> // MBBs start out as #-1. When a MBB is added to a MachineFunction, it >> // gets the next available unique MBB number. If it is removed from a >> // MachineFunction, it goes back to being #-1. >> >> >> Index: llvm/lib/CodeGen/MachineInstr.cpp >> diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.138 >> llvm/lib/CodeGen/MachineInstr.cpp:1.139 >> --- llvm/lib/CodeGen/MachineInstr.cpp:1.138Wed Dec 6 19:30:31 2006 >> +++ llvm/lib/CodeGen/MachineInstr.cppFri Dec 15 16:57:14 2006 >> @@ -18,6 +18,7 @@ >> #include "llvm/Target/MRegisterInfo.h" >> #include "llvm/Support/LeakDetector.h" >> #include "llvm/Support/Streams.h" >> +#include >> using namespace llvm; >> >> /// MachineInstr ctor - This constructor creates a dummy >> MachineInstr with >> @@ -363,3 +364,14 @@ >> >>return OS; >> } >> + >> +OStream& llvm::operator<<(OStream& os, const MachineInstr& minstr) { >> + if (os.stream()) *os.stream() << minstr; >> + return os; >> +} >> + >> +OStream& llvm::operator<<(OStream& os, const MachineOperand& mop) { >> + if (os.stream()) *os.stream() << mop; >> + return os; >> +} >> + >> >> >> >> ___ >> llvm-commits mailing list >> llvm-commits@cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
That's reasonable. So then a better solution would be to keep everything in the .h file, but change operator<<(OStream&) to call the "print()" function directly. So something like this: #include // ... OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB) { if (*OS.stream()) MBB->print(*OS.stream()); return OS; } I'm still working on a nice way of implementing something like this: template class BaseStream { StreamTy *stream; public: operator StreamTy () { return *stream; } }; but I'm having problems figuring out the "null" stream semantics (right now, it uses "stream = 0" as an indication that it's "null"). But the above hack should suffice in the meantime. -bw On Dec 15, 2006, at 3:16 PM, Jeff Cohen wrote: > Chris asked me to not include from header files, and to > move stuff out of the header files if possible to make it so. > > Bill Wendling wrote: >> Hold on. If you make these non-inlined, then the only chance for >> the compiler to remove potentially dead code (when o.stream() == >> 0) is through link time optimizations. Because this is still >> compiled by GCC right now, this won't be done and debug outputs >> will still be in the code. That is, they won't output anything, >> but the call will still be there. >> >> -bw >> >> On Dec 15, 2006, at 2:57 PM, Jeff Cohen wrote: >> >>> >>> >>> Changes in directory llvm/lib/CodeGen: >>> >>> LiveInterval.cpp updated: 1.40 -> 1.41 >>> MachineBasicBlock.cpp updated: 1.36 -> 1.37 >>> MachineInstr.cpp updated: 1.138 -> 1.139 >>> --- >>> Log message: >>> >>> An even better unbreakage... >>> >>> --- >>> Diffs of the changes: (+24 -0) >>> >>> LiveInterval.cpp |7 +++ >>> MachineBasicBlock.cpp |5 + >>> MachineInstr.cpp | 12 >>> 3 files changed, 24 insertions(+) >>> >>> >>> Index: llvm/lib/CodeGen/LiveInterval.cpp >>> diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.40 llvm/lib/CodeGen/ >>> LiveInterval.cpp:1.41 >>> --- llvm/lib/CodeGen/LiveInterval.cpp:1.40Wed Dec 6 19:30:31 >>> 2006 >>> +++ llvm/lib/CodeGen/LiveInterval.cppFri Dec 15 16:57:14 2006 >>> @@ -24,6 +24,7 @@ >>> #include "llvm/Target/MRegisterInfo.h" >>> #include >>> #include >>> +#include >>> using namespace llvm; >>> >>> // An example for liveAt(): >>> @@ -509,3 +510,9 @@ >>> void LiveInterval::dump() const { >>>cerr << *this << "\n"; >>> } >>> + >>> + >>> +OStream& llvm::operator<<(OStream& os, const LiveRange &LR) { >>> + if (os.stream()) *os.stream() << LR; >>> + return os; >>> +} >>> >>> >>> Index: llvm/lib/CodeGen/MachineBasicBlock.cpp >>> diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36 llvm/lib/ >>> CodeGen/MachineBasicBlock.cpp:1.37 >>> --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36Thu Dec 7 >>> 14:28:15 2006 >>> +++ llvm/lib/CodeGen/MachineBasicBlock.cppFri Dec 15 16:57:14 >>> 2006 >>> @@ -31,6 +31,11 @@ >>>return OS; >>> } >>> >>> +OStream& llvm::operator<<(OStream &OS, const MachineBasicBlock >>> &MBB) { >>> + if (OS.stream()) *OS.stream() << MBB; >>> + return OS; >>> +} >>> + >>> // MBBs start out as #-1. When a MBB is added to a >>> MachineFunction, it >>> // gets the next available unique MBB number. If it is removed >>> from a >>> // MachineFunction, it goes back to being #-1. >>> >>> >>> Index: llvm/lib/CodeGen/MachineInstr.cpp >>> diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.138 llvm/lib/CodeGen/ >>> MachineInstr.cpp:1.139 >>> --- llvm/lib/CodeGen/MachineInstr.cpp:1.138Wed Dec 6 >>> 19:30:31 2006 >>> +++ llvm/lib/CodeGen/MachineInstr.cppFri Dec 15 16:57:14 2006 >>> @@ -18,6 +18,7 @@ >>> #include "llvm/Target/MRegisterInfo.h" >>> #include "llvm/Support/LeakDetector.h" >>> #include "llvm/Support/Streams.h" >>> +#include >>> using namespace llvm; >>> >>> /// MachineInstr ctor - This constructor creates a dummy >>> MachineInstr with >>> @@ -363,3 +364,14 @@ >>> >>>return OS; >>> } >>> + >>> +OStream& llvm::operator<<(OStream& os, const MachineInstr& >>> minstr) { >>> + if (os.stream()) *os.stream() << minstr; >>> + return os; >>> +} >>> + >>> +OStream& llvm::operator<<(OStream& os, const MachineOperand& mop) { >>> + if (os.stream()) *os.stream() << mop; >>> + return os; >>> +} >>> + >>> >>> >>> >>> ___ >>> llvm-commits mailing list >>> llvm-commits@cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> >> >> > ___ 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
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.444 -> 1.445 --- Log message: Expand fabs / fneg to and / xor. --- Diffs of the changes: (+22 -3) LegalizeDAG.cpp | 25 ++--- 1 files changed, 22 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.444 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.445 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.444 Fri Dec 15 16:42:55 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 15 18:52:40 2006 @@ -5055,9 +5055,6 @@ case ISD::SREM: Lo = ExpandLibCall("__moddi3" , Node, Hi); break; case ISD::UREM: Lo = ExpandLibCall("__umoddi3", Node, Hi); break; - case ISD::FNEG: -Lo = ExpandLibCall(((VT == MVT::f32) ? "__negsf2" : "__negdf2"), Node, Hi); -break; case ISD::FADD: Lo = ExpandLibCall(((VT == MVT::f32) ? "__addsf3" : "__adddf3"), Node, Hi); break; @@ -5107,6 +5104,28 @@ Lo = ExpandLibCall(FnName, Node, Hi); break; } + case ISD::FABS: { +SDOperand Mask = (VT == MVT::f64) + ? DAG.getConstantFP(BitsToDouble(~(1ULL << 63)), VT) + : DAG.getConstantFP(BitsToFloat(~(1U << 31)), VT); +Mask = DAG.getNode(ISD::BIT_CONVERT, NVT, Mask); +Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0)); +Lo = DAG.getNode(ISD::AND, NVT, Lo, Mask); +if (getTypeAction(NVT) == Expand) + ExpandOp(Lo, Lo, Hi); +break; + } + case ISD::FNEG: { +SDOperand Mask = (VT == MVT::f64) + ? DAG.getConstantFP(BitsToDouble(1ULL << 63), VT) + : DAG.getConstantFP(BitsToFloat(1U << 31), VT); +Mask = DAG.getNode(ISD::BIT_CONVERT, NVT, Mask); +Lo = DAG.getNode(ISD::BIT_CONVERT, NVT, Node->getOperand(0)); +Lo = DAG.getNode(ISD::XOR, NVT, Lo, Mask); +if (getTypeAction(NVT) == Expand) + ExpandOp(Lo, Lo, Hi); +break; + } } // Make sure the resultant values have been legalized themselves, unless this ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManager.cpp
Changes in directory llvm/lib/VMCore: PassManager.cpp updated: 1.106 -> 1.107 --- Log message: Add getNumContainedPasses() and getContainedPass() inteface and use it instead of passVectorBegin/End(). --- Diffs of the changes: (+91 -95) PassManager.cpp | 186 +++- 1 files changed, 91 insertions(+), 95 deletions(-) Index: llvm/lib/VMCore/PassManager.cpp diff -u llvm/lib/VMCore/PassManager.cpp:1.106 llvm/lib/VMCore/PassManager.cpp:1.107 --- llvm/lib/VMCore/PassManager.cpp:1.106 Fri Dec 15 16:57:49 2006 +++ llvm/lib/VMCore/PassManager.cpp Fri Dec 15 18:56:26 2006 @@ -272,14 +272,6 @@ /// then return NULL. Pass *findAnalysisPass(AnalysisID AID, bool Direction); - inline std::vector::iterator passVectorBegin() { -return PassVector.begin(); - } - - inline std::vector::iterator passVectorEnd() { -return PassVector.end(); - } - // Access toplevel manager PMTopLevelManager *getTopLevelManager() { return TPM; } void setTopLevelManager(PMTopLevelManager *T) { TPM = T; } @@ -297,6 +289,10 @@ return TransferLastUses; } + virtual unsigned getNumContainedPasses() { +return PassVector.size(); + } + protected: // If a FunctionPass F is the last user of ModulePass info M @@ -308,6 +304,9 @@ // Top level manager. PMTopLevelManager *TPM; + // Collection of pass that are managed by this manager + std::vector PassVector; + private: // Set of available Analysis. This information is used while scheduling // pass. If a pass requires an analysis which is not not available then @@ -315,9 +314,6 @@ // scheduled to run. std::map AvailableAnalysis; - // Collection of pass that are managed by this manager - std::vector PassVector; - unsigned Depth; }; @@ -353,12 +349,18 @@ // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { llvm::cerr << std::string(Offset*2, ' ') << "BasicBlockPass Manager\n"; -for (std::vector::iterator I = passVectorBegin(), - E = passVectorEnd(); I != E; ++I) { - (*I)->dumpPassStructure(Offset + 1); - dumpLastUses(*I, Offset+1); +for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { + BasicBlockPass *BP = getContainedPass(Index); + BP->dumpPassStructure(Offset + 1); + dumpLastUses(BP, Offset+1); } } + + BasicBlockPass *getContainedPass(unsigned N) { +assert ( N < PassVector.size() && "Pass number out of range!"); +BasicBlockPass *BP = static_cast(PassVector[N]); +return BP; + } }; //===--===// @@ -427,14 +429,20 @@ // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { -llvm::cerr << std::string(Offset*2, ' ') << "FunctionPass Manager\n"; -for (std::vector::iterator I = passVectorBegin(), - E = passVectorEnd(); I != E; ++I) { - (*I)->dumpPassStructure(Offset + 1); - dumpLastUses(*I, Offset+1); +llvm::cerr << std::string(Offset*2, ' ') << "FunctionPass Manager 42\n"; +for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { + FunctionPass *FP = getContainedPass(Index); + FP->dumpPassStructure(Offset + 1); + dumpLastUses(FP, Offset+1); } } + FunctionPass *getContainedPass(unsigned N) { +assert ( N < PassVector.size() && "Pass number out of range!"); +FunctionPass *FP = static_cast(PassVector[N]); +return FP; + } + private: // Active Pass Managers BasicBlockPassManager *activeBBPassManager; @@ -468,13 +476,19 @@ // Print passes managed by this manager void dumpPassStructure(unsigned Offset) { llvm::cerr << std::string(Offset*2, ' ') << "ModulePass Manager\n"; -for (std::vector::iterator I = passVectorBegin(), - E = passVectorEnd(); I != E; ++I) { - (*I)->dumpPassStructure(Offset + 1); - dumpLastUses(*I, Offset+1); +for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { + ModulePass *MP = getContainedPass(Index); + MP->dumpPassStructure(Offset + 1); + dumpLastUses(MP, Offset+1); } } + ModulePass *getContainedPass(unsigned N) { +assert ( N < PassVector.size() && "Pass number out of range!"); +ModulePass *MP = static_cast(PassVector[N]); +return MP; + } + private: // Active Pass Manager FunctionPassManagerImpl_New *activeFunctionPassManager; @@ -995,30 +1009,28 @@ std::string Msg3 = "' Made Modification '"; for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) -for (std::vector::iterator itr = passVectorBegin(), - e = passVectorEnd(); itr != e; ++itr) { - Pass *P = *itr; +for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { + BasicBlockPass *BP = getContainedPass(Index); AnalysisUsage AnUsage; - P->getAnalysisUsage(AnUsage); + BP->getAnalysisUsage(AnUsage);
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
On Dec 15, 2006, at 3:31 PM, Bill Wendling wrote: > That's reasonable. So then a better solution would be to keep > everything in the .h file, but change operator<<(OStream&) to call > the "print()" function directly. So something like this: > > #include > > // ... > > OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB) { >if (*OS.stream()) MBB->print(*OS.stream()); >return OS; > } > > I'm still working on a nice way of implementing something like this: > > template > class BaseStream { >StreamTy *stream; > public: >operator StreamTy () { return *stream; } > }; > > but I'm having problems figuring out the "null" stream semantics > (right now, it uses "stream = 0" as an indication that it's "null"). > But the above hack should suffice in the meantime. This is better, nice catch Bill! -Chris > > -bw > > On Dec 15, 2006, at 3:16 PM, Jeff Cohen wrote: > >> Chris asked me to not include from header files, and to >> move stuff out of the header files if possible to make it so. >> >> Bill Wendling wrote: >>> Hold on. If you make these non-inlined, then the only chance for >>> the compiler to remove potentially dead code (when o.stream() == >>> 0) is through link time optimizations. Because this is still >>> compiled by GCC right now, this won't be done and debug outputs >>> will still be in the code. That is, they won't output anything, >>> but the call will still be there. >>> >>> -bw >>> >>> On Dec 15, 2006, at 2:57 PM, Jeff Cohen wrote: >>> Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.40 -> 1.41 MachineBasicBlock.cpp updated: 1.36 -> 1.37 MachineInstr.cpp updated: 1.138 -> 1.139 --- Log message: An even better unbreakage... --- Diffs of the changes: (+24 -0) LiveInterval.cpp |7 +++ MachineBasicBlock.cpp |5 + MachineInstr.cpp | 12 3 files changed, 24 insertions(+) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.40 llvm/lib/CodeGen/ LiveInterval.cpp:1.41 --- llvm/lib/CodeGen/LiveInterval.cpp:1.40Wed Dec 6 19:30:31 2006 +++ llvm/lib/CodeGen/LiveInterval.cppFri Dec 15 16:57:14 2006 @@ -24,6 +24,7 @@ #include "llvm/Target/MRegisterInfo.h" #include #include +#include using namespace llvm; // An example for liveAt(): @@ -509,3 +510,9 @@ void LiveInterval::dump() const { cerr << *this << "\n"; } + + +OStream& llvm::operator<<(OStream& os, const LiveRange &LR) { + if (os.stream()) *os.stream() << LR; + return os; +} Index: llvm/lib/CodeGen/MachineBasicBlock.cpp diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36 llvm/lib/ CodeGen/MachineBasicBlock.cpp:1.37 --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36Thu Dec 7 14:28:15 2006 +++ llvm/lib/CodeGen/MachineBasicBlock.cppFri Dec 15 16:57:14 2006 @@ -31,6 +31,11 @@ return OS; } +OStream& llvm::operator<<(OStream &OS, const MachineBasicBlock &MBB) { + if (OS.stream()) *OS.stream() << MBB; + return OS; +} + // MBBs start out as #-1. When a MBB is added to a MachineFunction, it // gets the next available unique MBB number. If it is removed from a // MachineFunction, it goes back to being #-1. Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.138 llvm/lib/CodeGen/ MachineInstr.cpp:1.139 --- llvm/lib/CodeGen/MachineInstr.cpp:1.138Wed Dec 6 19:30:31 2006 +++ llvm/lib/CodeGen/MachineInstr.cppFri Dec 15 16:57:14 2006 @@ -18,6 +18,7 @@ #include "llvm/Target/MRegisterInfo.h" #include "llvm/Support/LeakDetector.h" #include "llvm/Support/Streams.h" +#include using namespace llvm; /// MachineInstr ctor - This constructor creates a dummy MachineInstr with @@ -363,3 +364,14 @@ return OS; } + +OStream& llvm::operator<<(OStream& os, const MachineInstr& minstr) { + if (os.stream()) *os.stream() << minstr; + return os; +} + +OStream& llvm::operator<<(OStream& os, const MachineOperand& mop) { + if (os.stream()) *os.stream() << mop; + return os; +} + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >>> >>> >>> >>> >> > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listin
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
I'll look into making this change. Part of the problem is that VC++ doesn't like *OS.stream() in a header file when isn't included, even if the declaration of std::basic_ostream shouldn't be needed (but doesn't have a problem with it in a .cpp file, probably because it isn't inlined then). This would appear to be a bug, but it also constrains my options. I could also just undo the change and go back to including in the header files. Gcc must be doing it implicitly anyway, as that's the only way some of that code can compile (which does need the declaration of std::basic_ostream). Bill Wendling wrote: > That's reasonable. So then a better solution would be to keep > everything in the .h file, but change operator<<(OStream&) to call the > "print()" function directly. So something like this: > > #include > > // ... > > OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB) { > if (*OS.stream()) MBB->print(*OS.stream()); > return OS; > } > > I'm still working on a nice way of implementing something like this: > > template > class BaseStream { > StreamTy *stream; > public: > operator StreamTy () { return *stream; } > }; > > but I'm having problems figuring out the "null" stream semantics > (right now, it uses "stream = 0" as an indication that it's "null"). > But the above hack should suffice in the meantime. > > -bw ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
On Dec 15, 2006, at 3:58 PM, Jeff Cohen wrote: > I'll look into making this change. > > Part of the problem is that VC++ doesn't like *OS.stream() in a header > file when isn't included, even if the declaration of > std::basic_ostream shouldn't be needed (but doesn't have a problem > with > it in a .cpp file, probably because it isn't inlined then). This > would > appear to be a bug, but it also constrains my options. > > I could also just undo the change and go back to including > in > the header files. Gcc must be doing it implicitly anyway, as > that's the > only way some of that code can compile (which does need the > declaration > of std::basic_ostream). If *OS.stream() isn't working, it seems likely that LLVMStream.h isn't getting #included. Alternatively, perhaps isn't? -Chris > > Bill Wendling wrote: >> That's reasonable. So then a better solution would be to keep >> everything in the .h file, but change operator<<(OStream&) to call >> the >> "print()" function directly. So something like this: >> >> #include >> >> // ... >> >> OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB) { >> if (*OS.stream()) MBB->print(*OS.stream()); >> return OS; >> } >> >> I'm still working on a nice way of implementing something like this: >> >> template >> class BaseStream { >> StreamTy *stream; >> public: >> operator StreamTy () { return *stream; } >> }; >> >> but I'm having problems figuring out the "null" stream semantics >> (right now, it uses "stream = 0" as an indication that it's "null"). >> But the above hack should suffice in the meantime. >> >> -bw > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ 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
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.445 -> 1.446 --- Log message: Allow promoted FP_TO_UINT / FP_TO_SINT to expand operand. --- Diffs of the changes: (+1 -2) LegalizeDAG.cpp |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.445 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.446 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.445 Fri Dec 15 18:52:40 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 15 20:10:30 2006 @@ -3155,6 +3155,7 @@ case ISD::FP_TO_UINT: switch (getTypeAction(Node->getOperand(0).getValueType())) { case Legal: +case Expand: Tmp1 = Node->getOperand(0); break; case Promote: @@ -3162,8 +3163,6 @@ // special. Tmp1 = PromoteOp(Node->getOperand(0)); break; -case Expand: - assert(0 && "not implemented"); } // If we're promoting a UINT to a larger size, check to see if the new node // will be legal. If it isn't, check to see if FP_TO_SINT is legal, since ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
I got it to work... I'll be committing shortly. I'm not sure what the problem was, but it seems to have something to do with resolving the overload of operator<< and almost certainly is a VC++ bug. It won't accept a forward declared type when it ought to. Chris Lattner wrote: > > On Dec 15, 2006, at 3:58 PM, Jeff Cohen wrote: > >> I'll look into making this change. >> >> Part of the problem is that VC++ doesn't like *OS.stream() in a header >> file when isn't included, even if the declaration of >> std::basic_ostream shouldn't be needed (but doesn't have a problem with >> it in a .cpp file, probably because it isn't inlined then). This would >> appear to be a bug, but it also constrains my options. >> >> I could also just undo the change and go back to including in >> the header files. Gcc must be doing it implicitly anyway, as that's the >> only way some of that code can compile (which does need the declaration >> of std::basic_ostream). > > If *OS.stream() isn't working, it seems likely that LLVMStream.h isn't > getting #included. Alternatively, perhaps isn't? > > -Chris > >> >> Bill Wendling wrote: >>> That's reasonable. So then a better solution would be to keep >>> everything in the .h file, but change operator<<(OStream&) to call the >>> "print()" function directly. So something like this: >>> >>> #include >>> >>> // ... >>> >>> OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB) { >>> if (*OS.stream()) MBB->print(*OS.stream()); >>> return OS; >>> } >>> >>> I'm still working on a nice way of implementing something like this: >>> >>> template >>> class BaseStream { >>> StreamTy *stream; >>> public: >>> operator StreamTy () { return *stream; } >>> }; >>> >>> but I'm having problems figuring out the "null" stream semantics >>> (right now, it uses "stream = 0" as an indication that it's "null"). >>> But the above hack should suffice in the meantime. >>> >>> -bw >> >> ___ >> llvm-commits mailing list >> llvm-commits@cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > > > ___ 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/LiveInterval.h MachineBasicBlock.h MachineInstr.h
Changes in directory llvm/include/llvm/CodeGen: LiveInterval.h updated: 1.32 -> 1.33 MachineBasicBlock.h updated: 1.52 -> 1.53 MachineInstr.h updated: 1.207 -> 1.208 --- Log message: The best unbreakage yet, addressing Bill's concerns. --- Diffs of the changes: (+30 -6) LiveInterval.h |7 ++- MachineBasicBlock.h |5 - MachineInstr.h | 24 3 files changed, 30 insertions(+), 6 deletions(-) Index: llvm/include/llvm/CodeGen/LiveInterval.h diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.32 llvm/include/llvm/CodeGen/LiveInterval.h:1.33 --- llvm/include/llvm/CodeGen/LiveInterval.h:1.32 Fri Dec 15 16:57:14 2006 +++ llvm/include/llvm/CodeGen/LiveInterval.hFri Dec 15 20:15:42 2006 @@ -56,13 +56,18 @@ } void dump() const; +void print(std::ostream &os) const; private: LiveRange(); // DO NOT IMPLEMENT }; std::ostream& operator<<(std::ostream& os, const LiveRange &LR); - OStream& operator<<(OStream& os, const LiveRange &LR); + inline OStream& operator<<(OStream& os, const LiveRange &LR) { +if (os.stream()) LR.print(*os.stream()); +return os; + } + inline bool operator<(unsigned V, const LiveRange &LR) { return V < LR.start; Index: llvm/include/llvm/CodeGen/MachineBasicBlock.h diff -u llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.52 llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.53 --- llvm/include/llvm/CodeGen/MachineBasicBlock.h:1.52 Fri Dec 15 16:57:14 2006 +++ llvm/include/llvm/CodeGen/MachineBasicBlock.h Fri Dec 15 20:15:42 2006 @@ -226,7 +226,10 @@ }; std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB); -OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB); +inline OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB) { + if (OS.stream()) MBB.print(*OS.stream()); + return OS; +} //======// // GraphTraits specializations for machine basic block graphs (machine-CFGs) Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.207 llvm/include/llvm/CodeGen/MachineInstr.h:1.208 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.207 Fri Dec 15 16:57:14 2006 +++ llvm/include/llvm/CodeGen/MachineInstr.hFri Dec 15 20:15:42 2006 @@ -76,6 +76,9 @@ int offset; MachineOperand() {} + + void print(std::ostream &os) const; + public: MachineOperand(const MachineOperand &M) { *this = M; @@ -285,8 +288,14 @@ IsDead = false; } - friend OStream& operator<<(OStream& os, const MachineOperand& mop); - friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop); + friend OStream& operator<<(OStream& os, const MachineOperand& mop) { +if (os.stream()) mop.print(*os.stream()); +return os; + } + friend std::ostream& operator<<(std::ostream& os, const MachineOperand& mop) { +mop.print(os); +return os; + } friend class MachineInstr; }; @@ -398,9 +407,16 @@ if (OS.stream()) print(*OS.stream(), TM); } void print(std::ostream &OS, const TargetMachine *TM) const; + void print(std::ostream &OS) const; void dump() const; - friend OStream& operator<<(OStream& os, const MachineInstr& minstr); - friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr); + friend OStream& operator<<(OStream& os, const MachineInstr& minstr) { +if (os.stream()) minstr.print(*os.stream()); +return os; + } + friend std::ostream& operator<<(std::ostream& os, const MachineInstr& minstr){ +minstr.print(os); +return os; + } //======// // Accessors to add operands when building up machine instructions. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp
Changes in directory llvm/lib/CodeGen: LiveInterval.cpp updated: 1.41 -> 1.42 MachineBasicBlock.cpp updated: 1.37 -> 1.38 MachineInstr.cpp updated: 1.139 -> 1.140 --- Log message: The best unbreakage yet, addressing Bill's concerns. --- Diffs of the changes: (+30 -49) LiveInterval.cpp |5 +-- MachineBasicBlock.cpp |5 --- MachineInstr.cpp | 69 -- 3 files changed, 30 insertions(+), 49 deletions(-) Index: llvm/lib/CodeGen/LiveInterval.cpp diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.41 llvm/lib/CodeGen/LiveInterval.cpp:1.42 --- llvm/lib/CodeGen/LiveInterval.cpp:1.41 Fri Dec 15 16:57:14 2006 +++ llvm/lib/CodeGen/LiveInterval.cpp Fri Dec 15 20:15:42 2006 @@ -512,7 +512,6 @@ } -OStream& llvm::operator<<(OStream& os, const LiveRange &LR) { - if (os.stream()) *os.stream() << LR; - return os; +void LiveRange::print(std::ostream &os) const { + os << *this; } Index: llvm/lib/CodeGen/MachineBasicBlock.cpp diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.37 llvm/lib/CodeGen/MachineBasicBlock.cpp:1.38 --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.37 Fri Dec 15 16:57:14 2006 +++ llvm/lib/CodeGen/MachineBasicBlock.cpp Fri Dec 15 20:15:42 2006 @@ -31,11 +31,6 @@ return OS; } -OStream& llvm::operator<<(OStream &OS, const MachineBasicBlock &MBB) { - if (OS.stream()) *OS.stream() << MBB; - return OS; -} - // MBBs start out as #-1. When a MBB is added to a MachineFunction, it // gets the next available unique MBB number. If it is removed from a // MachineFunction, it goes back to being #-1. Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.139 llvm/lib/CodeGen/MachineInstr.cpp:1.140 --- llvm/lib/CodeGen/MachineInstr.cpp:1.139 Fri Dec 15 16:57:14 2006 +++ llvm/lib/CodeGen/MachineInstr.cpp Fri Dec 15 20:15:42 2006 @@ -304,74 +304,61 @@ OS << "\n"; } -std::ostream &llvm::operator<<(std::ostream &os, const MachineInstr &MI) { +void MachineInstr::print(std::ostream &os) const { // If the instruction is embedded into a basic block, we can find the target // info for the instruction. - if (const MachineBasicBlock *MBB = MI.getParent()) { + if (const MachineBasicBlock *MBB = getParent()) { const MachineFunction *MF = MBB->getParent(); if (MF) - MI.print(os, &MF->getTarget()); + print(os, &MF->getTarget()); else - MI.print(os, 0); -return os; + print(os, 0); } // Otherwise, print it out in the "raw" format without symbolic register names // and such. - os << MI.getInstrDescriptor()->Name; + os << getInstrDescriptor()->Name; - for (unsigned i = 0, N = MI.getNumOperands(); i < N; i++) { -os << "\t" << MI.getOperand(i); -if (MI.getOperand(i).isReg() && MI.getOperand(i).isDef()) + for (unsigned i = 0, N = getNumOperands(); i < N; i++) { +os << "\t" << getOperand(i); +if (getOperand(i).isReg() && getOperand(i).isDef()) os << ""; } - return os << "\n"; + os << "\n"; } -std::ostream &llvm::operator<<(std::ostream &OS, const MachineOperand &MO) { - switch (MO.getType()) { - case MachineOperand::MO_Register: -OutputReg(OS, MO.getReg()); +void MachineOperand::print(std::ostream &OS) const { + switch (getType()) { + case MO_Register: +OutputReg(OS, getReg()); break; - case MachineOperand::MO_Immediate: -OS << (long)MO.getImmedValue(); + case MO_Immediate: +OS << (long)getImmedValue(); break; - case MachineOperand::MO_MachineBasicBlock: + case MO_MachineBasicBlock: OS << "getBasicBlock())->getName() - << "@" << (void*)MO.getMachineBasicBlock() << ">"; + << ((Value*)getMachineBasicBlock()->getBasicBlock())->getName() + << "@" << (void*)getMachineBasicBlock() << ">"; break; - case MachineOperand::MO_FrameIndex: -OS << ""; + case MO_FrameIndex: +OS << ""; break; - case MachineOperand::MO_ConstantPoolIndex: -OS << ""; + case MO_ConstantPoolIndex: +OS << ""; break; - case MachineOperand::MO_JumpTableIndex: -OS << ""; + case MO_JumpTableIndex: +OS << ""; break; - case MachineOperand::MO_GlobalAddress: -OS << "getName() << ">"; + case MO_GlobalAddress: +OS << "getName() << ">"; break; - case MachineOperand::MO_ExternalSymbol: -OS << ""; + case MO_ExternalSymbol: +OS << ""; break; default: assert(0 && "Unrecognized operand type"); break; } - - return OS; -} - -OStream& llvm::operator<<(OStream& os, const MachineInstr& minstr) { - if (os.stream()) *os.stream() << minstr; - return os; -} - -OStream& llvm::operator<<(OStream& os, const MachineOperand& mop) { - if (os.stream()) *os.stream() << mop; - return os; } ___ 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
Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.446 -> 1.447 --- Log message: Expand FP undef --- Diffs of the changes: (+1 -0) LegalizeDAG.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.446 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.447 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.446 Fri Dec 15 20:10:30 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Dec 15 20:20:50 2006 @@ -4523,6 +4523,7 @@ assert(0 && "Do not know how to expand this operator!"); abort(); case ISD::UNDEF: +NVT = TLI.getTypeToExpandTo(VT); Lo = DAG.getNode(ISD::UNDEF, NVT); Hi = DAG.getNode(ISD::UNDEF, NVT); break; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp
Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.173 -> 1.174 --- Log message: Fix PR1042: http://llvm.org/PR1042 , by tightening up the subtle rules with invoke value use. --- Diffs of the changes: (+37 -3) Verifier.cpp | 40 +--- 1 files changed, 37 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.173 llvm/lib/VMCore/Verifier.cpp:1.174 --- llvm/lib/VMCore/Verifier.cpp:1.173 Tue Dec 12 22:45:46 2006 +++ llvm/lib/VMCore/Verifier.cppFri Dec 15 20:25:35 2006 @@ -355,7 +355,8 @@ // Check that the argument values match the function type for this function... unsigned i = 0; - for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I, ++i) { + for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); + I != E; ++I, ++i) { Assert2(I->getType() == FT->getParamType(i), "Argument value does not match function argument type!", I, FT->getParamType(i)); @@ -898,9 +899,42 @@ if (!isa(I)) { // Invoke results are only usable in the normal destination, not in the // exceptional destination. -if (InvokeInst *II = dyn_cast(Op)) +if (InvokeInst *II = dyn_cast(Op)) { OpBlock = II->getNormalDest(); -else if (OpBlock == BB) { + + // If the normal successor of an invoke instruction has multiple + // predecessors, then the normal edge from the invoke is critical, so + // the invoke value can only be live if the destination block + // dominates all of it's predecessors (other than the invoke) or if + // the invoke value is only used by a phi in the successor. + if (!OpBlock->getSinglePredecessor() && + EF->dominates(&BB->getParent()->getEntryBlock(), BB)) { +// The first case we allow is if the use is a PHI operand in the +// normal block, and if that PHI operand corresponds to the invoke's +// block. +bool Bad = true; +if (PHINode *PN = dyn_cast(&I)) + if (PN->getParent() == OpBlock && + PN->getIncomingBlock(i/2) == Op->getParent()) +Bad = false; + +// If it is used by something non-phi, then the other case is that +// 'OpBlock' dominates all of its predecessors other than the +// invoke. In this case, the invoke value can still be used. +if (Bad) { + Bad = false; + for (pred_iterator PI = pred_begin(OpBlock), + E = pred_end(OpBlock); PI != E; ++PI) { +if (*PI != II->getParent() && !EF->dominates(OpBlock, *PI)) { + Bad = true; + break; +} + } +} +Assert1(!Bad, +"Invoke value defined on critical edge but not dead!", &I); + } +} else if (OpBlock == BB) { // If they are in the same basic block, make sure that the definition // comes before the use. Assert2(InstsInThisBlock.count(Op) || ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Verifier/invoke-1.ll invoke-2.ll
Changes in directory llvm/test/Regression/Verifier: invoke-1.ll added (r1.1) invoke-2.ll added (r1.1) --- Log message: testcases for PR1042: http://llvm.org/PR1042 --- Diffs of the changes: (+23 -0) invoke-1.ll | 10 ++ invoke-2.ll | 13 + 2 files changed, 23 insertions(+) Index: llvm/test/Regression/Verifier/invoke-1.ll diff -c /dev/null llvm/test/Regression/Verifier/invoke-1.ll:1.1 *** /dev/null Fri Dec 15 20:27:07 2006 --- llvm/test/Regression/Verifier/invoke-1.ll Fri Dec 15 20:26:57 2006 *** *** 0 --- 1,10 + ; RUN: not llvm-as < %s -o /dev/null -f + ; PR1042 + + int %foo() { + %A = invoke int %foo( ) + to label %L unwind label %L ; [#uses=1] + + L: ; preds = %0, %0 + ret int %A + } Index: llvm/test/Regression/Verifier/invoke-2.ll diff -c /dev/null llvm/test/Regression/Verifier/invoke-2.ll:1.1 *** /dev/null Fri Dec 15 20:27:12 2006 --- llvm/test/Regression/Verifier/invoke-2.ll Fri Dec 15 20:26:57 2006 *** *** 0 --- 1,13 + ; RUN: not llvm-as < %s -o /dev/null -f + ; PR1042 + + int %foo() { + br bool false, label %L1, label %L2 + L1: + %A = invoke int %foo() to label %L unwind label %L + + L2: + br label %L + L: + ret int %A + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll
Changes in directory llvm/test/Regression/Transforms/SimplifyCFG: 2003-08-05-InvokeCrash.ll updated: 1.3 -> 1.4 --- Log message: fix buggy testcase --- Diffs of the changes: (+3 -1) 2003-08-05-InvokeCrash.ll |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/test/Regression/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll diff -u llvm/test/Regression/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll:1.3 llvm/test/Regression/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll:1.4 --- llvm/test/Regression/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll:1.3 Fri Dec 1 22:23:10 2006 +++ llvm/test/Regression/Transforms/SimplifyCFG/2003-08-05-InvokeCrash.ll Fri Dec 15 20:29:22 2006 @@ -3,7 +3,9 @@ ; RUN: llvm-upgrade < %s | llvm-as | opt -simplifycfg -disable-output int %test() { - %A = invoke int %test() to label %Ret except label %Ret + %A = invoke int %test() to label %Ret except label %Ret2 Ret: ret int %A +Ret2: + ret int undef } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll
Changes in directory llvm/test/Regression/Transforms/InstCombine: 2003-10-29-CallSiteResolve.ll updated: 1.2 -> 1.3 --- Log message: Fix borken testcase --- Diffs of the changes: (+3 -1) 2003-10-29-CallSiteResolve.ll |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/test/Regression/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll diff -u llvm/test/Regression/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll:1.2 llvm/test/Regression/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll:1.3 --- llvm/test/Regression/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll:1.2 Fri Dec 1 22:23:09 2006 +++ llvm/test/Regression/Transforms/InstCombine/2003-10-29-CallSiteResolve.ll Fri Dec 15 20:30:24 2006 @@ -4,8 +4,10 @@ float* %foo() { %tmp.11 = invoke float* cast (int* ()* %bar to float* ()*)() - to label %invoke_cont except label %invoke_cont + to label %invoke_cont except label %X invoke_cont: ret float *%tmp.11 +X: + ret float *null } ___ 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.162 -> 1.163 --- Log message: Typo. --- Diffs of the changes: (+1 -1) SelectionDAGNodes.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.162 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.163 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.162 Thu Nov 9 11:53:01 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Sat Dec 16 00:21:55 2006 @@ -1481,7 +1481,7 @@ unsigned getAlignment() const { return Alignment; } bool isVolatile() const { return IsVolatile; } - static bool classof(const LoadSDNode *) { return true; } + static bool classof(const StoreSDNode *) { return true; } static bool classof(const SDNode *N) { return N->getOpcode() == ISD::STORE; } ___ 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/DAGCombiner.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.262 -> 1.263 --- Log message: Cannot combine an indexed load / store any further. --- Diffs of the changes: (+10 -1) DAGCombiner.cpp | 11 ++- 1 files changed, 10 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.262 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.263 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.262 Fri Dec 15 15:38:30 2006 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Dec 16 00:25:23 2006 @@ -2727,12 +2727,17 @@ SDOperand Ptr; MVT::ValueType VT; if (LoadSDNode *LD = dyn_cast(N)) { +if (LD->getAddressingMode() != ISD::UNINDEXED) + return false; VT = LD->getLoadedVT(); -if (!TLI.isIndexedLoadLegal(ISD::PRE_INC, VT) && +if (LD->getAddressingMode() != ISD::UNINDEXED && +!TLI.isIndexedLoadLegal(ISD::PRE_INC, VT) && !TLI.isIndexedLoadLegal(ISD::PRE_DEC, VT)) return false; Ptr = LD->getBasePtr(); } else if (StoreSDNode *ST = dyn_cast(N)) { +if (ST->getAddressingMode() != ISD::UNINDEXED) + return false; VT = ST->getStoredVT(); if (!TLI.isIndexedStoreLegal(ISD::PRE_INC, VT) && !TLI.isIndexedStoreLegal(ISD::PRE_DEC, VT)) @@ -2846,12 +2851,16 @@ SDOperand Ptr; MVT::ValueType VT; if (LoadSDNode *LD = dyn_cast(N)) { +if (LD->getAddressingMode() != ISD::UNINDEXED) + return false; VT = LD->getLoadedVT(); if (!TLI.isIndexedLoadLegal(ISD::POST_INC, VT) && !TLI.isIndexedLoadLegal(ISD::POST_DEC, VT)) return false; Ptr = LD->getBasePtr(); } else if (StoreSDNode *ST = dyn_cast(N)) { +if (ST->getAddressingMode() != ISD::UNINDEXED) + return false; VT = ST->getStoredVT(); if (!TLI.isIndexedStoreLegal(ISD::POST_INC, VT) && !TLI.isIndexedStoreLegal(ISD::POST_DEC, VT)) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits