From baldrick at free.fr Mon Jan 22 07:51:45 2007 From: baldrick at free.fr (Duncan Sands) Date: Mon, 22 Jan 2007 14:51:45 +0100 Subject: [llvm-commits] llvm-gcc4: gimplifier fixes In-Reply-To: <97E05E36-CCE8-4DB6-B0AE-DE40A82D894E@apple.com> References: <200701172216.06669.baldrick@free.fr> <97E05E36-CCE8-4DB6-B0AE-DE40A82D894E@apple.com> Message-ID: <200701221451.46558.baldrick@free.fr> Hi Devang, > > - if (TREE_CODE_CLASS (code) == tcc_unary > > + if ((TREE_CODE_CLASS (code) == tcc_unary || code == > > Eric Botcazou made similar changes in next line to fix Ada. Please > bring in entire patch and appropriate "APPLE LOCAL llvm" markers. I sent the minimal change needed to get Ada to build further, but I've certainly got nothing against the rest of Eric's patch, so here is the full version (it may also be useful for Fortran): Index: gcc.llvm.master/gcc/tree.c =================================================================== --- gcc.llvm.master.orig/gcc/tree.c 2007-01-21 23:09:08.000000000 +0100 +++ gcc.llvm.master/gcc/tree.c 2007-01-22 14:34:55.000000000 +0100 @@ -2601,11 +2601,13 @@ break; default: - if (TREE_CODE_CLASS (code) == tcc_unary + /* APPLE LOCAL llvm */ + if ((TREE_CODE_CLASS (code) == tcc_unary || code == VIEW_CONVERT_EXPR) && node && !TYPE_P (node) && TREE_CONSTANT (node)) TREE_CONSTANT (t) = 1; - if (TREE_CODE_CLASS (code) == tcc_unary + /* APPLE LOCAL llvm */ + if ((TREE_CODE_CLASS (code) == tcc_unary || code == VIEW_CONVERT_EXPR) && node && TREE_INVARIANT (node)) TREE_INVARIANT (t) = 1; if (TREE_CODE_CLASS (code) == tcc_reference From jlaskey at apple.com Mon Jan 22 08:14:01 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 22 Jan 2007 08:14:01 -0600 Subject: [llvm-commits] CVS: llvm/Xcode/LLVM.xcodeproj/project.pbxproj Message-ID: <200701221414.l0MEE1uM008442@zion.cs.uiuc.edu> Changes in directory llvm/Xcode/LLVM.xcodeproj: project.pbxproj updated: 1.27 -> 1.28 --- Log message: Bring up to date. --- Diffs of the changes: (+182 -165) project.pbxproj | 347 +++++++++++++++++++++++++++++--------------------------- 1 files changed, 182 insertions(+), 165 deletions(-) Index: llvm/Xcode/LLVM.xcodeproj/project.pbxproj diff -u llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.27 llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.28 --- llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.27 Sun Nov 5 15:21:20 2006 +++ llvm/Xcode/LLVM.xcodeproj/project.pbxproj Mon Jan 22 08:13:45 2007 @@ -128,7 +128,6 @@ CF73C0A4098A4FDF00627152 /* ValueSymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueSymbolTable.h; sourceTree = ""; }; CF73C0A5098A507300627152 /* ConstantFolding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstantFolding.h; sourceTree = ""; }; CF73C0A6098A507300627152 /* ET-Forest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ET-Forest.h"; sourceTree = ""; }; - CF73C0A8098A50C200627152 /* AutoUpgrade.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoUpgrade.h; sourceTree = ""; }; CF73C0A9098A50FD00627152 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; CF73C0AD098A519400627152 /* DataTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataTypes.h; sourceTree = ""; }; CF73C0AE098A51AD00627152 /* Alarm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Alarm.h; sourceTree = ""; }; @@ -138,7 +137,6 @@ CF73C0B7098A546000627152 /* RSProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RSProfiling.cpp; sourceTree = ""; }; CF73C0B8098A546000627152 /* RSProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSProfiling.h; sourceTree = ""; }; CF73C0B9098A546000627152 /* Reg2Mem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Reg2Mem.cpp; sourceTree = ""; }; - CF73C0BC098A551F00627152 /* AutoUpgrade.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AutoUpgrade.cpp; path = ../lib/VMCore/AutoUpgrade.cpp; sourceTree = SOURCE_ROOT; }; CF73C0BD098A551F00627152 /* InlineAsm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InlineAsm.cpp; path = ../lib/VMCore/InlineAsm.cpp; sourceTree = SOURCE_ROOT; }; CF73C0BE098A551F00627152 /* TypeSymbolTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSymbolTable.cpp; path = ../lib/VMCore/TypeSymbolTable.cpp; sourceTree = SOURCE_ROOT; }; CF73C0BF098A551F00627152 /* ValueSymbolTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueSymbolTable.cpp; path = ../lib/VMCore/ValueSymbolTable.cpp; sourceTree = SOURCE_ROOT; }; @@ -148,6 +146,71 @@ CF7FFA2109850864008B0087 /* ScheduleDAG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScheduleDAG.h; sourceTree = ""; }; CF8D62FA09C2226F006017BA /* Intrinsics.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Intrinsics.td; sourceTree = ""; }; CF8E00490989162500DA2399 /* Dwarf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Dwarf.h; sourceTree = ""; }; + CF8F1B410B64F6D100BB4199 /* RuntimeLibcalls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeLibcalls.h; sourceTree = ""; }; + CF8F1B420B64F70B00BB4199 /* PassManagers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassManagers.h; sourceTree = ""; }; + CF8F1B430B64F74400BB4199 /* Allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Allocator.h; sourceTree = ""; }; + CF8F1B440B64F74400BB4199 /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = ""; }; + CF8F1B450B64F74400BB4199 /* Disassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Disassembler.h; sourceTree = ""; }; + CF8F1B460B64F74400BB4199 /* ManagedStatic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagedStatic.h; sourceTree = ""; }; + CF8F1B470B64F74400BB4199 /* OutputBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OutputBuffer.h; sourceTree = ""; }; + CF8F1B490B64F7AB00BB4199 /* LinkTimeOptimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkTimeOptimizer.h; sourceTree = ""; }; + CF8F1B4D0B64F80700BB4199 /* AliasDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AliasDebugger.cpp; sourceTree = ""; }; + CF8F1B4E0B64F86A00BB4199 /* CStringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CStringMap.cpp; sourceTree = ""; }; + CF8F1B4F0B64F86A00BB4199 /* Disassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Disassembler.cpp; sourceTree = ""; }; + CF8F1B500B64F86A00BB4199 /* ManagedStatic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ManagedStatic.cpp; sourceTree = ""; }; + CF8F1B510B64F86A00BB4199 /* Streams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Streams.cpp; sourceTree = ""; }; + CF8F1B530B64F8C000BB4199 /* IncludeFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IncludeFile.cpp; sourceTree = ""; }; + CF8F1B540B64F90F00BB4199 /* AlphaBranchSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaBranchSelector.cpp; sourceTree = ""; }; + CF8F1B550B64F90F00BB4199 /* AlphaLLRP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaLLRP.cpp; sourceTree = ""; }; + CF8F1B560B64F98900BB4199 /* CBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CBackend.cpp; sourceTree = ""; }; + CF8F1B570B64F9AC00BB4199 /* PPCPredicates.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCPredicates.cpp; sourceTree = ""; }; + CF8F1B580B64F9AC00BB4199 /* PPCPredicates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCPredicates.h; sourceTree = ""; }; + CF8F1B590B64F9E100BB4199 /* X86COFF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X86COFF.h; sourceTree = ""; }; + CF8F1B5A0B64F9E100BB4199 /* X86InstrX86-64.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "X86InstrX86-64.td"; sourceTree = ""; }; + CF8F1B5B0B64FA2F00BB4199 /* PredicateSimplifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PredicateSimplifier.cpp; sourceTree = ""; }; + CF8F1B5C0B64FA7300BB4199 /* PassManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PassManager.cpp; path = ../lib/VMCore/PassManager.cpp; sourceTree = SOURCE_ROOT; }; + CF8F1B680B64FADA00BB4199 /* llvm-upgrade.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "llvm-upgrade.cpp"; sourceTree = ""; }; + CF8F1B720B64FADA00BB4199 /* UpgradeInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpgradeInternals.h; sourceTree = ""; }; + CF8F1B750B64FADA00BB4199 /* UpgradeLexer.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; path = UpgradeLexer.l; sourceTree = ""; }; + CF8F1B7C0B64FADA00BB4199 /* UpgradeParser.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; path = UpgradeParser.y; sourceTree = ""; }; + CF8F1B7F0B64FADA00BB4199 /* CppWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CppWriter.cpp; sourceTree = ""; }; + CF8F1B800B64FADA00BB4199 /* CppWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CppWriter.h; sourceTree = ""; }; + CF8F1B870B64FADA00BB4199 /* llvm2cpp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = llvm2cpp.cpp; sourceTree = ""; }; + CF8F1B950B64FB5000BB4199 /* ConfigLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConfigLexer.cpp; sourceTree = ""; }; + CF8F1B9D0B64FB7F00BB4199 /* lto-c.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "lto-c.cpp"; sourceTree = ""; }; + CF8F1B9E0B64FB7F00BB4199 /* lto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lto.cpp; sourceTree = ""; }; + CF8F1BAC0B64FB8000BB4199 /* AnalysisWrappers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnalysisWrappers.cpp; sourceTree = ""; }; + CF8F1BB70B64FB8000BB4199 /* GraphPrinters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphPrinters.cpp; sourceTree = ""; }; + CF8F1BB90B64FB8000BB4199 /* opt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = opt.cpp; sourceTree = ""; }; + CF8F1BBA0B64FB8000BB4199 /* PrintSCC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintSCC.cpp; sourceTree = ""; }; + CF8F1BC90B64FBD500BB4199 /* CodeGenIntrinsics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeGenIntrinsics.h; sourceTree = ""; }; + CF8F1BD10B64FC8A00BB4199 /* ARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARM.h; sourceTree = ""; }; + CF8F1BD20B64FC8A00BB4199 /* ARM.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARM.td; sourceTree = ""; }; + CF8F1BD30B64FC8A00BB4199 /* ARMAddressingModes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMAddressingModes.h; sourceTree = ""; }; + CF8F1BD40B64FC8A00BB4199 /* ARMAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMAsmPrinter.cpp; sourceTree = ""; }; + CF8F1BD50B64FC8A00BB4199 /* ARMConstantIslandPass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMConstantIslandPass.cpp; sourceTree = ""; }; + CF8F1BD60B64FC8A00BB4199 /* ARMConstantPoolValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMConstantPoolValue.cpp; sourceTree = ""; }; + CF8F1BD70B64FC8A00BB4199 /* ARMConstantPoolValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMConstantPoolValue.h; sourceTree = ""; }; + CF8F1BD80B64FC8A00BB4199 /* ARMFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMFrameInfo.h; sourceTree = ""; }; + CF8F1BD90B64FC8A00BB4199 /* ARMInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMInstrInfo.cpp; sourceTree = ""; }; + CF8F1BDA0B64FC8A00BB4199 /* ARMInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMInstrInfo.h; sourceTree = ""; }; + CF8F1BDB0B64FC8A00BB4199 /* ARMInstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMInstrInfo.td; sourceTree = ""; }; + CF8F1BDC0B64FC8A00BB4199 /* ARMInstrThumb.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMInstrThumb.td; sourceTree = ""; }; + CF8F1BDD0B64FC8A00BB4199 /* ARMInstrVFP.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMInstrVFP.td; sourceTree = ""; }; + CF8F1BDE0B64FC8A00BB4199 /* ARMISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMISelDAGToDAG.cpp; sourceTree = ""; }; + CF8F1BDF0B64FC8A00BB4199 /* ARMISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMISelLowering.cpp; sourceTree = ""; }; + CF8F1BE00B64FC8A00BB4199 /* ARMISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMISelLowering.h; sourceTree = ""; }; + CF8F1BE10B64FC8A00BB4199 /* ARMLoadStoreOptimizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMLoadStoreOptimizer.cpp; sourceTree = ""; }; + CF8F1BE20B64FC8A00BB4199 /* ARMMachineFunctionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMMachineFunctionInfo.h; sourceTree = ""; }; + CF8F1BE30B64FC8A00BB4199 /* ARMRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMRegisterInfo.cpp; sourceTree = ""; }; + CF8F1BE40B64FC8A00BB4199 /* ARMRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMRegisterInfo.h; sourceTree = ""; }; + CF8F1BE50B64FC8A00BB4199 /* ARMRegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ARMRegisterInfo.td; sourceTree = ""; }; + CF8F1BE60B64FC8A00BB4199 /* ARMSubtarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMSubtarget.cpp; sourceTree = ""; }; + CF8F1BE70B64FC8A00BB4199 /* ARMSubtarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMSubtarget.h; sourceTree = ""; }; + CF8F1BE80B64FC8A00BB4199 /* ARMTargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMTargetAsmInfo.cpp; sourceTree = ""; }; + CF8F1BE90B64FC8A00BB4199 /* ARMTargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMTargetAsmInfo.h; sourceTree = ""; }; + CF8F1BEA0B64FC8A00BB4199 /* ARMTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ARMTargetMachine.cpp; sourceTree = ""; }; + CF8F1BEB0B64FC8A00BB4199 /* ARMTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMTargetMachine.h; sourceTree = ""; }; CF9720240A9F3969002CEEDD /* MachOWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachOWriter.h; sourceTree = ""; }; CF9720260A9F39B9002CEEDD /* LinkAllPasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllPasses.h; sourceTree = ""; }; CF9720270A9F39B9002CEEDD /* LinkTimeOptimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkTimeOptimizer.h; sourceTree = ""; }; @@ -203,8 +266,7 @@ CFA702DA0A6FA8DD0006009A /* X86GenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenRegisterInfo.inc; sourceTree = ""; }; CFA702DB0A6FA8DD0006009A /* X86GenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenRegisterNames.inc; sourceTree = ""; }; CFA702DC0A6FA8DD0006009A /* X86GenSubtarget.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = X86GenSubtarget.inc; sourceTree = ""; }; - CFAA44870AE3BE6C0064BC97 /* HereStringSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HereStringSupport.h; sourceTree = ""; }; - CFAA448A0AE3BE890064BC97 /* HereStringSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HereStringSupport.cpp; sourceTree = ""; }; + CFABD0A20B09E342003EB061 /* PPCMachineFunctionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPCMachineFunctionInfo.h; sourceTree = ""; }; CFBD8B1A090E76540020B107 /* AlphaISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaISelDAGToDAG.cpp; sourceTree = ""; }; CFBD8B1B090E76540020B107 /* AlphaISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaISelLowering.cpp; sourceTree = ""; }; CFBD8B1C090E76540020B107 /* AlphaISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlphaISelLowering.h; sourceTree = ""; }; @@ -218,59 +280,19 @@ CFC244C00959F2E3009F8C47 /* IA64ISelLowering.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IA64ISelLowering.cpp; sourceTree = ""; }; CFC244C10959F2E3009F8C47 /* IA64ISelLowering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IA64ISelLowering.h; sourceTree = ""; }; CFD7E4F30A798FC3000C7379 /* LinkAllCodegenComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllCodegenComponents.h; sourceTree = ""; }; - CFD99A8B0AFE82160068D19C /* ARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARM.h; path = ../lib/Target/ARM/ARM.h; sourceTree = SOURCE_ROOT; }; - CFD99A8C0AFE82160068D19C /* ARM.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ARM.td; path = ../lib/Target/ARM/ARM.td; sourceTree = SOURCE_ROOT; }; - CFD99A8D0AFE82160068D19C /* ARMAsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ARMAsmPrinter.cpp; path = ../lib/Target/ARM/ARMAsmPrinter.cpp; sourceTree = SOURCE_ROOT; }; - CFD99A8E0AFE82160068D19C /* ARMFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMFrameInfo.h; path = ../lib/Target/ARM/ARMFrameInfo.h; sourceTree = SOURCE_ROOT; }; - CFD99A8F0AFE82160068D19C /* ARMGenAsmWriter.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = ARMGenAsmWriter.inc; path = ../lib/Target/ARM/ARMGenAsmWriter.inc; sourceTree = SOURCE_ROOT; }; - CFD99A900AFE82160068D19C /* ARMGenDAGISel.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = ARMGenDAGISel.inc; path = ../lib/Target/ARM/ARMGenDAGISel.inc; sourceTree = SOURCE_ROOT; }; - CFD99A910AFE82160068D19C /* ARMGenInstrInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = ARMGenInstrInfo.inc; path = ../lib/Target/ARM/ARMGenInstrInfo.inc; sourceTree = SOURCE_ROOT; }; - CFD99A920AFE82160068D19C /* ARMGenInstrNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = ARMGenInstrNames.inc; path = ../lib/Target/ARM/ARMGenInstrNames.inc; sourceTree = SOURCE_ROOT; }; - CFD99A930AFE82160068D19C /* ARMGenRegisterInfo.h.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = ARMGenRegisterInfo.h.inc; path = ../lib/Target/ARM/ARMGenRegisterInfo.h.inc; sourceTree = SOURCE_ROOT; }; - CFD99A940AFE82160068D19C /* ARMGenRegisterInfo.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = ARMGenRegisterInfo.inc; path = ../lib/Target/ARM/ARMGenRegisterInfo.inc; sourceTree = SOURCE_ROOT; }; - CFD99A950AFE82160068D19C /* ARMGenRegisterNames.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = ARMGenRegisterNames.inc; path = ../lib/Target/ARM/ARMGenRegisterNames.inc; sourceTree = SOURCE_ROOT; }; - CFD99A960AFE82160068D19C /* ARMInstrInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ARMInstrInfo.cpp; path = ../lib/Target/ARM/ARMInstrInfo.cpp; sourceTree = SOURCE_ROOT; }; - CFD99A970AFE82160068D19C /* ARMInstrInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMInstrInfo.h; path = ../lib/Target/ARM/ARMInstrInfo.h; sourceTree = SOURCE_ROOT; }; - CFD99A980AFE82160068D19C /* ARMInstrInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ARMInstrInfo.td; path = ../lib/Target/ARM/ARMInstrInfo.td; sourceTree = SOURCE_ROOT; }; - CFD99A990AFE82160068D19C /* ARMISelDAGToDAG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ARMISelDAGToDAG.cpp; path = ../lib/Target/ARM/ARMISelDAGToDAG.cpp; sourceTree = SOURCE_ROOT; }; - CFD99A9A0AFE82160068D19C /* ARMMul.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ARMMul.cpp; path = ../lib/Target/ARM/ARMMul.cpp; sourceTree = SOURCE_ROOT; }; - CFD99A9B0AFE82160068D19C /* ARMRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ARMRegisterInfo.cpp; path = ../lib/Target/ARM/ARMRegisterInfo.cpp; sourceTree = SOURCE_ROOT; }; - CFD99A9C0AFE82160068D19C /* ARMRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMRegisterInfo.h; path = ../lib/Target/ARM/ARMRegisterInfo.h; sourceTree = SOURCE_ROOT; }; - CFD99A9D0AFE82160068D19C /* ARMRegisterInfo.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ARMRegisterInfo.td; path = ../lib/Target/ARM/ARMRegisterInfo.td; sourceTree = SOURCE_ROOT; }; - CFD99A9E0AFE82160068D19C /* ARMTargetAsmInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ARMTargetAsmInfo.cpp; path = ../lib/Target/ARM/ARMTargetAsmInfo.cpp; sourceTree = SOURCE_ROOT; }; - CFD99A9F0AFE82160068D19C /* ARMTargetAsmInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMTargetAsmInfo.h; path = ../lib/Target/ARM/ARMTargetAsmInfo.h; sourceTree = SOURCE_ROOT; }; - CFD99AA00AFE82160068D19C /* ARMTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ARMTargetMachine.cpp; path = ../lib/Target/ARM/ARMTargetMachine.cpp; sourceTree = SOURCE_ROOT; }; - CFD99AA10AFE82160068D19C /* ARMTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMTargetMachine.h; path = ../lib/Target/ARM/ARMTargetMachine.h; sourceTree = SOURCE_ROOT; }; - CFD99AA20AFE82160068D19C /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = ../lib/Target/ARM/Makefile; sourceTree = SOURCE_ROOT; }; - CFD99AA30AFE82160068D19C /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.txt; path = ../lib/Target/ARM/README.txt; sourceTree = SOURCE_ROOT; }; CFD99AA80AFE827B0068D19C /* LICENSE.TXT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE.TXT; path = ../LICENSE.TXT; sourceTree = SOURCE_ROOT; }; CFD99AAD0AFE827B0068D19C /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.txt; path = ../README.txt; sourceTree = SOURCE_ROOT; }; - CFD99AB40AFE83910068D19C /* Allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Allocator.h; sourceTree = ""; }; - CFD99AB50AFE83910068D19C /* Compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Compiler.h; sourceTree = ""; }; - CFD99AB60AFE83910068D19C /* ManagedStatic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagedStatic.h; sourceTree = ""; }; CFD99AB70AFE848A0068D19C /* Allocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Allocator.cpp; sourceTree = ""; }; - CFD99AB80AFE848A0068D19C /* CStringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CStringMap.cpp; sourceTree = ""; }; - CFD99AB90AFE848A0068D19C /* ManagedStatic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ManagedStatic.cpp; sourceTree = ""; }; CFD99ABA0AFE84D70068D19C /* IncludeFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IncludeFile.cpp; sourceTree = ""; }; CFD99ABB0AFE84EF0068D19C /* Alarm.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; path = Alarm.inc; sourceTree = ""; }; - CFD99ABC0AFE852E0068D19C /* AlphaBranchSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaBranchSelector.cpp; sourceTree = ""; }; - CFD99ABD0AFE852E0068D19C /* AlphaLLRP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaLLRP.cpp; sourceTree = ""; }; CFD99ABE0AFE857A0068D19C /* README-X86-64.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "README-X86-64.txt"; sourceTree = ""; }; - CFD99ABF0AFE857A0068D19C /* X86InstrX86-64.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "X86InstrX86-64.td"; sourceTree = ""; }; - CFD99AC00AFE860B0068D19C /* PredicateSimplifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PredicateSimplifier.cpp; sourceTree = ""; }; - CFD99AC10AFE87030068D19C /* llvm-stub.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "llvm-stub.c"; path = "llvm-stub/llvm-stub.c"; sourceTree = ""; }; - CFD99AC20AFE87260068D19C /* CppWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CppWriter.cpp; path = llvm2cpp/CppWriter.cpp; sourceTree = ""; }; - CFD99AC30AFE87260068D19C /* CppWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CppWriter.h; path = llvm2cpp/CppWriter.h; sourceTree = ""; }; - CFD99AC40AFE87260068D19C /* llvm2cpp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = llvm2cpp.cpp; path = llvm2cpp/llvm2cpp.cpp; sourceTree = ""; }; CFD99ADA0AFE87650068D19C /* lto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lto.cpp; path = lto/lto.cpp; sourceTree = ""; }; CFD99ADB0AFE87870068D19C /* AnalysisWrappers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnalysisWrappers.cpp; path = opt/AnalysisWrappers.cpp; sourceTree = ""; }; CFD99ADC0AFE87870068D19C /* GraphPrinters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GraphPrinters.cpp; path = opt/GraphPrinters.cpp; sourceTree = ""; }; CFD99ADD0AFE87870068D19C /* opt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt.cpp; path = opt/opt.cpp; sourceTree = ""; }; CFD99ADE0AFE87870068D19C /* PrintSCC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintSCC.cpp; path = opt/PrintSCC.cpp; sourceTree = ""; }; - CFD99AE00AFE87DC0068D19C /* CodeGenIntrinsics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeGenIntrinsics.h; sourceTree = ""; }; CFE21C780A80CC0600D3E908 /* RegAllocRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegAllocRegistry.h; sourceTree = ""; }; CFE21C7B0A80CC1C00D3E908 /* SchedulerRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SchedulerRegistry.h; sourceTree = ""; }; - CFE420FA0A66F67300AB4BF6 /* CallTargets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallTargets.h; sourceTree = ""; }; CFE420FB0A66F67300AB4BF6 /* MachineJumpTableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachineJumpTableInfo.h; sourceTree = ""; }; CFE420FC0A66F67300AB4BF6 /* ValueTypes.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ValueTypes.td; sourceTree = ""; }; CFE420FD0A66F67300AB4BF6 /* Interpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Interpreter.h; sourceTree = ""; }; @@ -279,7 +301,6 @@ CFE421000A66F67300AB4BF6 /* IntrinsicsX86.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IntrinsicsX86.td; sourceTree = ""; }; CFE421010A66F67300AB4BF6 /* LinkAllVMCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkAllVMCore.h; sourceTree = ""; }; CFE421040A66F7AB00AB4BF6 /* ConstantRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantRange.cpp; sourceTree = ""; }; - CFE421050A66F7D800AB4BF6 /* CallTargets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallTargets.cpp; sourceTree = ""; }; CFE421060A66F86D00AB4BF6 /* ScheduleDAGRRList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScheduleDAGRRList.cpp; sourceTree = ""; }; CFE421070A66F8DC00AB4BF6 /* GraphWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphWriter.cpp; sourceTree = ""; }; CFE421090A66F93300AB4BF6 /* Alarm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Alarm.cpp; sourceTree = ""; }; @@ -352,7 +373,6 @@ DE66EC6808ABE86A00323D32 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Module.cpp; path = ../lib/VMCore/Module.cpp; sourceTree = SOURCE_ROOT; }; DE66EC6908ABE86A00323D32 /* ModuleProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleProvider.cpp; path = ../lib/VMCore/ModuleProvider.cpp; sourceTree = SOURCE_ROOT; }; DE66EC6A08ABE86A00323D32 /* Pass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Pass.cpp; path = ../lib/VMCore/Pass.cpp; sourceTree = SOURCE_ROOT; }; - DE66EC6B08ABE86A00323D32 /* PassManagerT.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PassManagerT.h; path = ../lib/VMCore/PassManagerT.h; sourceTree = SOURCE_ROOT; }; DE66EC6C08ABE86A00323D32 /* SymbolTable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolTable.cpp; path = ../lib/VMCore/SymbolTable.cpp; sourceTree = SOURCE_ROOT; }; DE66EC6D08ABE86A00323D32 /* SymbolTableListTraitsImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SymbolTableListTraitsImpl.h; path = ../lib/VMCore/SymbolTableListTraitsImpl.h; sourceTree = SOURCE_ROOT; }; DE66EC6E08ABE86A00323D32 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = ../lib/VMCore/Type.cpp; sourceTree = SOURCE_ROOT; }; @@ -381,18 +401,6 @@ DE66ECC108ABEC0700323D32 /* AliasSetTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AliasSetTracker.cpp; sourceTree = ""; }; DE66ECC208ABEC0700323D32 /* BasicAliasAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BasicAliasAnalysis.cpp; sourceTree = ""; }; DE66ECC308ABEC0700323D32 /* CFGPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CFGPrinter.cpp; sourceTree = ""; }; - DE66ECC508ABEC0700323D32 /* BottomUpClosure.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BottomUpClosure.cpp; sourceTree = ""; }; - DE66ECC608ABEC0700323D32 /* CompleteBottomUp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CompleteBottomUp.cpp; sourceTree = ""; }; - DE66ECC708ABEC0700323D32 /* DataStructure.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataStructure.cpp; sourceTree = ""; }; - DE66ECC808ABEC0700323D32 /* DataStructureAA.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataStructureAA.cpp; sourceTree = ""; }; - DE66ECC908ABEC0700323D32 /* DataStructureOpt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataStructureOpt.cpp; sourceTree = ""; }; - DE66ECCA08ABEC0700323D32 /* DataStructureStats.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataStructureStats.cpp; sourceTree = ""; }; - DE66ECE508ABEC0700323D32 /* EquivClassGraphs.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = EquivClassGraphs.cpp; sourceTree = ""; }; - DE66ECE608ABEC0700323D32 /* GraphChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphChecker.cpp; sourceTree = ""; }; - DE66ECE708ABEC0700323D32 /* Local.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Local.cpp; sourceTree = ""; }; - DE66ECE908ABEC0700323D32 /* Printer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Printer.cpp; sourceTree = ""; }; - DE66ECEA08ABEC0700323D32 /* Steensgaard.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Steensgaard.cpp; sourceTree = ""; }; - DE66ECEB08ABEC0700323D32 /* TopDownClosure.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TopDownClosure.cpp; sourceTree = ""; }; DE66ED1708ABEC0800323D32 /* InstCount.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = InstCount.cpp; sourceTree = ""; }; DE66ED1808ABEC0800323D32 /* Interval.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Interval.cpp; sourceTree = ""; }; DE66ED1908ABEC0800323D32 /* IntervalPartition.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IntervalPartition.cpp; sourceTree = ""; }; @@ -537,7 +545,6 @@ DE66EEAF08ABEE5E00323D32 /* AlphaTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = AlphaTargetMachine.cpp; sourceTree = ""; }; DE66EEB008ABEE5E00323D32 /* AlphaTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AlphaTargetMachine.h; sourceTree = ""; }; DE66EECA08ABEE5E00323D32 /* CTargetMachine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CTargetMachine.h; sourceTree = ""; }; - DE66EED008ABEE5E00323D32 /* Writer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Writer.cpp; sourceTree = ""; }; DE66EEF808ABEE5E00323D32 /* IA64.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IA64.h; sourceTree = ""; }; DE66EEF908ABEE5E00323D32 /* IA64.td */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = IA64.td; sourceTree = ""; }; DE66EEFA08ABEE5E00323D32 /* IA64AsmPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IA64AsmPrinter.cpp; sourceTree = ""; }; @@ -593,7 +600,6 @@ DE66F11B08ABEFB300323D32 /* ProfilingUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProfilingUtils.cpp; sourceTree = ""; }; DE66F11C08ABEFB300323D32 /* ProfilingUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfilingUtils.h; sourceTree = ""; }; DE66F11D08ABEFB300323D32 /* TraceBasicBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TraceBasicBlocks.cpp; sourceTree = ""; }; - DE66F11E08ABEFB300323D32 /* TraceValues.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TraceValues.cpp; sourceTree = ""; }; DE66F12008ABEFB300323D32 /* ArgumentPromotion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ArgumentPromotion.cpp; sourceTree = ""; }; DE66F12108ABEFB300323D32 /* ConstantMerge.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ConstantMerge.cpp; sourceTree = ""; }; DE66F12208ABEFB300323D32 /* DeadArgumentElimination.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DeadArgumentElimination.cpp; sourceTree = ""; }; @@ -677,11 +683,6 @@ DE66F20608ABF03100323D32 /* CallGraph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CallGraph.h; sourceTree = ""; }; DE66F20708ABF03100323D32 /* CFGPrinter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CFGPrinter.h; sourceTree = ""; }; DE66F20808ABF03100323D32 /* ConstantsScanner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ConstantsScanner.h; sourceTree = ""; }; - DE66F20A08ABF03100323D32 /* DataStructure.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DataStructure.h; sourceTree = ""; }; - DE66F20B08ABF03100323D32 /* DSGraph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DSGraph.h; sourceTree = ""; }; - DE66F20C08ABF03100323D32 /* DSGraphTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DSGraphTraits.h; sourceTree = ""; }; - DE66F20D08ABF03100323D32 /* DSNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DSNode.h; sourceTree = ""; }; - DE66F20E08ABF03100323D32 /* DSSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DSSupport.h; sourceTree = ""; }; DE66F20F08ABF03100323D32 /* Dominators.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Dominators.h; sourceTree = ""; }; DE66F21208ABF03100323D32 /* FindUsedTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FindUsedTypes.h; sourceTree = ""; }; DE66F21308ABF03100323D32 /* Interval.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Interval.h; sourceTree = ""; }; @@ -702,7 +703,6 @@ DE66F22208ABF03100323D32 /* Verifier.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Verifier.h; sourceTree = ""; }; DE66F22308ABF03100323D32 /* Argument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Argument.h; sourceTree = ""; }; DE66F22508ABF03100323D32 /* AsmAnnotationWriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = AsmAnnotationWriter.h; sourceTree = ""; }; - DE66F22608ABF03100323D32 /* CachedWriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedWriter.h; sourceTree = ""; }; DE66F22708ABF03100323D32 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Parser.h; sourceTree = ""; }; DE66F22808ABF03100323D32 /* PrintModulePass.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PrintModulePass.h; sourceTree = ""; }; DE66F22908ABF03100323D32 /* Writer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Writer.h; sourceTree = ""; }; @@ -978,6 +978,7 @@ isa = PBXGroup; children = ( DE66F1E908ABF03100323D32 /* include/llvm */, + CF8F1B480B64F7AB00BB4199 /* llvm-c */, DE66ECBD08ABEC0700323D32 /* lib/Analysis */, DE66EC8808ABEAC900323D32 /* lib/AsmParser */, DE66ECBC08ABEB8E00323D32 /* lib/Bytecode */, @@ -1001,47 +1002,88 @@ name = LLVM; sourceTree = ""; }; - CF065B2D0ABB318900555029 /* ARM */ = { + CF8F1B480B64F7AB00BB4199 /* llvm-c */ = { isa = PBXGroup; children = ( - CFD99A8B0AFE82160068D19C /* ARM.h */, - CFD99A8C0AFE82160068D19C /* ARM.td */, - CFD99A8D0AFE82160068D19C /* ARMAsmPrinter.cpp */, - CFD99A8E0AFE82160068D19C /* ARMFrameInfo.h */, - CFD99A8F0AFE82160068D19C /* ARMGenAsmWriter.inc */, - CFD99A900AFE82160068D19C /* ARMGenDAGISel.inc */, - CFD99A910AFE82160068D19C /* ARMGenInstrInfo.inc */, - CFD99A920AFE82160068D19C /* ARMGenInstrNames.inc */, - CFD99A930AFE82160068D19C /* ARMGenRegisterInfo.h.inc */, - CFD99A940AFE82160068D19C /* ARMGenRegisterInfo.inc */, - CFD99A950AFE82160068D19C /* ARMGenRegisterNames.inc */, - CFD99A960AFE82160068D19C /* ARMInstrInfo.cpp */, - CFD99A970AFE82160068D19C /* ARMInstrInfo.h */, - CFD99A980AFE82160068D19C /* ARMInstrInfo.td */, - CFD99A990AFE82160068D19C /* ARMISelDAGToDAG.cpp */, - CFD99A9A0AFE82160068D19C /* ARMMul.cpp */, - CFD99A9B0AFE82160068D19C /* ARMRegisterInfo.cpp */, - CFD99A9C0AFE82160068D19C /* ARMRegisterInfo.h */, - CFD99A9D0AFE82160068D19C /* ARMRegisterInfo.td */, - CFD99A9E0AFE82160068D19C /* ARMTargetAsmInfo.cpp */, - CFD99A9F0AFE82160068D19C /* ARMTargetAsmInfo.h */, - CFD99AA00AFE82160068D19C /* ARMTargetMachine.cpp */, - CFD99AA10AFE82160068D19C /* ARMTargetMachine.h */, - CFD99AA20AFE82160068D19C /* Makefile */, - CFD99AA30AFE82160068D19C /* README.txt */, + CF8F1B490B64F7AB00BB4199 /* LinkTimeOptimizer.h */, ); - name = ARM; - path = ARM; + name = "llvm-c"; + path = "../include/llvm-c"; + sourceTree = SOURCE_ROOT; + }; + CF8F1B5E0B64FADA00BB4199 /* llvm-upgrade */ = { + isa = PBXGroup; + children = ( + CF8F1B680B64FADA00BB4199 /* llvm-upgrade.cpp */, + CF8F1B720B64FADA00BB4199 /* UpgradeInternals.h */, + CF8F1B750B64FADA00BB4199 /* UpgradeLexer.l */, + CF8F1B7C0B64FADA00BB4199 /* UpgradeParser.y */, + ); + path = "llvm-upgrade"; + sourceTree = ""; + }; + CF8F1B7E0B64FADA00BB4199 /* llvm2cpp */ = { + isa = PBXGroup; + children = ( + CF8F1B7F0B64FADA00BB4199 /* CppWriter.cpp */, + CF8F1B800B64FADA00BB4199 /* CppWriter.h */, + CF8F1B870B64FADA00BB4199 /* llvm2cpp.cpp */, + ); + path = llvm2cpp; sourceTree = ""; }; - CFD99AC50AFE872B0068D19C /* llvm2cpp */ = { + CF8F1B960B64FB7F00BB4199 /* lto */ = { isa = PBXGroup; children = ( - CFD99AC20AFE87260068D19C /* CppWriter.cpp */, - CFD99AC30AFE87260068D19C /* CppWriter.h */, - CFD99AC40AFE87260068D19C /* llvm2cpp.cpp */, + CF8F1B9D0B64FB7F00BB4199 /* lto-c.cpp */, + CF8F1B9E0B64FB7F00BB4199 /* lto.cpp */, ); - name = llvm2cpp; + path = lto; + sourceTree = ""; + }; + CF8F1BAB0B64FB8000BB4199 /* opt */ = { + isa = PBXGroup; + children = ( + CF8F1BAC0B64FB8000BB4199 /* AnalysisWrappers.cpp */, + CF8F1BB70B64FB8000BB4199 /* GraphPrinters.cpp */, + CF8F1BB90B64FB8000BB4199 /* opt.cpp */, + CF8F1BBA0B64FB8000BB4199 /* PrintSCC.cpp */, + ); + path = opt; + sourceTree = ""; + }; + CF8F1BCF0B64FC8A00BB4199 /* ARM */ = { + isa = PBXGroup; + children = ( + CF8F1BD10B64FC8A00BB4199 /* ARM.h */, + CF8F1BD20B64FC8A00BB4199 /* ARM.td */, + CF8F1BD30B64FC8A00BB4199 /* ARMAddressingModes.h */, + CF8F1BD40B64FC8A00BB4199 /* ARMAsmPrinter.cpp */, + CF8F1BD50B64FC8A00BB4199 /* ARMConstantIslandPass.cpp */, + CF8F1BD60B64FC8A00BB4199 /* ARMConstantPoolValue.cpp */, + CF8F1BD70B64FC8A00BB4199 /* ARMConstantPoolValue.h */, + CF8F1BD80B64FC8A00BB4199 /* ARMFrameInfo.h */, + CF8F1BD90B64FC8A00BB4199 /* ARMInstrInfo.cpp */, + CF8F1BDA0B64FC8A00BB4199 /* ARMInstrInfo.h */, + CF8F1BDB0B64FC8A00BB4199 /* ARMInstrInfo.td */, + CF8F1BDC0B64FC8A00BB4199 /* ARMInstrThumb.td */, + CF8F1BDD0B64FC8A00BB4199 /* ARMInstrVFP.td */, + CF8F1BDE0B64FC8A00BB4199 /* ARMISelDAGToDAG.cpp */, + CF8F1BDF0B64FC8A00BB4199 /* ARMISelLowering.cpp */, + CF8F1BE00B64FC8A00BB4199 /* ARMISelLowering.h */, + CF8F1BE10B64FC8A00BB4199 /* ARMLoadStoreOptimizer.cpp */, + CF8F1BE20B64FC8A00BB4199 /* ARMMachineFunctionInfo.h */, + CF8F1BE30B64FC8A00BB4199 /* ARMRegisterInfo.cpp */, + CF8F1BE40B64FC8A00BB4199 /* ARMRegisterInfo.h */, + CF8F1BE50B64FC8A00BB4199 /* ARMRegisterInfo.td */, + CF8F1BE60B64FC8A00BB4199 /* ARMSubtarget.cpp */, + CF8F1BE70B64FC8A00BB4199 /* ARMSubtarget.h */, + CF8F1BE80B64FC8A00BB4199 /* ARMTargetAsmInfo.cpp */, + CF8F1BE90B64FC8A00BB4199 /* ARMTargetAsmInfo.h */, + CF8F1BEA0B64FC8A00BB4199 /* ARMTargetMachine.cpp */, + CF8F1BEB0B64FC8A00BB4199 /* ARMTargetMachine.h */, + ); + path = ARM; sourceTree = ""; }; CFD99ADF0AFE878F0068D19C /* opt */ = { @@ -1067,7 +1109,6 @@ isa = PBXGroup; children = ( DE66EC5B08ABE86900323D32 /* AsmWriter.cpp */, - CF73C0BC098A551F00627152 /* AutoUpgrade.cpp */, DE66EC5C08ABE86A00323D32 /* BasicBlock.cpp */, DE66EC5D08ABE86A00323D32 /* ConstantFolding.cpp */, DE66EC5E08ABE86A00323D32 /* ConstantFolding.h */, @@ -1084,7 +1125,7 @@ DE66EC6808ABE86A00323D32 /* Module.cpp */, DE66EC6908ABE86A00323D32 /* ModuleProvider.cpp */, DE66EC6A08ABE86A00323D32 /* Pass.cpp */, - DE66EC6B08ABE86A00323D32 /* PassManagerT.h */, + CF8F1B5C0B64FA7300BB4199 /* PassManager.cpp */, DE66EC6C08ABE86A00323D32 /* SymbolTable.cpp */, DE66EC6D08ABE86A00323D32 /* SymbolTableListTraitsImpl.h */, DE66EC6E08ABE86A00323D32 /* Type.cpp */, @@ -1158,11 +1199,11 @@ DE66ECBD08ABEC0700323D32 /* lib/Analysis */ = { isa = PBXGroup; children = ( - DE66ECC408ABEC0700323D32 /* DataStructure */, DE66ED1A08ABEC0800323D32 /* IPA */, DE66ECBE08ABEC0700323D32 /* AliasAnalysis.cpp */, DE66ECBF08ABEC0700323D32 /* AliasAnalysisCounter.cpp */, DE66ECC008ABEC0700323D32 /* AliasAnalysisEvaluator.cpp */, + CF8F1B4D0B64F80700BB4199 /* AliasDebugger.cpp */, DE66ECC108ABEC0700323D32 /* AliasSetTracker.cpp */, DE66ECC208ABEC0700323D32 /* BasicAliasAnalysis.cpp */, DE66ECC308ABEC0700323D32 /* CFGPrinter.cpp */, @@ -1186,26 +1227,6 @@ path = ../lib/Analysis; sourceTree = SOURCE_ROOT; }; - DE66ECC408ABEC0700323D32 /* DataStructure */ = { - isa = PBXGroup; - children = ( - DE66ECC508ABEC0700323D32 /* BottomUpClosure.cpp */, - CFE421050A66F7D800AB4BF6 /* CallTargets.cpp */, - DE66ECC608ABEC0700323D32 /* CompleteBottomUp.cpp */, - DE66ECC708ABEC0700323D32 /* DataStructure.cpp */, - DE66ECC808ABEC0700323D32 /* DataStructureAA.cpp */, - DE66ECC908ABEC0700323D32 /* DataStructureOpt.cpp */, - DE66ECCA08ABEC0700323D32 /* DataStructureStats.cpp */, - DE66ECE508ABEC0700323D32 /* EquivClassGraphs.cpp */, - DE66ECE608ABEC0700323D32 /* GraphChecker.cpp */, - DE66ECE708ABEC0700323D32 /* Local.cpp */, - DE66ECE908ABEC0700323D32 /* Printer.cpp */, - DE66ECEA08ABEC0700323D32 /* Steensgaard.cpp */, - DE66ECEB08ABEC0700323D32 /* TopDownClosure.cpp */, - ); - path = DataStructure; - sourceTree = ""; - }; DE66ED1A08ABEC0800323D32 /* IPA */ = { isa = PBXGroup; children = ( @@ -1341,18 +1362,20 @@ DE66EDFC08ABEDE600323D32 /* Annotation.cpp */, DE66EE1D08ABEDE600323D32 /* CommandLine.cpp */, DE66EE1E08ABEDE600323D32 /* Compressor.cpp */, - CFD99AB80AFE848A0068D19C /* CStringMap.cpp */, + CF8F1B4E0B64F86A00BB4199 /* CStringMap.cpp */, DE66EE3D08ABEDE600323D32 /* Debug.cpp */, + CF8F1B4F0B64F86A00BB4199 /* Disassembler.cpp */, CF79495D09B326D4005ADFCA /* Dwarf.cpp */, DE66EE3E08ABEDE600323D32 /* FileUtilities.cpp */, CF42B6C40AF2512000D5D47C /* FoldingSet.cpp */, CFE421070A66F8DC00AB4BF6 /* GraphWriter.cpp */, DE66EE3F08ABEDE600323D32 /* IsInf.cpp */, DE66EE4008ABEDE600323D32 /* IsNAN.cpp */, - CFD99AB90AFE848A0068D19C /* ManagedStatic.cpp */, + CF8F1B500B64F86A00BB4199 /* ManagedStatic.cpp */, DE66EE4208ABEDE600323D32 /* PluginLoader.cpp */, DE66EE4308ABEDE600323D32 /* SlowOperationInformer.cpp */, DE66EE4408ABEDE600323D32 /* Statistic.cpp */, + CF8F1B510B64F86A00BB4199 /* Streams.cpp */, DE66EE4508ABEDE700323D32 /* StringExtras.cpp */, DE66EE4608ABEDE700323D32 /* SystemUtils.cpp */, DE66EE4708ABEDE700323D32 /* Timer.cpp */, @@ -1389,6 +1412,7 @@ DE66EE8B08ABEE3500323D32 /* Win32 */, CFE421090A66F93300AB4BF6 /* Alarm.cpp */, DE66EE6008ABEE3400323D32 /* DynamicLibrary.cpp */, + CF8F1B530B64F8C000BB4199 /* IncludeFile.cpp */, DE66EE6108ABEE3400323D32 /* LICENSE.TXT */, CFD99ABA0AFE84D70068D19C /* IncludeFile.cpp */, DE66EE6208ABEE3400323D32 /* ltdl.c */, @@ -1456,8 +1480,8 @@ isa = PBXGroup; children = ( DE66EE9708ABEE5D00323D32 /* Alpha */, + CF8F1BCF0B64FC8A00BB4199 /* ARM */, DE66EEC908ABEE5E00323D32 /* CBackend */, - CF065B2D0ABB318900555029 /* ARM */, DE66EEE508ABEE5E00323D32 /* IA64 */, DE66EF1108ABEE5E00323D32 /* PowerPC */, DE66EF7008ABEE5F00323D32 /* Sparc */, @@ -1482,6 +1506,11 @@ DE66EE9708ABEE5D00323D32 /* Alpha */ = { isa = PBXGroup; children = ( + DE66EE9808ABEE5E00323D32 /* Alpha.h */, + DE66EE9908ABEE5E00323D32 /* Alpha.td */, + DE66EE9A08ABEE5E00323D32 /* AlphaAsmPrinter.cpp */, + CF8F1B540B64F90F00BB4199 /* AlphaBranchSelector.cpp */, + DE66EE9B08ABEE5E00323D32 /* AlphaCodeEmitter.cpp */, CFA702BB0A6FA85F0006009A /* AlphaGenAsmWriter.inc */, CFA702BC0A6FA85F0006009A /* AlphaGenCodeEmitter.inc */, CFA702BD0A6FA85F0006009A /* AlphaGenDAGISel.inc */, @@ -1491,28 +1520,23 @@ CFA702C10A6FA85F0006009A /* AlphaGenRegisterInfo.inc */, CFA702C20A6FA85F0006009A /* AlphaGenRegisterNames.inc */, CFA702C30A6FA85F0006009A /* AlphaGenSubtarget.inc */, - DE66EE9808ABEE5E00323D32 /* Alpha.h */, - CFD99ABC0AFE852E0068D19C /* AlphaBranchSelector.cpp */, - CFBD8B1A090E76540020B107 /* AlphaISelDAGToDAG.cpp */, - CFBD8B1B090E76540020B107 /* AlphaISelLowering.cpp */, - CFBD8B1C090E76540020B107 /* AlphaISelLowering.h */, - CFBD8B1D090E76540020B107 /* AlphaSubtarget.cpp */, - CFBD8B1E090E76540020B107 /* AlphaSubtarget.h */, - DE66EE9908ABEE5E00323D32 /* Alpha.td */, - DE66EE9A08ABEE5E00323D32 /* AlphaAsmPrinter.cpp */, - DE66EE9B08ABEE5E00323D32 /* AlphaCodeEmitter.cpp */, DE66EEA308ABEE5E00323D32 /* AlphaInstrFormats.td */, DE66EEA408ABEE5E00323D32 /* AlphaInstrInfo.cpp */, DE66EEA508ABEE5E00323D32 /* AlphaInstrInfo.h */, DE66EEA608ABEE5E00323D32 /* AlphaInstrInfo.td */, + CFBD8B1A090E76540020B107 /* AlphaISelDAGToDAG.cpp */, + CFBD8B1B090E76540020B107 /* AlphaISelLowering.cpp */, + CFBD8B1C090E76540020B107 /* AlphaISelLowering.h */, DE66EEA908ABEE5E00323D32 /* AlphaJITInfo.cpp */, DE66EEAA08ABEE5E00323D32 /* AlphaJITInfo.h */, - CFD99ABD0AFE852E0068D19C /* AlphaLLRP.cpp */, - CFE4210B0A66F96400AB4BF6 /* AlphaSchedule.td */, + CF8F1B550B64F90F00BB4199 /* AlphaLLRP.cpp */, DE66EEAB08ABEE5E00323D32 /* AlphaRegisterInfo.cpp */, DE66EEAC08ABEE5E00323D32 /* AlphaRegisterInfo.h */, DE66EEAD08ABEE5E00323D32 /* AlphaRegisterInfo.td */, DE66EEAE08ABEE5E00323D32 /* AlphaRelocations.h */, + CFE4210B0A66F96400AB4BF6 /* AlphaSchedule.td */, + CFBD8B1D090E76540020B107 /* AlphaSubtarget.cpp */, + CFBD8B1E090E76540020B107 /* AlphaSubtarget.h */, CF341DAE0AB07A8B0099B064 /* AlphaTargetAsmInfo.cpp */, CF341DAD0AB07A8B0099B064 /* AlphaTargetAsmInfo.h */, DE66EEAF08ABEE5E00323D32 /* AlphaTargetMachine.cpp */, @@ -1524,8 +1548,8 @@ DE66EEC908ABEE5E00323D32 /* CBackend */ = { isa = PBXGroup; children = ( + CF8F1B560B64F98900BB4199 /* CBackend.cpp */, DE66EECA08ABEE5E00323D32 /* CTargetMachine.h */, - DE66EED008ABEE5E00323D32 /* Writer.cpp */, ); path = CBackend; sourceTree = ""; @@ -1598,8 +1622,11 @@ CFE421250A66FA2D00AB4BF6 /* PPCISelLowering.h */, CFE421260A66FA2D00AB4BF6 /* PPCJITInfo.cpp */, CFE421270A66FA2D00AB4BF6 /* PPCJITInfo.h */, + CFABD0A20B09E342003EB061 /* PPCMachineFunctionInfo.h */, CF9720890A9F3C04002CEEDD /* PPCMachOWriter.cpp */, CFE421280A66FA2D00AB4BF6 /* PPCPerfectShuffle.h */, + CF8F1B570B64F9AC00BB4199 /* PPCPredicates.cpp */, + CF8F1B580B64F9AC00BB4199 /* PPCPredicates.h */, CFE421290A66FA2D00AB4BF6 /* PPCRegisterInfo.cpp */, CFE4212A0A66FA2D00AB4BF6 /* PPCRegisterInfo.h */, CFE4212B0A66FA2D00AB4BF6 /* PPCRegisterInfo.td */, @@ -1683,13 +1710,14 @@ DE66F0C008ABEE6000323D32 /* X86ATTAsmPrinter.cpp */, DE66F0C108ABEE6000323D32 /* X86ATTAsmPrinter.h */, DE66F0C208ABEE6000323D32 /* X86CodeEmitter.cpp */, + CF8F1B590B64F9E100BB4199 /* X86COFF.h */, DE66F0C308ABEE6000323D32 /* X86ELFWriter.cpp */, DE66F0C408ABEE6000323D32 /* X86FloatingPoint.cpp */, DE66F0CC08ABEE6000323D32 /* X86InstrBuilder.h */, DE66F0CD08ABEE6000323D32 /* X86InstrInfo.cpp */, DE66F0CE08ABEE6000323D32 /* X86InstrInfo.h */, DE66F0CF08ABEE6100323D32 /* X86InstrInfo.td */, - CFD99ABF0AFE857A0068D19C /* X86InstrX86-64.td */, + CF8F1B5A0B64F9E100BB4199 /* X86InstrX86-64.td */, DE66F0D008ABEE6100323D32 /* X86IntelAsmPrinter.cpp */, DE66F0D108ABEE6100323D32 /* X86IntelAsmPrinter.h */, DE66F0D508ABEE6100323D32 /* X86JITInfo.cpp */, @@ -1740,7 +1768,6 @@ CF73C0B7098A546000627152 /* RSProfiling.cpp */, CF73C0B8098A546000627152 /* RSProfiling.h */, DE66F11D08ABEFB300323D32 /* TraceBasicBlocks.cpp */, - DE66F11E08ABEFB300323D32 /* TraceValues.cpp */, ); path = Instrumentation; sourceTree = ""; @@ -1791,7 +1818,7 @@ DE66F1AA08ABEFB400323D32 /* LoopUnswitch.cpp */, DE66F1AD08ABEFB400323D32 /* LowerGC.cpp */, DE66F1AF08ABEFB400323D32 /* LowerPacked.cpp */, - CFD99AC00AFE860B0068D19C /* PredicateSimplifier.cpp */, + CF8F1B5B0B64FA2F00BB4199 /* PredicateSimplifier.cpp */, DE66F1B508ABEFB400323D32 /* Reassociate.cpp */, CF73C0B9098A546000627152 /* Reg2Mem.cpp */, DE66F1B608ABEFB400323D32 /* ScalarReplAggregates.cpp */, @@ -1877,6 +1904,7 @@ DE66F26A08ABF03200323D32 /* Pass.h */, DE66F26B08ABF03200323D32 /* PassAnalysisSupport.h */, DE66F26C08ABF03200323D32 /* PassManager.h */, + CF8F1B420B64F70B00BB4199 /* PassManagers.h */, DE66F26D08ABF03200323D32 /* PassSupport.h */, DE66F29208ABF03200323D32 /* SymbolTable.h */, DE66F29308ABF03200323D32 /* SymbolTableListTraits.h */, @@ -1894,6 +1922,7 @@ DE66F1EB08ABF03100323D32 /* ADT */ = { isa = PBXGroup; children = ( + CF42B6BF0AF24F5300D5D47C /* FoldingSet.h */, DE66F1ED08ABF03100323D32 /* BitSetVector.h */, CF33BE150AF62B4200E93805 /* CStringMap.h */, DE66F1EE08ABF03100323D32 /* DenseMap.h */, @@ -1931,7 +1960,6 @@ DE66F20708ABF03100323D32 /* CFGPrinter.h */, CF73C0A5098A507300627152 /* ConstantFolding.h */, DE66F20808ABF03100323D32 /* ConstantsScanner.h */, - DE66F20908ABF03100323D32 /* DataStructure */, DE66F20F08ABF03100323D32 /* Dominators.h */, CF73C0A6098A507300627152 /* ET-Forest.h */, DE66F21208ABF03100323D32 /* FindUsedTypes.h */, @@ -1955,25 +1983,10 @@ path = Analysis; sourceTree = ""; }; - DE66F20908ABF03100323D32 /* DataStructure */ = { - isa = PBXGroup; - children = ( - CFE420FA0A66F67300AB4BF6 /* CallTargets.h */, - DE66F20A08ABF03100323D32 /* DataStructure.h */, - DE66F20B08ABF03100323D32 /* DSGraph.h */, - DE66F20C08ABF03100323D32 /* DSGraphTraits.h */, - DE66F20D08ABF03100323D32 /* DSNode.h */, - DE66F20E08ABF03100323D32 /* DSSupport.h */, - ); - path = DataStructure; - sourceTree = ""; - }; DE66F22408ABF03100323D32 /* Assembly */ = { isa = PBXGroup; children = ( DE66F22508ABF03100323D32 /* AsmAnnotationWriter.h */, - CF73C0A8098A50C200627152 /* AutoUpgrade.h */, - DE66F22608ABF03100323D32 /* CachedWriter.h */, DE66F22708ABF03100323D32 /* Parser.h */, DE66F22808ABF03100323D32 /* PrintModulePass.h */, DE66F22908ABF03100323D32 /* Writer.h */, @@ -2023,6 +2036,7 @@ CF9720240A9F3969002CEEDD /* MachOWriter.h */, DE66F24408ABF03100323D32 /* Passes.h */, CFE21C780A80CC0600D3E908 /* RegAllocRegistry.h */, + CF8F1B410B64F6D100BB4199 /* RuntimeLibcalls.h */, DE66F24508ABF03100323D32 /* SchedGraphCommon.h */, CF7FFA2109850864008B0087 /* ScheduleDAG.h */, CFE21C7B0A80CC1C00D3E908 /* SchedulerRegistry.h */, @@ -2074,18 +2088,19 @@ isa = PBXGroup; children = ( DE66F27008ABF03200323D32 /* AIXDataTypesFix.h */, - CFD99AB40AFE83910068D19C /* Allocator.h */, + CF8F1B430B64F74400BB4199 /* Allocator.h */, DE66F27108ABF03200323D32 /* Annotation.h */, DE66F27208ABF03200323D32 /* CallSite.h */, DE66F27308ABF03200323D32 /* Casting.h */, DE66F27408ABF03200323D32 /* CFG.h */, DE66F27508ABF03200323D32 /* CommandLine.h */, - CFD99AB50AFE83910068D19C /* Compiler.h */, + CF8F1B440B64F74400BB4199 /* Compiler.h */, DE66F27608ABF03200323D32 /* Compressor.h */, DE66F27708ABF03200323D32 /* ConstantRange.h */, CF73C0AD098A519400627152 /* DataTypes.h */, DE66F27908ABF03200323D32 /* DataTypes.h.in */, DE66F27A08ABF03200323D32 /* Debug.h */, + CF8F1B450B64F74400BB4199 /* Disassembler.h */, DE66F27B08ABF03200323D32 /* DOTGraphTraits.h */, DE66F27C08ABF03200323D32 /* DynamicLinker.h */, DE66F27D08ABF03200323D32 /* ELF.h */, @@ -2096,10 +2111,11 @@ DE66F28108ABF03200323D32 /* InstIterator.h */, DE66F28208ABF03200323D32 /* InstVisitor.h */, DE66F28308ABF03200323D32 /* LeakDetector.h */, - CFD99AB60AFE83910068D19C /* ManagedStatic.h */, + CF8F1B460B64F74400BB4199 /* ManagedStatic.h */, DE66F28408ABF03200323D32 /* Mangler.h */, DE66F28508ABF03200323D32 /* MathExtras.h */, DE66F28608ABF03200323D32 /* MutexGuard.h */, + CF8F1B470B64F74400BB4199 /* OutputBuffer.h */, DE66F28708ABF03200323D32 /* PassNameParser.h */, DE66F28808ABF03200323D32 /* PatternMatch.h */, DE66F28908ABF03200323D32 /* PluginLoader.h */, @@ -2186,7 +2202,8 @@ DE66F31E08ABF14400323D32 /* llvm-db */, DE66F33B08ABF14400323D32 /* llvm-ld */, DE66F36808ABF14500323D32 /* llvmc */, - CFD99AC50AFE872B0068D19C /* llvm2cpp */, + CF8F1B5E0B64FADA00BB4199 /* llvm-upgrade */, + CF8F1B7E0B64FADA00BB4199 /* llvm2cpp */, DE66F2EE08ABF14400323D32 /* gccas.cpp */, CFD99ADA0AFE87650068D19C /* lto.cpp */, DE66F30008ABF14400323D32 /* llc.cpp */, @@ -2200,7 +2217,8 @@ DE66F35108ABF14400323D32 /* llvm-nm.cpp */, DE66F35808ABF14500323D32 /* llvm-prof.cpp */, DE66F35F08ABF14500323D32 /* llvm-ranlib.cpp */, - CFD99AC10AFE87030068D19C /* llvm-stub.c */, + CF8F1B960B64FB7F00BB4199 /* lto */, + CF8F1BAB0B64FB8000BB4199 /* opt */, ); name = tools; path = ../tools; @@ -2263,6 +2281,7 @@ DE66F36908ABF14500323D32 /* c */, DE66F36A08ABF14500323D32 /* CompilerDriver.cpp */, DE66F36B08ABF14500323D32 /* CompilerDriver.h */, + CF8F1B950B64FB5000BB4199 /* ConfigLexer.cpp */, DE66F36D08ABF14500323D32 /* ConfigLexer.h */, DE66F36E08ABF14500323D32 /* ConfigLexer.l */, DE66F36F08ABF14500323D32 /* Configuration.cpp */, @@ -2396,7 +2415,7 @@ DE81705B08CFB44D0093BDEF /* CodeEmitterGen.cpp */, DE81705C08CFB44D0093BDEF /* CodeEmitterGen.h */, DE81705D08CFB44D0093BDEF /* CodeGenInstruction.h */, - CFD99AE00AFE87DC0068D19C /* CodeGenIntrinsics.h */, + CF8F1BC90B64FBD500BB4199 /* CodeGenIntrinsics.h */, DE81705E08CFB44D0093BDEF /* CodeGenRegisters.h */, DE81705F08CFB44D0093BDEF /* CodeGenTarget.cpp */, DE81706008CFB44D0093BDEF /* CodeGenTarget.h */, @@ -2404,8 +2423,6 @@ DE81706808CFB44D0093BDEF /* DAGISelEmitter.h */, DE81708408CFB44D0093BDEF /* FileLexer.l */, DE81708808CFB44D0093BDEF /* FileParser.y */, - CFAA448A0AE3BE890064BC97 /* HereStringSupport.cpp */, - CFAA44870AE3BE6C0064BC97 /* HereStringSupport.h */, CF9720970A9F3D4D002CEEDD /* IntrinsicEmitter.cpp */, CF9720980A9F3D4D002CEEDD /* IntrinsicEmitter.h */, DE81708908CFB44D0093BDEF /* InstrInfoEmitter.cpp */, From alenhar2 at cs.uiuc.edu Mon Jan 22 10:40:54 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 22 Jan 2007 10:40:54 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/DSA/Local.cpp Message-ID: <200701221640.l0MGesG1010820@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/DSA: Local.cpp updated: 1.166 -> 1.167 --- Log message: Fix build --- Diffs of the changes: (+1 -1) Local.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.166 llvm-poolalloc/lib/DSA/Local.cpp:1.167 --- llvm-poolalloc/lib/DSA/Local.cpp:1.166 Wed Jan 10 13:59:52 2007 +++ llvm-poolalloc/lib/DSA/Local.cpp Mon Jan 22 10:40:38 2007 @@ -72,7 +72,7 @@ if (isa(Ty)) return true; else if (TrackIntegersAsPointers && Ty->isPrimitiveType() &&Ty->isInteger()) - return Ty->getPrimitiveSize() >= PointerSize; + return Ty->getPrimitiveSizeInBits() >= PointerSize; return false; } }} From alenhar2 at cs.uiuc.edu Mon Jan 22 10:41:25 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 22 Jan 2007 10:41:25 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp Message-ID: <200701221641.l0MGfPof010861@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/PoolAllocate: PoolAllocate.cpp updated: 1.132 -> 1.133 --- Log message: fix build --- Diffs of the changes: (+1 -1) PoolAllocate.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.132 llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.133 --- llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.132 Wed Jan 10 14:44:31 2007 +++ llvm-poolalloc/lib/PoolAllocate/PoolAllocate.cpp Mon Jan 22 10:41:10 2007 @@ -251,7 +251,7 @@ if (isa(User->getOperand(1)) && cast(User->getOperand(1))->isNullValue()) { bool CondIsTrue = ICI->getPredicate() == ICmpInst::ICMP_NE; - User->replaceAllUsesWith(ConstantBool::get(CondIsTrue)); + User->replaceAllUsesWith(ConstantInt::get(Type::Int1Ty, CondIsTrue)); } } else if ((User->getOpcode() == Instruction::Trunc) || (User->getOpcode() == Instruction::ZExt) || From alenhar2 at cs.uiuc.edu Mon Jan 22 11:03:56 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 22 Jan 2007 11:03:56 -0600 Subject: [llvm-commits] CVS: llvm-poolalloc/lib/DSA/DataStructure.cpp Message-ID: <200701221703.l0MH3unM011236@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/DSA: DataStructure.cpp updated: 1.257 -> 1.258 --- Log message: fix a incompleteness bug --- Diffs of the changes: (+8 -0) DataStructure.cpp | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm-poolalloc/lib/DSA/DataStructure.cpp diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.257 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.258 --- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.257 Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/DSA/DataStructure.cpp Mon Jan 22 11:03:41 2007 @@ -1993,6 +1993,14 @@ E = AuxFunctionCalls.end(); I != E; ++I) markIncomplete(*I); + // Mark stuff passed into external functions as being incomplete. + // External functions may not appear in Aux during td, so process + // them specially + for (std::list::iterator I = FunctionCalls.begin(), + E = FunctionCalls.end(); I != E; ++I) + if(I->isDirectCall() && I->getCalleeFunc()->isExternal()) + markIncomplete(*I); + // Mark all global nodes as incomplete. for (DSScalarMap::global_iterator I = ScalarMap.global_begin(), E = ScalarMap.global_end(); I != E; ++I) From clattner at apple.com Mon Jan 22 12:17:48 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 22 Jan 2007 10:17:48 -0800 Subject: [llvm-commits] [PATCH] PR746: Make Function not annotatable and get rid of Annotations In-Reply-To: References: Message-ID: On Jan 21, 2007, at 11:59 AM, Gordon Henriksen wrote: > This patch addresses http://llvm.org/PR746. > > This patch simply replaces the subversive and overgeneralized > annotation classes with a map in MachineFunction and a listener > interface so that MachineFunctions can destroy themselves when the > parent Function is deleted. > > I wish I'd noticed PR746 before http://llvm.org/PR927. Not sure > you'll want to apply this patch in light of the comments on this > PR746, which suggest using an Analysis to store MachineFunctions, > and thus to also manage their lifetimes. This looks like a great step in the right direction. However, why do we need the FunctionListener interface? The lifetime of the MachineFunction object is tightly controlled by the code generator (created with MF::construct and destroyed with MF::destruct). I don't think there is a need to notify the MachineFunction when Function is destroyed, just delete the MachineFunction in MachineFunction::destruct. -Chris From evan.cheng at apple.com Mon Jan 22 12:56:27 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 12:56:27 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/insn-sched1.ll Message-ID: <200701221856.l0MIuRAa013047@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: insn-sched1.ll updated: 1.1 -> 1.2 --- Log message: Fix test case. --- Diffs of the changes: (+1 -2) insn-sched1.ll | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/CodeGen/ARM/insn-sched1.ll diff -u llvm/test/CodeGen/ARM/insn-sched1.ll:1.1 llvm/test/CodeGen/ARM/insn-sched1.ll:1.2 --- llvm/test/CodeGen/ARM/insn-sched1.ll:1.1 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/insn-sched1.ll Mon Jan 22 12:56:11 2007 @@ -1,6 +1,5 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | grep mov | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin -mattr=+v6 | grep mov | wc -l | grep 2 int %test(int %x) { %tmp = cast int %x to short From evan.cheng at apple.com Mon Jan 22 12:57:56 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 12:57:56 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/ldm.ll Message-ID: <200701221857.l0MIvux3013112@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: ldm.ll updated: 1.1 -> 1.2 --- Log message: Fix test case. --- Diffs of the changes: (+1 -1) ldm.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/ARM/ldm.ll diff -u llvm/test/CodeGen/ARM/ldm.ll:1.1 llvm/test/CodeGen/ARM/ldm.ll:1.2 --- llvm/test/CodeGen/ARM/ldm.ll:1.1 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/ldm.ll Mon Jan 22 12:57:39 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmfd sp\!" | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep "ldmfd sp\!" | wc -l | grep 3 %X = external global [0 x int] From evan.cheng at apple.com Mon Jan 22 13:40:26 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 13:40:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp Message-ID: <200701221940.l0MJeQH5014997@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.2 -> 1.3 --- Log message: Use bl to call Thumb fuctions directly. --- Diffs of the changes: (+1 -1) ARMISelLowering.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.2 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.3 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.2 Fri Jan 19 13:28:01 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon Jan 22 13:40:10 2007 @@ -483,7 +483,7 @@ getTargetMachine().getRelocationModel() != Reloc::Static; isARMFunc = !Subtarget->isThumb() || isStub; // Wrap it since tBX takes a register source operand. - if (!Subtarget->hasV5TOps() && Subtarget->isThumb()) + if (isARMFunc && Subtarget->isThumb() && !Subtarget->hasV5TOps()) Callee = DAG.getNode(ARMISD::WrapperCall, MVT::i32, Callee); } From dpatel at apple.com Mon Jan 22 14:06:17 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 22 Jan 2007 12:06:17 -0800 Subject: [llvm-commits] llvm-gcc4: use langhooks rather than front-end calls in i386.c In-Reply-To: <200701201543.27491.baldrick@free.fr> References: <200701172155.32302.baldrick@free.fr> <14E9A42E-BDEC-4BB7-9772-86185EB9558B@apple.com> <200701201543.27491.baldrick@free.fr> Message-ID: <92A23398-EB67-44BA-9673-5556ADAB46EA@apple.com> On Jan 20, 2007, at 6:43 AM, Duncan Sands wrote: > Hi Devang, thanks for reviewing these patches. > >> Applied, after adding "APPLE LOCAL llvm" markers. > > This hasn't turned up in the llvm-gcc4 svn repository > yet. Did you apply it there or to some other tree? > (I'm waiting for it to turn up, so I can see how the > APPLE markers should be done). Do you see this change ? On my side, svn commit succeeded on 18th and this change should show up in mirror next day. - Devang From dpatel at apple.com Mon Jan 22 14:09:22 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 22 Jan 2007 12:09:22 -0800 Subject: [llvm-commits] llvm-gcc4: resurrect fortran In-Reply-To: <200701212307.22696.baldrick@free.fr> References: <200701172210.38362.baldrick@free.fr> <330600EC-1D9B-4BFD-A814-B3A988C26C52@apple.com> <200701212307.22696.baldrick@free.fr> Message-ID: Applied. - Devang On Jan 21, 2007, at 2:07 PM, Duncan Sands wrote: >>> + $(F95_OBJS) $(F95_BACKEND) $(F95_LIBS) $(C_STUBS) >> >> I don't see C_STUBS anywhere. > > Indeed - well spotted. > >> Would it be possible for you to resend >> this patch with appropriate "APPLE LOCAL llvm" markers ? > > This time without C_STUBS and with markers. > > Best wishes, > > Duncan. > > Index: gcc.llvm.master/gcc/fortran/Make-lang.in > =================================================================== > --- gcc.llvm.master.orig/gcc/fortran/Make-lang.in 2007-01-21 > 22:50:53.000000000 +0100 > +++ gcc.llvm.master/gcc/fortran/Make-lang.in 2007-01-21 > 23:01:06.000000000 +0100 > @@ -103,12 +103,16 @@ > -rm -f gfortran-cross$(exeext) > cp gfortran$(exeext) gfortran-cross$(exeext) > > +# APPLE LOCAL begin llvm > +# Language-independent object files. > +F95_BACKEND = $(BACKEND) attribs.o stub-objc.o stub-c.o > + > # The compiler itself is called f951. > f951$(exeext): $(F95_OBJS) \ > - $(BACKEND) $(LIBDEPS) > - # APPLE LOCAL LLVM > + $(F95_BACKEND) $(LIBDEPS) > $(LINKCC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ > - $(F95_OBJS) $(BACKEND) $(F95_LIBS) > + $(F95_OBJS) $(F95_BACKEND) $(F95_LIBS) > +# APPLE LOCAL end llvm > > gt-fortran-f95-lang.h gtype-fortran.h : s-gtype; @true > gt-fortran-trans-decl.h gt-fortran-trans.h : s-gtype; @true > Index: gcc.llvm.master/gcc/fortran/f95-lang.c > =================================================================== > --- gcc.llvm.master.orig/gcc/fortran/f95-lang.c 2007-01-21 > 22:50:53.000000000 +0100 > +++ gcc.llvm.master/gcc/fortran/f95-lang.c 2007-01-21 > 22:59:51.000000000 +0100 > @@ -154,21 +154,6 @@ > /* APPLE LOCAL disable_typechecking_for_spec_flag */ > int disable_typechecking_for_spec_flag = 0; > > -/* APPLE LOCAL begin CW asm blocks */ > -/* Dummies needed because we use them from cpplib, yuck. */ > -int flag_iasm_blocks; > -int iasm_state; > -int iasm_in_operands; > -/* APPLE LOCAL end CW asm blocks */ > - > -/* APPLE LOCAL begin 4174833 */ > -tree > -objc_is_class_name (tree ARG_UNUSED (arg)) > -{ > - return 0; > -} > - > -/* APPLE LOCAL end 4174833 */ > /* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the > function > that have names. Here so we can clear out their names' > definitions > at the end of the function. */ > Index: gcc.llvm.master/gcc/fortran/trans-types.c > =================================================================== > --- gcc.llvm.master.orig/gcc/fortran/trans-types.c 2007-01-21 > 22:50:53.000000000 +0100 > +++ gcc.llvm.master/gcc/fortran/trans-types.c 2007-01-21 > 22:59:51.000000000 +0100 > @@ -1752,18 +1752,4 @@ > /* APPLE LOCAL constant cfstrings */ > struct cpp_reader* parse_in; > > -/* APPLE LOCAL begin AltiVec */ > -tree > -build_stmt (enum tree_code code ATTRIBUTE_UNUSED, ...) > -{ > - gcc_assert(0); > -} > - > -void > -store_init_value (tree decl ATTRIBUTE_UNUSED, tree init > ATTRIBUTE_UNUSED) > -{ > - gcc_assert(0); > -} > -/* APPLE LOCAL end AltiVec */ > - > #include "gt-fortran-trans-types.h" From reid at x10sys.com Mon Jan 22 14:50:55 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 22 Jan 2007 14:50:55 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/template.cpp Message-ID: <200701222050.l0MKot5Z016397@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: template.cpp updated: 1.4 -> 1.5 --- Log message: Fix #include. We use printf not iostream. --- Diffs of the changes: (+1 -1) template.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Integer/template.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.4 llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.5 --- llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template.cpp Mon Jan 22 14:50:40 2007 @@ -9,7 +9,7 @@ // //===--------------------------------------------------------------------===// -#include +#include typedef int __attribute__ ((bitwidth(4))) int4; typedef unsigned int __attribute__ ((bitwidth(5))) int5; From reid at x10sys.com Mon Jan 22 15:05:10 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 22 Jan 2007 15:05:10 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/local-union.c Message-ID: <200701222105.l0ML5ADr016622@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: local-union.c updated: 1.4 -> 1.5 --- Log message: Fix constant integer for 64-bits. Fix header to 80 cols. --- Diffs of the changes: (+4 -4) local-union.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/local-union.c diff -u llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.4 llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/local-union.c Mon Jan 22 15:04:54 2007 @@ -1,13 +1,13 @@ -//===--- local-union.c --- Test Cases for Bit Accurate Types ------------===// +//===--- local-union.c --- Test Cases for Bit Accurate Types --------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for local union data type. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include @@ -18,7 +18,7 @@ double test(union foo* F) { { union foo { float X; int33 Y;} A; - A.Y = 0x1ffffffff; + A.Y = 0x1ffffffffULL; return A.X; } } From reid at x10sys.com Mon Jan 22 15:06:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 22 Jan 2007 15:06:36 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/switch.c Message-ID: <200701222106.l0ML6acu016657@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: switch.c updated: 1.4 -> 1.5 --- Log message: Remove syntax errors from merge. Use constant expressions instead of direct values. Fix header to 80 cols. --- Diffs of the changes: (+3 -9) switch.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/switch.c diff -u llvm-test/SingleSource/UnitTests/Integer/switch.c:1.4 llvm-test/SingleSource/UnitTests/Integer/switch.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/switch.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/switch.c Mon Jan 22 15:06:21 2007 @@ -1,28 +1,22 @@ -//===--- switch.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- switch.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for switch statement. The switch value is a // non-regular bitwidth. test(int3 c) function return the value of the // argument c. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef unsigned int __attribute__ ((bitwidth(7))) int7; typedef unsigned int __attribute__ ((bitwidth(3))) int3; -<<<<<<< switch.c -======= const int7 zero = (int7)(1 << 8); // constant 0; static int3 seven = (int3)0xf; // constant 7; ->>>>>>> 1.2 - -const int7 zero = 0; // constant 0; -static int3 seven = 7; // constant 7; int3 test(int3 c) { From reid at x10sys.com Mon Jan 22 15:08:09 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 22 Jan 2007 15:08:09 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/SSAtest.c arith.c array.c bigint.c bitbit.c bitlogic.c cppfield.cpp enum.cpp exception.cpp extern-inline-redef.c field.c folding.c general-test.c global.c large-array.c list.c local-array.c matrix.c memory.c offset.c override.cpp pointer.c static.c struct1.c struct2.c structInit.c template.cpp template2.cpp template3.cpp union-init.c union-struct.c union2.c Message-ID: <200701222108.l0ML890s016751@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: SSAtest.c updated: 1.4 -> 1.5 arith.c updated: 1.4 -> 1.5 array.c updated: 1.4 -> 1.5 bigint.c updated: 1.4 -> 1.5 bitbit.c updated: 1.4 -> 1.5 bitlogic.c updated: 1.4 -> 1.5 cppfield.cpp updated: 1.2 -> 1.3 enum.cpp updated: 1.4 -> 1.5 exception.cpp updated: 1.3 -> 1.4 extern-inline-redef.c updated: 1.4 -> 1.5 field.c updated: 1.3 -> 1.4 folding.c updated: 1.3 -> 1.4 general-test.c updated: 1.4 -> 1.5 global.c updated: 1.3 -> 1.4 large-array.c updated: 1.4 -> 1.5 list.c updated: 1.4 -> 1.5 local-array.c updated: 1.4 -> 1.5 matrix.c updated: 1.5 -> 1.6 memory.c updated: 1.4 -> 1.5 offset.c updated: 1.4 -> 1.5 override.cpp updated: 1.4 -> 1.5 pointer.c updated: 1.4 -> 1.5 static.c updated: 1.3 -> 1.4 struct1.c updated: 1.4 -> 1.5 struct2.c updated: 1.4 -> 1.5 structInit.c updated: 1.4 -> 1.5 template.cpp updated: 1.5 -> 1.6 template2.cpp updated: 1.3 -> 1.4 template3.cpp updated: 1.4 -> 1.5 union-init.c updated: 1.4 -> 1.5 union-struct.c updated: 1.4 -> 1.5 union2.c updated: 1.3 -> 1.4 --- Log message: Fix 80-col problems in file headers. --- Diffs of the changes: (+107 -101) SSAtest.c | 6 +++--- arith.c | 8 ++++---- array.c | 6 +++--- bigint.c | 6 +++--- bitbit.c | 6 +++--- bitlogic.c | 6 +++--- cppfield.cpp | 6 ++++-- enum.cpp | 6 +++--- exception.cpp | 6 +++--- extern-inline-redef.c | 6 +++--- field.c | 6 +++--- folding.c | 6 +++--- general-test.c | 17 ++++++++++------- global.c | 6 +++--- large-array.c | 6 +++--- list.c | 6 +++--- local-array.c | 6 +++--- matrix.c | 6 +++--- memory.c | 6 +++--- offset.c | 6 +++--- override.cpp | 6 +++--- pointer.c | 6 +++--- static.c | 6 +++--- struct1.c | 9 +++++---- struct2.c | 6 +++--- structInit.c | 6 +++--- template.cpp | 6 +++--- template2.cpp | 6 +++--- template3.cpp | 6 +++--- union-init.c | 6 +++--- union-struct.c | 6 +++--- union2.c | 6 +++--- 32 files changed, 107 insertions(+), 101 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/SSAtest.c diff -u llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.4 llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/SSAtest.c Mon Jan 22 15:07:53 2007 @@ -1,14 +1,14 @@ -//===--- SSAtest.c --- Test Cases for Bit Accurate Types ----------------===// +//===--- SSAtest.c --- Test Cases for Bit Accurate Types ------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // Adopted the test from previous test-cases. Changed it with // non-regular int data type. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(4))) int4; Index: llvm-test/SingleSource/UnitTests/Integer/arith.c diff -u llvm-test/SingleSource/UnitTests/Integer/arith.c:1.4 llvm-test/SingleSource/UnitTests/Integer/arith.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/arith.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/arith.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- arith.c --- Test Cases for Bit Accurate Types ------------------===// +//===--- arith.c --- Test Cases for Bit Accurate Types --------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // -// This is a general test for arithmatic operations. +// This is a general test for arithmetic operations. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "arith.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/array.c diff -u llvm-test/SingleSource/UnitTests/Integer/array.c:1.4 llvm-test/SingleSource/UnitTests/Integer/array.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/array.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/array.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- array.c --- Test Cases for Bit Accurate Types ------------------===// +//===--- array.c --- Test Cases for Bit Accurate Types --------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a general test for array data types. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "array.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/bigint.c diff -u llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.4 llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bigint.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- bigint.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- bigint.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a general test for big integer type. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "bigint.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/bitbit.c diff -u llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.4 llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bitbit.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- bitbit.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- bitbit.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a general test for bit operations. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "bitbit.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/bitlogic.c diff -u llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.4 llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bitlogic.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- bitlogic.c --- Test Cases for Bit Accurate Types ---------------===// +//===--- bitlogic.c --- Test Cases for Bit Accurate Types -----------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a general test for logical operations. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "bitlogic.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.2 llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.3 --- llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.2 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp Mon Jan 22 15:07:53 2007 @@ -1,9 +1,11 @@ -#include +//===-- cppfield.cpp - Test C++ Fields With Bit Accurate Types ------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// +// +#include typedef unsigned int __attribute__ ((bitwidth(7))) int7; typedef unsigned int __attribute__ ((bitwidth(17))) int17; typedef unsigned int __attribute__ ((bitwidth(32))) int32; Index: llvm-test/SingleSource/UnitTests/Integer/enum.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.4 llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.5 --- llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/enum.cpp Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- enum.cpp --- Test Cases for Bit Accurate Types -----------------===// +//===--- enum.cpp --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test of bitwidth attribute with enum data. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include class myClass Index: llvm-test/SingleSource/UnitTests/Integer/exception.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.3 llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.4 --- llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.3 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/exception.cpp Mon Jan 22 15:07:53 2007 @@ -1,14 +1,14 @@ -//===--- exception.cpp --- Test Cases for Bit Accurate Types ------------===// +//===--- exception.cpp --- Test Cases for Bit Accurate Types --------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test of exception handling with non-regular data // type. The compiler should be able to differentiate int31, int7 etc. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(31))) int31; Index: llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c diff -u llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.4 llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- extern_inline_redef.c --- Test Cases for Bit Accurate Types ----===// +//===--- extern_inline_redef.c --- Test Cases for Bit Accurate Types ------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // this is used to test redefining inline function. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(61))) int61; Index: llvm-test/SingleSource/UnitTests/Integer/field.c diff -u llvm-test/SingleSource/UnitTests/Integer/field.c:1.3 llvm-test/SingleSource/UnitTests/Integer/field.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/field.c:1.3 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/field.c Mon Jan 22 15:07:53 2007 @@ -1,15 +1,15 @@ -//===--- field.c --- Test Cases for Bit Accurate Types ------------------===// +//===--- field.c --- Test Cases for Bit Accurate Types --------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is used to test struct with field specifier. We suppose the // data layout of the field should be the same as the corresponding // struct using bit accurate types. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(7))) int7; typedef int __attribute__ ((bitwidth(17))) int17; Index: llvm-test/SingleSource/UnitTests/Integer/folding.c diff -u llvm-test/SingleSource/UnitTests/Integer/folding.c:1.3 llvm-test/SingleSource/UnitTests/Integer/folding.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/folding.c:1.3 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/folding.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- folding.c --- Test Cases for Bit Accurate Types ----------------===// +//===--- folding.c --- Test Cases for Bit Accurate Types ------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is used to test constant folding optimization. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(7))) int7; Index: llvm-test/SingleSource/UnitTests/Integer/general-test.c diff -u llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.4 llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/general-test.c Mon Jan 22 15:07:53 2007 @@ -1,11 +1,14 @@ -/* This test just tries out a few bitwidth attribute constructs and +//===--- general-test.c - General Bit Accurate Type Test ------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// - * generates some output based on the them. - */ +// This file was developed by Reid Spencer and is distributed under the +// the University of Illinois Open Source License. See LICENSE.TXT for +// details. +// +//===----------------------------------------------------------------------===// +// +// This test just tries out a few bitwidth attribute constructs and +// +//===----------------------------------------------------------------------===// #include #include Index: llvm-test/SingleSource/UnitTests/Integer/global.c diff -u llvm-test/SingleSource/UnitTests/Integer/global.c:1.3 llvm-test/SingleSource/UnitTests/Integer/global.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/global.c:1.3 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/global.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- global.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- global.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is used to test global arrays. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(7))) int7; Index: llvm-test/SingleSource/UnitTests/Integer/large-array.c diff -u llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.4 llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/large-array.c Mon Jan 22 15:07:53 2007 @@ -1,14 +1,14 @@ -//===--- large-array.c --- Test Cases for Bit Accurate Types ------------===// +//===--- large-array.c --- Test Cases for Bit Accurate Types --------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is used to test large local arrays. Some local arrays are // partially initilized. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/list.c diff -u llvm-test/SingleSource/UnitTests/Integer/list.c:1.4 llvm-test/SingleSource/UnitTests/Integer/list.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/list.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/list.c Mon Jan 22 15:07:53 2007 @@ -1,15 +1,15 @@ -//===--- list.c --- Test Cases for Bit Accurate Types -------------------===// +//===--- list.c --- Test Cases for Bit Accurate Types ---------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for simple linked list operation. Data are added to // and removed from the list. We compare the expected value wehen we // remove data from the list. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include #include Index: llvm-test/SingleSource/UnitTests/Integer/local-array.c diff -u llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.4 llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/local-array.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- local-array.c --- Test Cases for Bit Accurate Types ------------===// +//===--- local-array.c --- Test Cases for Bit Accurate Types --------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is another test for local arrays. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(4))) int4; Index: llvm-test/SingleSource/UnitTests/Integer/matrix.c diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.5 llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.5 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.c Mon Jan 22 15:07:53 2007 @@ -1,16 +1,16 @@ -//===--- matrix.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- matrix.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for matrix with non-regular bitwidth data. In // my_test(A, B) function, we get A=A*B. For each row after // multiplication, we sort it in non-increasing order. Then the first // two largest elements are used to get the gcd. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include "matrix.h" #include #include Index: llvm-test/SingleSource/UnitTests/Integer/memory.c diff -u llvm-test/SingleSource/UnitTests/Integer/memory.c:1.4 llvm-test/SingleSource/UnitTests/Integer/memory.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/memory.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/memory.c Mon Jan 22 15:07:53 2007 @@ -1,14 +1,14 @@ -//===--- memory.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- memory.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for memory malloc and free operations. It tests // non-regular bitwidth data and structures. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include #include Index: llvm-test/SingleSource/UnitTests/Integer/offset.c diff -u llvm-test/SingleSource/UnitTests/Integer/offset.c:1.4 llvm-test/SingleSource/UnitTests/Integer/offset.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/offset.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/offset.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- offset.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- offset.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for data size calculation with non-regular integral type. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/override.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.4 llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.5 --- llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/override.cpp Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- override.cpp --- Test Cases for Bit Accurate Types -------------===// +//===--- override.cpp --- Test Cases for Bit Accurate Types ---------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test of override test. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(31))) int31; typedef int __attribute__ ((bitwidth(32))) int32; Index: llvm-test/SingleSource/UnitTests/Integer/pointer.c diff -u llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.4 llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/pointer.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- pointer.c --- Test Cases for Bit Accurate Types ----------------===// +//===--- pointer.c --- Test Cases for Bit Accurate Types ------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for address calculation with non-regular integral type. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(3))) int3; Index: llvm-test/SingleSource/UnitTests/Integer/static.c diff -u llvm-test/SingleSource/UnitTests/Integer/static.c:1.3 llvm-test/SingleSource/UnitTests/Integer/static.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/static.c:1.3 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/static.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- static.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- static.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for static data with non-regular integral data. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(31))) int31; Index: llvm-test/SingleSource/UnitTests/Integer/struct1.c diff -u llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.4 llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/struct1.c Mon Jan 22 15:07:53 2007 @@ -1,14 +1,15 @@ -//===--- struct1.c --- Test Cases for Bit Accurate Types ----------------===// +//===--- struct1.c --- Test Cases for Bit Accurate Types ------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for struct data structure. If the data layout for -// non-regular bitwidth data is not correct, it may change the value of another field. +// non-regular bitwidth data is not correct, it may change the value of +// another field. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/struct2.c diff -u llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.4 llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/struct2.c Mon Jan 22 15:07:53 2007 @@ -1,14 +1,14 @@ -//===--- struct2.c --- Test Cases for Bit Accurate Types ----------------===// +//===--- struct2.c --- Test Cases for Bit Accurate Types ------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for struct data structure. We test the nested structure // and pointer to structure. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/structInit.c diff -u llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.4 llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/structInit.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- structInit.c --- Test Cases for Bit Accurate Types -------------===// +//===--- structInit.c --- Test Cases for Bit Accurate Types ---------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for struct data structure with initialization. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(31))) int31; Index: llvm-test/SingleSource/UnitTests/Integer/template.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.5 llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.6 --- llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.5 Mon Jan 22 14:50:40 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template.cpp Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- template.cpp --- Test Cases for Bit Accurate Types -------------===// +//===--- template.cpp --- Test Cases for Bit Accurate Types ---------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for template functions. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/template2.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.3 llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.4 --- llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.3 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template2.cpp Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- template2.cpp --- Test Cases for Bit Accurate Types ------------===// +//===--- template2.cpp --- Test Cases for Bit Accurate Types --------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for template classes. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(26))) int26; Index: llvm-test/SingleSource/UnitTests/Integer/template3.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.4 llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.5 --- llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template3.cpp Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- template3.cpp --- Test Cases for Bit Accurate Types ------------===// +//===--- template3.cpp --- Test Cases for Bit Accurate Types --------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for partial specialization. // -//===------------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/union-init.c diff -u llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.4 llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union-init.c Mon Jan 22 15:07:53 2007 @@ -1,13 +1,13 @@ -//===--- union-init.c --- Test Cases for Bit Accurate Types -------------===// +//===--- union-init.c --- Test Cases for Bit Accurate Types ---------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for union initialization. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/union-struct.c diff -u llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.4 llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.4 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union-struct.c Mon Jan 22 15:07:53 2007 @@ -1,14 +1,14 @@ -//===--- union-struct.c --- Test Cases for Bit Accurate Types -----------===// +//===--- union-struct.c --- Test Cases for Bit Accurate Types -------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for struct with union inside. The purpose is to see // whether the size of the structure is correct. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/union2.c diff -u llvm-test/SingleSource/UnitTests/Integer/union2.c:1.3 llvm-test/SingleSource/UnitTests/Integer/union2.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/union2.c:1.3 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union2.c Mon Jan 22 15:07:53 2007 @@ -1,14 +1,14 @@ -//===--- union2.c --- Test Cases for Bit Accurate Types -----------------===// +//===--- union2.c --- Test Cases for Bit Accurate Types -------------------===// // // This file was developed by Guoling han and donated to the LLVM research // group and is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. -//===-------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// // // This is a test for union type. By assigning values to different // fields, we can check whether the assignment is correctly performed. // -//===--------------------------------------------------------------------===// +//===----------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(9))) int9; typedef int __attribute__ ((bitwidth(31))) int31; From criswell at cs.uiuc.edu Mon Jan 22 15:19:04 2007 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon, 22 Jan 2007 15:19:04 -0600 Subject: [llvm-commits] [release_19] CVS: llvm-poolalloc/lib/DSA/Local.cpp Message-ID: <200701222119.l0MLJ4aD016979@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/DSA: Local.cpp updated: 1.158.2.3 -> 1.158.2.4 --- Log message: Add code that might correctly handle llva_save_stackp(). --- Diffs of the changes: (+12 -0) Local.cpp | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm-poolalloc/lib/DSA/Local.cpp diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.3 llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4 --- llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.3 Wed Dec 13 17:18:48 2006 +++ llvm-poolalloc/lib/DSA/Local.cpp Mon Jan 22 15:18:48 2007 @@ -1232,6 +1232,18 @@ if (DSNode *N = RetNH.getNode()) N->setModifiedMarker()->setReadMarker(); return true; +#if 0 + } else if (F->getName() == "llva_save_stackp") { + // Create a new DSNode for the memory returned by llva_save_stackp() + DSNode *N = createNode(); + N->setAllocaNodeMarker(); + + // + // TODO: + // For now, don't worry about creating a meta-pool. Stack locations + // are ignored by our analysis. + // +#endif } else if (F->getName() == "__generic_copy_from_user") { if (CS.getCaller()->getName() == "kmem_cache_alloc") return false; From evan.cheng at apple.com Mon Jan 22 15:24:29 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 15:24:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetMachine.cpp Message-ID: <200701222124.l0MLOTXJ017096@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMTargetMachine.cpp updated: 1.16 -> 1.17 --- Log message: Double and Long preferred alignment is 4 for Darwin, 8 for Linux. --- Diffs of the changes: (+5 -1) ARMTargetMachine.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.16 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.17 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.16 Fri Jan 19 20:09:25 2007 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Mon Jan 22 15:24:13 2007 @@ -33,7 +33,11 @@ /// TargetMachine ctor - Create an ILP32 architecture model /// ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS) - : Subtarget(M, FS), DataLayout("e-p:32:32-d:32"), InstrInfo(Subtarget), + : Subtarget(M, FS), + DataLayout(Subtarget.isTargetDarwin() ? + std::string("e-p:32:32-d:32-l:32") : + std::string("e-p:32:32-d:64-l:64")), + InstrInfo(Subtarget), FrameInfo(Subtarget) {} unsigned ARMTargetMachine::getModuleMatchQuality(const Module &M) { From dpatel at apple.com Mon Jan 22 15:29:37 2007 From: dpatel at apple.com (Devang Patel) Date: Mon, 22 Jan 2007 13:29:37 -0800 Subject: [llvm-commits] llvm-gcc4: gimplifier fixes In-Reply-To: <200701221451.46558.baldrick@free.fr> References: <200701172216.06669.baldrick@free.fr> <97E05E36-CCE8-4DB6-B0AE-DE40A82D894E@apple.com> <200701221451.46558.baldrick@free.fr> Message-ID: <9A69DA02-DFDE-46FF-8E5E-58338D147F8F@apple.com> On Jan 22, 2007, at 5:51 AM, Duncan Sands wrote: > Hi Devang, > >>> - if (TREE_CODE_CLASS (code) == tcc_unary >>> + if ((TREE_CODE_CLASS (code) == tcc_unary || code == >> >> Eric Botcazou made similar changes in next line to fix Ada. Please >> bring in entire patch and appropriate "APPLE LOCAL llvm" markers. > > I sent the minimal change needed to get Ada to build further, but I've > certainly got nothing against the rest of Eric's patch, so here is the > full version (it may also be useful for Fortran): Applied. - Devang > > Index: gcc.llvm.master/gcc/tree.c > =================================================================== > --- gcc.llvm.master.orig/gcc/tree.c 2007-01-21 23:09:08.000000000 > +0100 > +++ gcc.llvm.master/gcc/tree.c 2007-01-22 14:34:55.000000000 +0100 > @@ -2601,11 +2601,13 @@ > break; > > default: > - if (TREE_CODE_CLASS (code) == tcc_unary > + /* APPLE LOCAL llvm */ > + if ((TREE_CODE_CLASS (code) == tcc_unary || code == > VIEW_CONVERT_EXPR) > && node && !TYPE_P (node) > && TREE_CONSTANT (node)) > TREE_CONSTANT (t) = 1; > - if (TREE_CODE_CLASS (code) == tcc_unary > + /* APPLE LOCAL llvm */ > + if ((TREE_CODE_CLASS (code) == tcc_unary || code == > VIEW_CONVERT_EXPR) > && node && TREE_INVARIANT (node)) > TREE_INVARIANT (t) = 1; > if (TREE_CODE_CLASS (code) == tcc_reference From evan.cheng at apple.com Mon Jan 22 15:34:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 15:34:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp X86ISelLowering.cpp X86Subtarget.cpp Message-ID: <200701222134.l0MLYfkY017283@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.143 -> 1.144 X86ISelLowering.cpp updated: 1.314 -> 1.315 X86Subtarget.cpp updated: 1.49 -> 1.50 --- Log message: Linux GOT indirect reference is only necessary in PIC mode. --- Diffs of the changes: (+5 -3) X86ISelDAGToDAG.cpp | 3 ++- X86ISelLowering.cpp | 3 ++- X86Subtarget.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.143 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.144 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.143 Fri Jan 12 17:22:14 2007 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Jan 22 15:34:25 2007 @@ -947,7 +947,8 @@ // If we're using vanilla 'GOT' PIC style, we should use relative addressing // not to pc, but to _GLOBAL_ADDRESS_TABLE_ external - if (Subtarget->isPICStyleGOT()) { + if (TM.getRelocationModel() == Reloc::PIC_ && + Subtarget->isPICStyleGOT()) { GlobalBaseReg = RegMap->createVirtualRegister(X86::GR32RegisterClass); BuildMI(FirstMBB, MBBI, TII->get(X86::ADD32ri), GlobalBaseReg). addReg(PC). Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.314 llvm/lib/Target/X86/X86ISelLowering.cpp:1.315 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.314 Fri Jan 12 13:20:47 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Jan 22 15:34:25 2007 @@ -664,7 +664,8 @@ InFlag = Chain.getValue(1); } - if (Subtarget->isPICStyleGOT()) { + if (getTargetMachine().getRelocationModel() == Reloc::PIC_ && + Subtarget->isPICStyleGOT()) { Chain = DAG.getCopyToReg(Chain, X86::EBX, DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()), InFlag); Index: llvm/lib/Target/X86/X86Subtarget.cpp diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.49 llvm/lib/Target/X86/X86Subtarget.cpp:1.50 --- llvm/lib/Target/X86/X86Subtarget.cpp:1.49 Wed Jan 17 04:33:08 2007 +++ llvm/lib/Target/X86/X86Subtarget.cpp Mon Jan 22 15:34:25 2007 @@ -40,7 +40,7 @@ return (!isDirectCall && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || (GV->isExternal() && !GV->hasNotBeenReadFromBytecode()))); - } else if (isPICStyleGOT()) { + } else if (TM.getRelocationModel() == Reloc::PIC_ && isPICStyleGOT()) { // Extra load is needed for all non-statics. return (!isDirectCall && (GV->isExternal() || !GV->hasInternalLinkage())); From llvm at cs.uiuc.edu Mon Jan 22 16:12:49 2007 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 22 Jan 2007 16:12:49 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/cond-expr.c cond-expr.reference_output Message-ID: <200701222212.l0MMCnbS018269@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: cond-expr.c (r1.3) removed cond-expr.reference_output (r1.1) removed --- Log message: the test has been removed since it makes no sense for GCC4.0.2 or higher version. --- Diffs of the changes: (+0 -0) 0 files changed From han at autoesl.com Mon Jan 22 14:47:43 2007 From: han at autoesl.com (Guoling Han) Date: Mon, 22 Jan 2007 14:47:43 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/SSAtest.c arith.c array.c bigint.c bitbit.c bitlogic.c cppfield.cpp enum.cpp exception.cpp extern-inline-redef.c field.c folding.c general-test.c global.c large-array.c list.c local-array.c local-union.c matrix.c matrix.reference_output memory.c offset.c override.cpp pointer.c static.c struct1.c struct2.c structInit.c switch.c template.cpp template2.cpp template3.cpp union-init.c union-struct.c union2.c Message-ID: <200701222047.l0MKlh6E016320@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: SSAtest.c updated: 1.3 -> 1.4 arith.c updated: 1.3 -> 1.4 array.c updated: 1.3 -> 1.4 bigint.c updated: 1.3 -> 1.4 bitbit.c updated: 1.3 -> 1.4 bitlogic.c updated: 1.3 -> 1.4 cppfield.cpp updated: 1.1 -> 1.2 enum.cpp updated: 1.3 -> 1.4 exception.cpp updated: 1.2 -> 1.3 extern-inline-redef.c updated: 1.3 -> 1.4 field.c updated: 1.2 -> 1.3 folding.c updated: 1.2 -> 1.3 general-test.c updated: 1.3 -> 1.4 global.c updated: 1.2 -> 1.3 large-array.c updated: 1.3 -> 1.4 list.c updated: 1.3 -> 1.4 local-array.c updated: 1.3 -> 1.4 local-union.c updated: 1.3 -> 1.4 matrix.c updated: 1.4 -> 1.5 matrix.reference_output updated: 1.1 -> 1.2 memory.c updated: 1.3 -> 1.4 offset.c updated: 1.3 -> 1.4 override.cpp updated: 1.3 -> 1.4 pointer.c updated: 1.3 -> 1.4 static.c updated: 1.2 -> 1.3 struct1.c updated: 1.3 -> 1.4 struct2.c updated: 1.3 -> 1.4 structInit.c updated: 1.3 -> 1.4 switch.c updated: 1.3 -> 1.4 template.cpp updated: 1.3 -> 1.4 template2.cpp updated: 1.2 -> 1.3 template3.cpp updated: 1.3 -> 1.4 union-init.c updated: 1.3 -> 1.4 union-struct.c updated: 1.3 -> 1.4 union2.c updated: 1.2 -> 1.3 --- Log message: Fixed some errors in the testcases and added license titles. --- Diffs of the changes: (+371 -243) SSAtest.c | 10 +- arith.c | 10 +- array.c | 10 +- bigint.c | 10 +- bitbit.c | 10 +- bitlogic.c | 10 +- cppfield.cpp | 5 + enum.cpp | 10 +- exception.cpp | 10 +- extern-inline-redef.c | 10 +- field.c | 26 +++++-- folding.c | 10 +- general-test.c | 5 + global.c | 12 ++- large-array.c | 10 +- list.c | 32 +++++++- local-array.c | 10 +- local-union.c | 10 +- matrix.c | 171 ++++++++++++++++++++++++++---------------------- matrix.reference_output | 72 ++------------------ memory.c | 14 ++- offset.c | 10 +- override.cpp | 10 +- pointer.c | 10 +- static.c | 10 +- struct1.c | 10 +- struct2.c | 10 +- structInit.c | 10 +- switch.c | 18 +++-- template.cpp | 10 +- template2.cpp | 10 +- template3.cpp | 9 +- union-init.c | 10 +- union-struct.c | 10 +- union2.c | 10 +- 35 files changed, 371 insertions(+), 243 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/SSAtest.c diff -u llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.3 llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/SSAtest.c Mon Jan 22 14:47:27 2007 @@ -1,10 +1,14 @@ -//===--- SSAtest.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- SSAtest.c --- Test Cases for Bit Accurate Types ----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // Adopted the test from previous test-cases. Changed it with // non-regular int data type. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(4))) int4; Index: llvm-test/SingleSource/UnitTests/Integer/arith.c diff -u llvm-test/SingleSource/UnitTests/Integer/arith.c:1.3 llvm-test/SingleSource/UnitTests/Integer/arith.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/arith.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/arith.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- arith.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- arith.c --- Test Cases for Bit Accurate Types ------------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a general test for arithmatic operations. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include "arith.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/array.c diff -u llvm-test/SingleSource/UnitTests/Integer/array.c:1.3 llvm-test/SingleSource/UnitTests/Integer/array.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/array.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/array.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- array.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- array.c --- Test Cases for Bit Accurate Types ------------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a general test for array data types. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include "array.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/bigint.c diff -u llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.3 llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bigint.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- bigint.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- bigint.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a general test for big integer type. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include "bigint.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/bitbit.c diff -u llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.3 llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bitbit.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- bitbit.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- bitbit.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a general test for bit operations. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include "bitbit.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/bitlogic.c diff -u llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.3 llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bitlogic.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- bitlogic.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- bitlogic.c --- Test Cases for Bit Accurate Types ---------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a general test for logical operations. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include "bitlogic.h" #include Index: llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.1 llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.2 --- llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp Mon Jan 22 14:47:27 2007 @@ -1,4 +1,9 @@ #include +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// typedef unsigned int __attribute__ ((bitwidth(7))) int7; typedef unsigned int __attribute__ ((bitwidth(17))) int17; typedef unsigned int __attribute__ ((bitwidth(32))) int32; Index: llvm-test/SingleSource/UnitTests/Integer/enum.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.3 llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.4 --- llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/enum.cpp Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- enum.cpp --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- enum.cpp --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test of bitwidth attribute with enum data. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include class myClass Index: llvm-test/SingleSource/UnitTests/Integer/exception.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.2 llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.3 --- llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.2 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/exception.cpp Mon Jan 22 14:47:27 2007 @@ -1,10 +1,14 @@ -//===--- exception.cpp --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- exception.cpp --- Test Cases for Bit Accurate Types ------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test of exception handling with non-regular data // type. The compiler should be able to differentiate int31, int7 etc. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(31))) int31; Index: llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c diff -u llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.3 llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- extern_inline_redef.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- extern_inline_redef.c --- Test Cases for Bit Accurate Types ----===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // this is used to test redefining inline function. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(61))) int61; Index: llvm-test/SingleSource/UnitTests/Integer/field.c diff -u llvm-test/SingleSource/UnitTests/Integer/field.c:1.2 llvm-test/SingleSource/UnitTests/Integer/field.c:1.3 --- llvm-test/SingleSource/UnitTests/Integer/field.c:1.2 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/field.c Mon Jan 22 14:47:27 2007 @@ -1,18 +1,27 @@ -//===--- field.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- field.c --- Test Cases for Bit Accurate Types ------------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is used to test struct with field specifier. We suppose the -// data layout of the field should be the same as the corresponding struct using -// bit accurate types. +// data layout of the field should be the same as the corresponding +// struct using bit accurate types. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(7))) int7; typedef int __attribute__ ((bitwidth(17))) int17; typedef int __attribute__ ((bitwidth(32))) int32; typedef int __attribute__ ((bitwidth(8))) int8; -typedef struct myStruct{int i; unsigned char c :7; int s: 17; char c2;} myStruct; +typedef long __attribute__ ((bitwidth(33))) long33; +typedef char __attribute__ ((bitwidth(7))) char7; +typedef short __attribute__ ((bitwidth(17))) short17; + +typedef struct myStruct{int i; unsigned char c:7; int s:17; char c2;} myStruct; + typedef struct myStruct2{int32 i; int7 c; int17 s; int8 c2;} myStruct2; int main() @@ -23,6 +32,8 @@ void* ptr, *ptr1, *ptr2, *ptr3; unsigned int offset, offset1; + // printf("sizeof(int7) = %d, sizeof(int17) = %d, sizeof(int33) = %d\n", + // sizeof(char7), sizeof(short17), sizeof(long33)); ptr = &(x.i); ptr1 = &(x.c2); @@ -35,7 +46,8 @@ if(offset != offset1) printf("error: offset=%x, offset1=%x\n", offset, offset1); if(sizeof(myStruct) != sizeof(myStruct2)) - printf("error2: sizeof myStruct = %d, sizeof myStruct2 = %d\n", sizeof(myStruct), sizeof(myStruct2)); + printf("error2: sizeof myStruct = %d, sizeof myStruct2 = %d\n", + sizeof(myStruct), sizeof(myStruct2)); return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/folding.c diff -u llvm-test/SingleSource/UnitTests/Integer/folding.c:1.2 llvm-test/SingleSource/UnitTests/Integer/folding.c:1.3 --- llvm-test/SingleSource/UnitTests/Integer/folding.c:1.2 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/folding.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- folding.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- folding.c --- Test Cases for Bit Accurate Types ----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is used to test constant folding optimization. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(7))) int7; Index: llvm-test/SingleSource/UnitTests/Integer/general-test.c diff -u llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.3 llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.3 Fri Jan 19 16:24:05 2007 +++ llvm-test/SingleSource/UnitTests/Integer/general-test.c Mon Jan 22 14:47:27 2007 @@ -1,4 +1,9 @@ /* This test just tries out a few bitwidth attribute constructs and +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// * generates some output based on the them. */ Index: llvm-test/SingleSource/UnitTests/Integer/global.c diff -u llvm-test/SingleSource/UnitTests/Integer/global.c:1.2 llvm-test/SingleSource/UnitTests/Integer/global.c:1.3 --- llvm-test/SingleSource/UnitTests/Integer/global.c:1.2 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/global.c Mon Jan 22 14:47:27 2007 @@ -1,15 +1,19 @@ -//===--- global.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- global.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is used to test global arrays. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(7))) int7; typedef int __attribute__ ((bitwidth(14))) int14; -int7 array[4] = {127, -1, 100 -28}; +int7 array[4] = {127, -1, 100, -28}; int14 array2[4][4]; void test() Index: llvm-test/SingleSource/UnitTests/Integer/large-array.c diff -u llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.3 llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/large-array.c Mon Jan 22 14:47:27 2007 @@ -1,10 +1,14 @@ -//===--- large-array.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- large-array.c --- Test Cases for Bit Accurate Types ------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is used to test large local arrays. Some local arrays are // partially initilized. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/list.c diff -u llvm-test/SingleSource/UnitTests/Integer/list.c:1.3 llvm-test/SingleSource/UnitTests/Integer/list.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/list.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/list.c Mon Jan 22 14:47:27 2007 @@ -1,10 +1,16 @@ -//===--- list.c --- Test Cases for Bit Accurate Types ---------------------===// +//===--- list.c --- Test Cases for Bit Accurate Types -------------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for simple linked list operation. Data are added to // and removed from the list. We compare the expected value wehen we // remove data from the list. // -//===----------------------------------------------------------------------===// +//===--------------------------------------------------------------------===// + #include #include @@ -14,7 +20,21 @@ typedef struct myStruct{int9 x; int7 y; } myStruct; typedef struct myList{myStruct s; struct myList* next;} myList; -int array[64*3] = {103, 198, 105, 115, 81, 255, 74, 236, 41, 205, 186, 171, 242, 251, 227, 70, 124, 194, 84, 248, 27, 232, 231, 141, 118, 90, 46, 99, 51, 159, 201, 154, 102, 50, 13, 183, 49, 88, 163, 90, 37, 93, 5, 23, 88, 233, 94, 212, 171, 178, 205, 198, 155, 180, 84, 17, 14, 130, 116, 65, 33, 61, 220, 135, 112, 233, 62, 161, 65, 225, 252, 103, 62, 1, 126, 151, 234, 220, 107, 150, 143, 56, 92, 42, 236, 176, 59, 251, 50, 175, 60, 84, 236, 24, 219, 92, 2, 26, 254, 67, 251, 250, 170, 58, 251, 41, 209, 230, 5, 60, 124, 148, 117, 216, 190, 97, 137, 249, 92, 187, 168, 153, 15, 149, 177, 235, 241, 179, 5, 239, 247, 0, 233, 161, 58, 229, 202, 11, 203, 208, 72, 71, 100, 189, 31, 35, 30, 168, 28, 123, 100, 197, 20, 115, 90, 197, 94, 75, 121, 99, 59, 112, 100, 36, 17, 158, 9, 220, 170, 212, 172, 242, 27, 16, 175, 59, 51, 205, 227, 80, 72, 71, 21, 92, 187, 111, 34, 25, 186, 155, 125, 245 +int array[64*3] = {103, 198, 105, 115, 81, 255, 74, 236, 41, 205, 186, 171, + 242, 251, 227, 70, 124, 194, 84, 248, 27, 232, 231, 141, + 118, 90, 46, 99, 51, 159, 201, 154, 102, 50, 13, 183, 49, + 88, 163, 90, 37, 93, 5, 23, 88, 233, 94, 212, 171, 178, + 205, 198, 155, 180, 84, 17, 14, 130, 116, 65, 33, 61, 220, + 135, 112, 233, 62, 161, 65, 225, 252, 103, 62, 1, 126, 151, + 234, 220, 107, 150, 143, 56, 92, 42, 236, 176, 59, 251, 50, + 175, 60, 84, 236, 24, 219, 92, 2, 26, 254, 67, 251, 250, + 170, 58, 251, 41, 209, 230, 5, 60, 124, 148, 117, 216, 190, + 97, 137, 249, 92, 187, 168, 153, 15, 149, 177, 235, 241, + 179, 5, 239, 247, 0, 233, 161, 58, 229, 202, 11, 203, 208, + 72, 71, 100, 189, 31, 35, 30, 168, 28, 123, 100, 197, 20, + 115, 90, 197, 94, 75, 121, 99, 59, 112, 100, 36, 17, 158, + 9, 220, 170, 212, 172, 242, 27, 16, 175, 59, 51, 205, 227, + 80, 72, 71, 21, 92, 187, 111, 34, 25, 186, 155, 125, 245 }; void test() @@ -42,9 +62,11 @@ myList* tmp; i+=1; if(head->s.x != array[64*3 - i]) - printf("error: i = %d, x = %d, array = %d\n", i,head->s.x, array[64*3 - i]); + printf("error: i = %d, x = %d, array = %d\n", + i,head->s.x, array[64*3 - i]); if( (head->s.y ^ (int7)((array[64*3 - i] - 1)&0x7f)) != 0 ) - printf("error: i = %d, y = %hhd, expected = %hhd\n", i, (unsigned char)(head->s.y), ((array[64*3 - i] - 1)&0x7f)); + printf("error: i = %d, y = %hhd, expected = %hhd\n", + i, (unsigned char)(head->s.y), ((array[64*3 - i] - 1)&0x7f)); //remove from the list tmp = head; head = head->next; Index: llvm-test/SingleSource/UnitTests/Integer/local-array.c diff -u llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.3 llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/local-array.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- local-array.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- local-array.c --- Test Cases for Bit Accurate Types ------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is another test for local arrays. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(4))) int4; Index: llvm-test/SingleSource/UnitTests/Integer/local-union.c diff -u llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.3 llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/local-union.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- local-union.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- local-union.c --- Test Cases for Bit Accurate Types ------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for local union data type. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/matrix.c diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.4 llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.4 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.c Mon Jan 22 14:47:27 2007 @@ -1,110 +1,125 @@ -//===--- matrix.c --- Test Cases for Bit Accurate Types -------------------===// +//===--- matrix.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for matrix with non-regular bitwidth data. In // my_test(A, B) function, we get A=A*B. For each row after // multiplication, we sort it in non-increasing order. Then the first // two largest elements are used to get the gcd. // -//===----------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include "matrix.h" #include #include typedef enum bool{false=0, true=1} bool; -void mysort(const int17 X[8], int17 Y[8]){ -{ - unsigned int i, j; - int17 temp; - { - j = 0; - for ( ; ; ) { - bool ssdm_tmp_4 = (j < 8); - if (!ssdm_tmp_4) break; - Y[j] = X[j]; - j++; - } - } - { - j = 0; - for ( ; ; ) { - bool ssdm_tmp_5 = (j < 8); - if (!ssdm_tmp_5) break; - { - temp = -0xffff; - { - i = j; - for ( ; ; ) { - bool ssdm_tmp_6 = (i < 8); - if (!ssdm_tmp_6) break; - { - temp = Y[i] > temp ? Y[i] : temp; - } - ++i; - } - } - Y[j] = temp; - } - j++; - } - } -} -} -// Module | Test -// Thread: int my_test(sc_int<17> A[8][8], sc_int<17> B[8][8] ); -int my_test(int17 A[8][8], int17 B[8][8]){ + + + + +void mysort(const int17 X[8], int17 Y[8]) { - unsigned int i, j, k; - int17 C[8]; - int t; - { - i = 0; - for ( ; ; ) { - bool ssdm_tmp_1 = (i < 8); - if (!ssdm_tmp_1) break; + unsigned int i, j; + int17 temp; { - j = 0; - for ( ; ; ) { - bool ssdm_tmp_2 = (j < 8); - if (!ssdm_tmp_2) break; - { - { - k = 0; + j = 0; for ( ; ; ) { - bool ssdm_tmp_3 = (k < 8); - if (!ssdm_tmp_3) break; - A[i][j] = A[i][k] * B[j][k]; - ++k; + bool ssdm_tmp_4 = (j < 8); + if (!ssdm_tmp_4) break; + Y[j] = X[j]; + j++; } - } - mysort(A[i], C); - t = get_gcd(C[0], C[1]); - printf("t=%d\n", t); - } - ++j; } + { + j = 0; + for ( ; ;j++ ) { + bool ssdm_tmp_5 = (j < 8); + if (!ssdm_tmp_5) break; + { + i = j; + for ( ; ; i++) { + bool ssdm_tmp_6 = (i < 8); + if (!ssdm_tmp_6) break; + { + if(Y[i]>Y[j]){ + temp = Y[j]; + Y[j] = Y[i]; + Y[i] = temp; + } + + } + } + } + + } } - ++i; - } - } - return 0; } -} -// Thread: int get_gcd(const int& a, const int& b); -int get_gcd(const int a, const int b){ + + + +int get_gcd(const int a, const int b) { - if (b == 0/*CPPASTBinaryExpression*/) + if (b == 0) return a; return get_gcd( b, a % b ); } + + + +int my_test(int17 A[8][8], int17 B[8][8]) +{ + unsigned int i, j, k, dd; + int17 C[8][8]; + int17 D[8]; + int t; + { + i = 0; + for ( ; ; ) { + bool ssdm_tmp_1 = (i < 8); + if (!ssdm_tmp_1) break; + { + j = 0; + for ( ; ; ) { + bool ssdm_tmp_2 = (j < 8); + if (!ssdm_tmp_2) break; + { + { + C[i][j] = 0; + k = 0; + for ( ; ; ) { + bool ssdm_tmp_3 = (k < 8); + if (!ssdm_tmp_3) break; + C[i][j] += A[i][k] * B[k][j]; + ++k; + } + } + + } + + ++j; + } + } + mysort(C[i], D); + t = get_gcd(D[0], D[1]); + printf("get_gcd(%d, %d) = %d\n", D[0], D[1], t); + ++i; + } + } + return 0; } + + + int main() { - unsigned int i, j; + int i, j; int17 X[8][8]; int17 Y[8][8]; Index: llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output Mon Jan 22 14:47:27 2007 @@ -1,65 +1,9 @@ -t=86 -t=86 -t=22532 -t=45064 -t=45064 -t=45064 -t=45064 -t=45064 -t=172 -t=172 -t=45064 -t=45064 -t=45064 -t=49184 -t=49184 -t=49184 -t=2 -t=2 -t=2 -t=4 -t=4 -t=4 -t=4 -t=4 -t=8 -t=8 -t=8 -t=49184 -t=49184 -t=49184 -t=57424 -t=57424 -t=2 -t=2 -t=2 -t=2 -t=2 -t=57424 -t=57424 -t=57424 -t=516 -t=516 -t=4120 -t=8240 -t=12360 -t=16480 -t=20600 -t=20600 -t=602 -t=602 -t=26652 -t=53304 -t=53304 -t=53304 -t=53304 -t=53304 -t=688 -t=688 -t=49184 -t=49184 -t=49184 -t=49184 -t=49184 -t=49184 +get_gcd(50088, 48396) = 12 +get_gcd(-30896, -34280) = -8 +get_gcd(19192, 14116) = 4 +get_gcd(62512, 55744) = 16 +get_gcd(60148, -11704) = -44 +get_gcd(38384, 28232) = 8 +get_gcd(64784, 52940) = 4 +get_gcd(57344, 43808) = 32 exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/memory.c diff -u llvm-test/SingleSource/UnitTests/Integer/memory.c:1.3 llvm-test/SingleSource/UnitTests/Integer/memory.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/memory.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/memory.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,15 @@ -//===--- memory.c --- Test Cases for Bit Accurate Types -------------------===// +//===--- memory.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for memory malloc and free operations. It tests // non-regular bitwidth data and structures. // -//===----------------------------------------------------------------------===// +//===--------------------------------------------------------------------===// + #include #include @@ -17,7 +23,7 @@ int inum = num; unsigned int i = 0; - int31* array = malloc(sizeof(int3) * inum); + int31* array = (int31*) malloc(sizeof(int31) * inum); for(i=0; i< num; ++i) { array[i] = i; @@ -29,7 +35,7 @@ void mem_test2() { myStruct* ptr = malloc(sizeof(myStruct)); - ptr->y = 8; // constant 0 + ptr->y = 0; if(ptr->y != 0) printf("error\n"); ptr->x = ++(ptr->y); Index: llvm-test/SingleSource/UnitTests/Integer/offset.c diff -u llvm-test/SingleSource/UnitTests/Integer/offset.c:1.3 llvm-test/SingleSource/UnitTests/Integer/offset.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/offset.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/offset.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- offset.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- offset.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for data size calculation with non-regular integral type. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/override.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.3 llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.4 --- llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/override.cpp Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- override.cpp --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- override.cpp --- Test Cases for Bit Accurate Types -------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test of override test. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(31))) int31; typedef int __attribute__ ((bitwidth(32))) int32; Index: llvm-test/SingleSource/UnitTests/Integer/pointer.c diff -u llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.3 llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/pointer.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- pointer.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- pointer.c --- Test Cases for Bit Accurate Types ----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for address calculation with non-regular integral type. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(3))) int3; Index: llvm-test/SingleSource/UnitTests/Integer/static.c diff -u llvm-test/SingleSource/UnitTests/Integer/static.c:1.2 llvm-test/SingleSource/UnitTests/Integer/static.c:1.3 --- llvm-test/SingleSource/UnitTests/Integer/static.c:1.2 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/static.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- static.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- static.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for static data with non-regular integral data. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(31))) int31; Index: llvm-test/SingleSource/UnitTests/Integer/struct1.c diff -u llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.3 llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/struct1.c Mon Jan 22 14:47:27 2007 @@ -1,10 +1,14 @@ -//===--- struct1.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- struct1.c --- Test Cases for Bit Accurate Types ----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for struct data structure. If the data layout for // non-regular bitwidth data is not correct, it may change the value of another field. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/struct2.c diff -u llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.3 llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/struct2.c Mon Jan 22 14:47:27 2007 @@ -1,10 +1,14 @@ -//===--- struct2.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- struct2.c --- Test Cases for Bit Accurate Types ----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for struct data structure. We test the nested structure // and pointer to structure. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/structInit.c diff -u llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.3 llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/structInit.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- structInit.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- structInit.c --- Test Cases for Bit Accurate Types -------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for struct data structure with initialization. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(31))) int31; Index: llvm-test/SingleSource/UnitTests/Integer/switch.c diff -u llvm-test/SingleSource/UnitTests/Integer/switch.c:1.3 llvm-test/SingleSource/UnitTests/Integer/switch.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/switch.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/switch.c Mon Jan 22 14:47:27 2007 @@ -1,20 +1,30 @@ -//===--- switch.c --- Test Cases for Bit Accurate Types -------------------===// +//===--- switch.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for switch statement. The switch value is a // non-regular bitwidth. test(int3 c) function return the value of the // argument c. // -//===----------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef unsigned int __attribute__ ((bitwidth(7))) int7; typedef unsigned int __attribute__ ((bitwidth(3))) int3; +<<<<<<< switch.c +======= const int7 zero = (int7)(1 << 8); // constant 0; static int3 seven = (int3)0xf; // constant 7; +>>>>>>> 1.2 + +const int7 zero = 0; // constant 0; +static int3 seven = 7; // constant 7; -int3 test(unsigned char c) +int3 test(int3 c) { switch(c){ Index: llvm-test/SingleSource/UnitTests/Integer/template.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.3 llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.4 --- llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template.cpp Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- template.cpp --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- template.cpp --- Test Cases for Bit Accurate Types -------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for template functions. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/template2.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.2 llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.3 --- llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.2 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template2.cpp Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- template2.cpp --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- template2.cpp --- Test Cases for Bit Accurate Types ------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for template classes. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(26))) int26; Index: llvm-test/SingleSource/UnitTests/Integer/template3.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.3 llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.4 --- llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.3 Sat Jan 20 13:35:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template3.cpp Mon Jan 22 14:47:27 2007 @@ -1,11 +1,16 @@ -//===--- template3.cpp --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- template3.cpp --- Test Cases for Bit Accurate Types ------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for partial specialization. // //===------------------------------------------------------------------------===// #include -using namespace std; + typedef int __attribute__ ((bitwidth(17))) int17; typedef int __attribute__ ((bitwidth(15))) int15; Index: llvm-test/SingleSource/UnitTests/Integer/union-init.c diff -u llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.3 llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union-init.c Mon Jan 22 14:47:27 2007 @@ -1,9 +1,13 @@ -//===--- union-init.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- union-init.c --- Test Cases for Bit Accurate Types -------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for union initialization. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/union-struct.c diff -u llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.3 llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.4 --- llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.3 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union-struct.c Mon Jan 22 14:47:27 2007 @@ -1,10 +1,14 @@ -//===--- union-struct.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- union-struct.c --- Test Cases for Bit Accurate Types -----------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for struct with union inside. The purpose is to see // whether the size of the structure is correct. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include Index: llvm-test/SingleSource/UnitTests/Integer/union2.c diff -u llvm-test/SingleSource/UnitTests/Integer/union2.c:1.2 llvm-test/SingleSource/UnitTests/Integer/union2.c:1.3 --- llvm-test/SingleSource/UnitTests/Integer/union2.c:1.2 Fri Jan 19 16:54:01 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union2.c Mon Jan 22 14:47:27 2007 @@ -1,10 +1,14 @@ -//===--- union2.c --- Test Cases for Bit Accurate Types -------------------------------===// +//===--- union2.c --- Test Cases for Bit Accurate Types -----------------===// +// +// This file was developed by Guoling han and donated to the LLVM research +// group and is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +//===-------------------------------------------------------------------===// // // This is a test for union type. By assigning values to different // fields, we can check whether the assignment is correctly performed. // -//===------------------------------------------------------------------------===// - +//===--------------------------------------------------------------------===// #include typedef int __attribute__ ((bitwidth(9))) int9; typedef int __attribute__ ((bitwidth(31))) int31; From han at autoesl.com Mon Jan 22 16:38:35 2007 From: han at autoesl.com (Guoling Han) Date: Mon, 22 Jan 2007 16:38:35 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/convert.c convert.reference_output Message-ID: <200701222238.l0MMcZXm018687@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: convert.c added (r1.1) convert.reference_output added (r1.1) --- Log message: Add test case for type conversion. --- Diffs of the changes: (+70 -0) convert.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++ convert.reference_output | 5 +++ 2 files changed, 70 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/convert.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/convert.c:1.1 *** /dev/null Mon Jan 22 16:38:29 2007 --- llvm-test/SingleSource/UnitTests/Integer/convert.c Mon Jan 22 16:38:19 2007 *************** *** 0 **** --- 1,65 ---- + //===--- convert.c --- Test Cases for Bit Accurate Types --------------===//// + // This file was developed by Guoling han and donated to the LLVM research + // group and is distributed under the University of Illinois Open Source + // License. See LICENSE.TXT for details. + //===----------------------------------------------------------------------===//// + // This is a test for conversion between different int types. + // + //===----------------------------------------------------------------------===// + #include + + typedef int __attribute__ ((bitwidth(7))) int7; + typedef int __attribute__ ((bitwidth(15))) int15; + typedef int __attribute__ ((bitwidth(31))) int31; + typedef int __attribute__ ((bitwidth(8))) int8; + + typedef unsigned int __attribute__ ((bitwidth(7))) uint7; + typedef unsigned int __attribute__ ((bitwidth(15))) uint15; + typedef unsigned int __attribute__ ((bitwidth(31))) uint31; + typedef unsigned int __attribute__ ((bitwidth(8))) uint8; + + int main() + { + int7 i7; + int15 i15; + int31 i31; + int8 i8; + + uint7 ui7; + uint15 ui15; + uint31 ui31; + uint8 ui8; + + i7 = 0x7f; + i15 = (int15)i7; + i31 = (int31)i15; + if(i15 != -1 || i31 != -1) + printf("error: i15=%d, i31 = %d\n", i15, i31); + + ui7 = 0x7f; + ui15 = (uint15)ui7; + ui31 = (uint31)ui15; + if(ui15 != 0x7f || ui31 != 0x7f) + printf("error: ui15=%u, ui31 = %u\n", ui15, ui31); + + i31 = -1; + i8 = (int8) i31; + if(i8 != -1) + printf("error: i8=%d\n", i8); + + i31 = 0xff; + i7 = (int7) i31; + printf("i7=%d\n", i7); + + ui31 = 0x1ff; + ui8 = (uint8) ui31; + printf("ui8=%u\n", ui8); + + i8 = (int8) ui8; + printf("i8=%d\n", i8); + + ui7 = (uint7) i7; + printf("ui7=%u\n", ui7); + + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/convert.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/convert.reference_output:1.1 *** /dev/null Mon Jan 22 16:38:35 2007 --- llvm-test/SingleSource/UnitTests/Integer/convert.reference_output Mon Jan 22 16:38:19 2007 *************** *** 0 **** --- 1,5 ---- + i7=-1 + ui8=255 + i8=-1 + ui7=127 + exit 0 From evan.cheng at apple.com Mon Jan 22 17:01:37 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 17:01:37 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/ldm.ll Message-ID: <200701222301.l0MN1b4V019331@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: ldm.ll updated: 1.2 -> 1.3 --- Log message: Pasto --- Diffs of the changes: (+1 -1) ldm.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/ARM/ldm.ll diff -u llvm/test/CodeGen/ARM/ldm.ll:1.2 llvm/test/CodeGen/ARM/ldm.ll:1.3 --- llvm/test/CodeGen/ARM/ldm.ll:1.2 Mon Jan 22 12:57:39 2007 +++ llvm/test/CodeGen/ARM/ldm.ll Mon Jan 22 17:01:22 2007 @@ -1,7 +1,7 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep "ldmfd sp\!" | wc -l | grep 3 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep "ldmfd sp\!" | wc -l | grep 3 %X = external global [0 x int] From evan.cheng at apple.com Mon Jan 22 17:08:35 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 17:08:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200701222308.l0MN8ZnT019515@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.80 -> 1.81 --- Log message: - getTypeAlignmentShift() should be returning preferred alignment, not ABI alignment. - getPreferredAlignmentLog(): remove Double special case. --- Diffs of the changes: (+1 -3) TargetData.cpp | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.80 llvm/lib/Target/TargetData.cpp:1.81 --- llvm/lib/Target/TargetData.cpp:1.80 Sat Jan 20 17:32:04 2007 +++ llvm/lib/Target/TargetData.cpp Mon Jan 22 17:08:19 2007 @@ -451,7 +451,7 @@ } unsigned char TargetData::getTypeAlignmentShift(const Type *Ty) const { - unsigned Align = getTypeAlignmentABI(Ty); + unsigned Align = getTypeAlignmentPref(Ty); assert(!(Align & (Align-1)) && "Alignment is not a power of two!"); return Log2_32(Align); } @@ -514,8 +514,6 @@ if (GV->hasInitializer()) { // Always round up alignment of global doubles to 8 bytes. - if (GV->getType()->getElementType() == Type::DoubleTy && Alignment < 3) - Alignment = 3; if (Alignment < 4) { // If the global is not external, see if it is large. If so, give it a // larger alignment. From evan.cheng at apple.com Mon Jan 22 17:10:06 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 17:10:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200701222310.l0MNA6Cf019559@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.139 -> 1.140 --- Log message: Double and long preferred alignment is 8 byte. --- Diffs of the changes: (+2 -2) X86TargetMachine.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.139 llvm/lib/Target/X86/X86TargetMachine.cpp:1.140 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.139 Sat Jan 20 16:35:55 2007 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Mon Jan 22 17:09:50 2007 @@ -109,8 +109,8 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS, bool is64Bit) : Subtarget(M, FS, is64Bit), DataLayout(Subtarget.is64Bit() ? - std::string("e-p:64:64-d:32:64-l:32") : - std::string("e-p:32:32-d:32:64-l:32")), + std::string("e-p:64:64-d:32:64-l:32:64") : + std::string("e-p:32:32-d:32:64-l:32:64")), FrameInfo(TargetFrameInfo::StackGrowsDown, Subtarget.getStackAlignment(), Subtarget.is64Bit() ? -8 : -4), InstrInfo(*this), JITInfo(*this), TLInfo(*this) { From clattner at apple.com Mon Jan 22 17:10:01 2007 From: clattner at apple.com (Chris Lattner) Date: Mon, 22 Jan 2007 15:10:01 -0800 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/SSAtest.c arith.c array.c bigint.c bitbit.c bitlogic.c cppfield.cpp enum.cpp exception.cpp extern-inline-redef.c field.c folding.c general-test.c global.c large-array.c list.c local-array.c local-union.c matrix.c matrix.reference_output memory.c offset.c override.cpp pointer.c static.c struct1.c struct2.c structInit.c switch.c template.cpp template2.cpp template3.cpp union-init.c union-struct.c union2.c In-Reply-To: <200701222047.l0MKlh6E016320@zion.cs.uiuc.edu> References: <200701222047.l0MKlh6E016320@zion.cs.uiuc.edu> Message-ID: <794F1C03-FFD7-40E2-917F-F6CD708C8987@apple.com> On Jan 22, 2007, at 12:47 PM, Guoling Han wrote: > -//===--- SSAtest.c --- Test Cases for Bit Accurate Types > -------------------------------===// > +//===--- SSAtest.c --- Test Cases for Bit Accurate Types > ----------------===// > +// > +// This file was developed by Guoling han and donated to the LLVM > research > +// group and is distributed under the University of Illinois Open > Source > +// License. See LICENSE.TXT for details. > +// > ===------------------------------------------------------------------- > ===// Hi, please use the standard wording for the LLVM license block. The words should be exactly: "This file was developed by XXX and is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details." Where XXX is replaced with your name. llvm-test doesn't matter as much as the llvm repository, but please be aware of this. Thanks, -Chris From evan.cheng at apple.com Mon Jan 22 17:11:22 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 17:11:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCSubtarget.h Message-ID: <200701222311.l0MNBMKE019592@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCSubtarget.h updated: 1.22 -> 1.23 --- Log message: Double and long preferred alignment set to 8 bytes. --- Diffs of the changes: (+2 -1) PPCSubtarget.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCSubtarget.h diff -u llvm/lib/Target/PowerPC/PPCSubtarget.h:1.22 llvm/lib/Target/PowerPC/PPCSubtarget.h:1.23 --- llvm/lib/Target/PowerPC/PPCSubtarget.h:1.22 Thu Jan 18 22:36:02 2007 +++ llvm/lib/Target/PowerPC/PPCSubtarget.h Mon Jan 22 17:11:06 2007 @@ -104,7 +104,8 @@ /// getTargetDataString - Return the pointer size and type alignment /// properties of this subtarget. const char *getTargetDataString() const { - return isPPC64() ? "E-p:64:64-d:32-l:32" : "E-p:32:32-d:32-l:32"; + return isPPC64() ? "E-p:64:64-d:32:64-l:32:64" + : "E-p:32:32-d:32:64-l:32:64"; } /// isPPC64 - Return true if we are generating code for 64-bit pointer mode. From evan.cheng at apple.com Mon Jan 22 17:13:17 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 17:13:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetMachine.cpp Message-ID: <200701222313.l0MNDHn4019637@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMTargetMachine.cpp updated: 1.17 -> 1.18 --- Log message: ARM AAPCS abi (Linux, etc.) requires 8-byte double / long alignment; Mac requires 4-bytes alignment. --- Diffs of the changes: (+2 -2) ARMTargetMachine.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.17 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.18 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.17 Mon Jan 22 15:24:13 2007 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Mon Jan 22 17:13:01 2007 @@ -35,8 +35,8 @@ ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS) : Subtarget(M, FS), DataLayout(Subtarget.isTargetDarwin() ? - std::string("e-p:32:32-d:32-l:32") : - std::string("e-p:32:32-d:64-l:64")), + std::string("e-p:32:32-d:32:32-l:32:32") : + std::string("e-p:32:32-d:32:64-l:32:64")), InstrInfo(Subtarget), FrameInfo(Subtarget) {} From evan.cheng at apple.com Mon Jan 22 17:14:10 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 17:14:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Message-ID: <200701222314.l0MNEAvW019668@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAG.cpp updated: 1.114 -> 1.115 --- Log message: Remove the DoubleTy special case. --- Diffs of the changes: (+5 -9) ScheduleDAG.cpp | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.114 llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.115 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.114 Fri Jan 12 17:31:12 2007 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Mon Jan 22 17:13:55 2007 @@ -330,15 +330,11 @@ const Type *Type = CP->getType(); // MachineConstantPool wants an explicit alignment. if (Align == 0) { - if (Type == Type::DoubleTy) - Align = 3; // always 8-byte align doubles. - else { - Align = TM.getTargetData()->getTypeAlignmentShift(Type); - if (Align == 0) { - // Alignment of packed types. FIXME! - Align = TM.getTargetData()->getTypeSize(Type); - Align = Log2_64(Align); - } + Align = TM.getTargetData()->getTypeAlignmentShift(Type); + if (Align == 0) { + // Alignment of packed types. FIXME! + Align = TM.getTargetData()->getTypeSize(Type); + Align = Log2_64(Align); } } From evan.cheng at apple.com Mon Jan 22 17:15:08 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 17:15:08 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h Message-ID: <200701222315.l0MNF84p019701@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.46 -> 1.47 --- Log message: Update comment. --- Diffs of the changes: (+1 -1) TargetData.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.46 llvm/include/llvm/Target/TargetData.h:1.47 --- llvm/include/llvm/Target/TargetData.h:1.46 Sat Jan 20 17:32:04 2007 +++ llvm/include/llvm/Target/TargetData.h Mon Jan 22 17:14:52 2007 @@ -233,7 +233,7 @@ /// the specified type. unsigned char getTypeAlignmentPref(const Type *Ty) const; - /// getTypeAlignmentShift - Return the minimum required alignment for the + /// getTypeAlignmentShift - Return the preferred alignment for the /// specified type, returned as log2 of the value (a shift amount). /// unsigned char getTypeAlignmentShift(const Type *Ty) const; From evan.cheng at apple.com Mon Jan 22 17:18:26 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 17:18:26 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/align.ll Message-ID: <200701222318.l0MNIQKi019760@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: align.ll updated: 1.1 -> 1.2 --- Log message: Make it work for both Linux and Mac OS. --- Diffs of the changes: (+3 -2) align.ll | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/ARM/align.ll diff -u llvm/test/CodeGen/ARM/align.ll:1.1 llvm/test/CodeGen/ARM/align.ll:1.2 --- llvm/test/CodeGen/ARM/align.ll:1.1 Thu Dec 7 16:38:06 2006 +++ llvm/test/CodeGen/ARM/align.ll Mon Jan 22 17:18:10 2007 @@ -1,7 +1,8 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep align.*1 | wc | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep align.*2 | wc | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep align.*3 | wc | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep align.*2 | wc | grep 2 && +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-linux | grep align.*3 | wc | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep align.*2 | wc | grep 4 %a = global bool true %b = global sbyte 1 From han at autoesl.com Mon Jan 22 17:33:54 2007 From: han at autoesl.com (Guoling Han) Date: Mon, 22 Jan 2007 17:33:54 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/convert.c Message-ID: <200701222333.l0MNXsq2020066@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: convert.c updated: 1.1 -> 1.2 --- Log message: Change convert.c to conform with the coding standard. --- Diffs of the changes: (+10 -8) convert.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/convert.c diff -u llvm-test/SingleSource/UnitTests/Integer/convert.c:1.1 llvm-test/SingleSource/UnitTests/Integer/convert.c:1.2 --- llvm-test/SingleSource/UnitTests/Integer/convert.c:1.1 Mon Jan 22 16:38:19 2007 +++ llvm-test/SingleSource/UnitTests/Integer/convert.c Mon Jan 22 17:33:38 2007 @@ -1,11 +1,13 @@ -//===--- convert.c --- Test Cases for Bit Accurate Types --------------===//// -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -//===----------------------------------------------------------------------===//// +//===--- convert.c --- Test Cases for Bit Accurate Types ------------------===// +// +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// // This is a test for conversion between different int types. // //===----------------------------------------------------------------------===// + #include typedef int __attribute__ ((bitwidth(7))) int7; @@ -34,18 +36,18 @@ i15 = (int15)i7; i31 = (int31)i15; if(i15 != -1 || i31 != -1) - printf("error: i15=%d, i31 = %d\n", i15, i31); + printf("error: i15=%d, i31 = %d\n", i15, i31); ui7 = 0x7f; ui15 = (uint15)ui7; ui31 = (uint31)ui15; if(ui15 != 0x7f || ui31 != 0x7f) - printf("error: ui15=%u, ui31 = %u\n", ui15, ui31); + printf("error: ui15=%u, ui31 = %u\n", ui15, ui31); i31 = -1; i8 = (int8) i31; if(i8 != -1) - printf("error: i8=%d\n", i8); + printf("error: i8=%d\n", i8); i31 = 0xff; i7 = (int7) i31; From han at autoesl.com Mon Jan 22 18:17:37 2007 From: han at autoesl.com (Guoling Han) Date: Mon, 22 Jan 2007 18:17:37 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/SSAtest.c arith.c array.c bigint.c bitbit.c bitlogic.c cppfield.cpp enum.cpp exception.cpp extern-inline-redef.c field.c folding.c global.c large-array.c list.c local-array.c local-union.c matrix.c memory.c offset.c override.cpp pointer.c static.c struct1.c struct2.c structInit.c switch.c template.cpp template2.cpp template3.cpp union-init.c union-struct.c union2.c Message-ID: <200701230017.l0N0Hbqk021127@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: SSAtest.c updated: 1.5 -> 1.6 arith.c updated: 1.5 -> 1.6 array.c updated: 1.5 -> 1.6 bigint.c updated: 1.5 -> 1.6 bitbit.c updated: 1.5 -> 1.6 bitlogic.c updated: 1.5 -> 1.6 cppfield.cpp updated: 1.3 -> 1.4 enum.cpp updated: 1.5 -> 1.6 exception.cpp updated: 1.4 -> 1.5 extern-inline-redef.c updated: 1.5 -> 1.6 field.c updated: 1.4 -> 1.5 folding.c updated: 1.4 -> 1.5 global.c updated: 1.4 -> 1.5 large-array.c updated: 1.5 -> 1.6 list.c updated: 1.5 -> 1.6 local-array.c updated: 1.5 -> 1.6 local-union.c updated: 1.5 -> 1.6 matrix.c updated: 1.6 -> 1.7 memory.c updated: 1.5 -> 1.6 offset.c updated: 1.5 -> 1.6 override.cpp updated: 1.5 -> 1.6 pointer.c updated: 1.5 -> 1.6 static.c updated: 1.4 -> 1.5 struct1.c updated: 1.5 -> 1.6 struct2.c updated: 1.5 -> 1.6 structInit.c updated: 1.5 -> 1.6 switch.c updated: 1.5 -> 1.6 template.cpp updated: 1.6 -> 1.7 template2.cpp updated: 1.4 -> 1.5 template3.cpp updated: 1.5 -> 1.6 union-init.c updated: 1.5 -> 1.6 union-struct.c updated: 1.5 -> 1.6 union2.c updated: 1.4 -> 1.5 --- Log message: Change the files to make them fit the required coding style --- Diffs of the changes: (+665 -647) SSAtest.c | 12 ++- arith.c | 19 ++--- array.c | 50 +++++++-------- bigint.c | 36 +++++------ bitbit.c | 27 ++++---- bitlogic.c | 25 +++---- cppfield.cpp | 59 +++++++++--------- enum.cpp | 30 ++++----- exception.cpp | 59 ++++++++---------- extern-inline-redef.c | 14 ++-- field.c | 44 +++++++------ folding.c | 56 +++++++++-------- global.c | 36 +++++------ large-array.c | 63 ++++++++++--------- list.c | 70 +++++++++++----------- local-array.c | 26 ++++---- local-union.c | 24 +++---- matrix.c | 159 ++++++++++++++++++++++++-------------------------- memory.c | 46 +++++++------- offset.c | 18 ++--- override.cpp | 19 +++-- pointer.c | 28 +++++--- static.c | 34 +++++----- struct1.c | 17 ++--- struct2.c | 15 ++-- structInit.c | 20 +++--- switch.c | 49 +++++++-------- template.cpp | 59 +++++++++--------- template2.cpp | 58 +++++++++--------- template3.cpp | 44 +++++++------ union-init.c | 39 +++++------- union-struct.c | 23 +++---- union2.c | 34 +++++----- 33 files changed, 665 insertions(+), 647 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/SSAtest.c diff -u llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.5 llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/SSAtest.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/SSAtest.c Mon Jan 22 18:17:21 2007 @@ -1,14 +1,16 @@ //===--- SSAtest.c --- Test Cases for Bit Accurate Types ------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // Adopted the test from previous test-cases. Changed it with // non-regular int data type. // //===----------------------------------------------------------------------===// + + #include typedef int __attribute__ ((bitwidth(4))) int4; @@ -32,6 +34,6 @@ int main() { - foo(); - return 0; + foo(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/arith.c diff -u llvm-test/SingleSource/UnitTests/Integer/arith.c:1.5 llvm-test/SingleSource/UnitTests/Integer/arith.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/arith.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/arith.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- arith.c --- Test Cases for Bit Accurate Types --------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a general test for arithmetic operations. @@ -16,9 +16,8 @@ int21 x = 0x1fffff; int21 y = 0x0fffff; -// Module | Test -// Thread: int my_test(); -int my_test(){ + +int my_test() { uint10 i = 0; int10 j; @@ -72,12 +71,12 @@ i_temp = ui_x - ui_y; printf("i_temp = %x\n", i_temp); return 0; -} + } int main() { - my_test(); - return 0; + my_test(); + return 0; } -// End of Module | Test + Index: llvm-test/SingleSource/UnitTests/Integer/array.c diff -u llvm-test/SingleSource/UnitTests/Integer/array.c:1.5 llvm-test/SingleSource/UnitTests/Integer/array.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/array.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/array.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- array.c --- Test Cases for Bit Accurate Types --------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a general test for array data types. @@ -15,37 +15,37 @@ typedef enum bool{false=0, true=1} bool; int my_test(){ -{ - int33 array[8]; - unsigned int i = 0; - long long tmp; { - i = 0; - for ( ; ; ) { - bool ssdm_tmp_1 = (i < 8); - if (!ssdm_tmp_1) break; + int33 array[8]; + unsigned int i = 0; + long long tmp; { - array[i] = -(i + 1); - tmp = array[i]; - printf("i=%u: %x\n", i, tmp); + i = 0; + for ( ; ; ) { + bool ssdm_tmp_1 = (i < 8); + if (!ssdm_tmp_1) break; + { + array[i] = -(i + 1); + tmp = array[i]; + printf("i=%u: %x\n", i, tmp); + } + ++i; + } } - ++i; - } + int33* ptr; + ptr = &array[7]; + *ptr = array[1] % array[0]; + tmp = *ptr; + printf("%x\n", tmp); + return 0; } - int33* ptr; - ptr = &array[7]; - *ptr = array[1] % array[0]; - tmp = *ptr; - printf("%x\n", tmp); - return 0; -} } int main() { - my_test(); - return 0; + my_test(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/bigint.c diff -u llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.5 llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bigint.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- bigint.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a general test for big integer type. @@ -16,12 +16,10 @@ const uint10 bnd = 1023; -int169 x = 0xffffffff; +int169 x = 0xffffffffULL; +int169 y = -0xabcdefdeULL; -int169 y = -0xabcdefde; -// Module | Test -// Thread: int my_test(); -int my_test(){ +int my_test() { uint10 i = 0; int169 result; @@ -29,17 +27,17 @@ long long rem; long long rem2; { - ;/*NULL statement*/ - for ( ; ; ) { - bool ssdm_tmp_1 = (i < bnd); - if (!ssdm_tmp_1) break; - if (i % 2 == 0) + ; + for ( ; ; ) { + bool ssdm_tmp_1 = (i < bnd); + if (!ssdm_tmp_1) break; + if (i % 2 == 0) x = x + 1; - else - y = y - x; + else + y = y - x; - ++i; - } + ++i; + } } result = x*y; l_result = result % 0x37015; @@ -54,8 +52,8 @@ int main() { - my_test(); - return 0; + my_test(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/bitbit.c diff -u llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.5 llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/bitbit.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bitbit.c Mon Jan 22 18:17:21 2007 @@ -1,18 +1,19 @@ //===--- bitbit.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a general test for bit operations. // //===----------------------------------------------------------------------===// + #include "bitbit.h" #include -int my_test(){ +int my_test() { int21 x = 0x1fffff; int21 y = 0x0fffff; @@ -27,27 +28,27 @@ result = x & y; if (result == y) printf("ok\n"); - else + else printf("fail\n"); result = x | y; if (result == x) printf("ok\n"); - else + else printf("fail\n"); result = x; result &= y; if (result == y) printf("ok\n"); - else + else printf("fail\n"); result = x; result |= y; if (result == x) printf("ok\n"); - else + else printf("fail\n"); result = x >> 20; @@ -58,7 +59,7 @@ result += 1; if (result != x) printf("fail\n"); - else + else printf("ok\n"); result = y; @@ -67,17 +68,17 @@ if (result != x) printf("fail\n"); - else + else printf("ok\n"); } return 0; -} + } int main() { - my_test(); - return 0; + my_test(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/bitlogic.c diff -u llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.5 llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/bitlogic.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bitlogic.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- bitlogic.c --- Test Cases for Bit Accurate Types -----------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a general test for logical operations. @@ -12,9 +12,8 @@ #include "bitlogic.h" #include -// Module | Test -// Thread: int my_test(); -int my_test(){ + +int my_test() { uint1 x = 0x1; uint1 y; @@ -25,32 +24,32 @@ y -= 1; if (!y) printf("ok\n"); - else + else printf("fail\n"); if (y > x) printf("fail\n"); - else + else printf("ok\n"); if (z != uz) printf("ok\n"); - else + else printf("fail\n"); temp = z; if (temp <= uz) printf("ok\n"); - else + else printf("fail\n"); return 0; -} + } int main() { - my_test(); - return 0; + my_test(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.3 llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.4 --- llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp:1.3 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/cppfield.cpp Mon Jan 22 18:17:21 2007 @@ -1,54 +1,57 @@ //===-- cppfield.cpp - Test C++ Fields With Bit Accurate Types ------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// +// This is a test for conversion between different int types. // +//===----------------------------------------------------------------------===// + + #include + typedef unsigned int __attribute__ ((bitwidth(7))) int7; typedef unsigned int __attribute__ ((bitwidth(17))) int17; typedef unsigned int __attribute__ ((bitwidth(32))) int32; typedef unsigned int __attribute__ ((bitwidth(8))) int8; class myStruct{ - public: - int i; - unsigned char c :7; - int s: 17; - char c2; + public: + int i; + unsigned char c:7; + int s:17; + char c2; }; class myStruct2{ - public: - int32 i; - int7 c; - int17 s; - int8 c2; + public: + int32 i; + int7 c; + int17 s; + int8 c2; }; int main() { - myStruct x; - myStruct2 y; - - char* ptrc, *ptrc1, *ptrc2, *ptrc3; - unsigned int offset, offset1; + myStruct x; + myStruct2 y; - ptrc = (char*)&(x.i); - ptrc1 = (char*)&(x.c2); + char* ptrc, *ptrc1, *ptrc2, *ptrc3; + unsigned int offset, offset1; - + ptrc = (char*)&(x.i); + ptrc1 = (char*)&(x.c2); - ptrc2 = (char*)&(y.i); - ptrc3 = (char*)&(y.c2); + ptrc2 = (char*)&(y.i); + ptrc3 = (char*)&(y.c2); - offset = ptrc1 - ptrc; - offset1 = ptrc3 - ptrc2; + offset = ptrc1 - ptrc; + offset1 = ptrc3 - ptrc2; - if(offset != offset1 || sizeof(myStruct) != sizeof(myStruct2)) - printf("error\n"); + if(offset != offset1 || sizeof(myStruct) != sizeof(myStruct2)) + printf("error\n"); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/enum.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.5 llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.6 --- llvm-test/SingleSource/UnitTests/Integer/enum.cpp:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/enum.cpp Mon Jan 22 18:17:21 2007 @@ -1,34 +1,34 @@ //===--- enum.cpp --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test of bitwidth attribute with enum data. // //===----------------------------------------------------------------------===// + + #include class myClass { - public: - enum X {R= 0x1, G=0x100, B=0x1ff} __attribute__ ((bitwidth(9))) x; - - void set_X(enum X t) {x = t;} - - enum X get_X(void) {return x;} + public: + enum X {R= 0x1, G=0x100, B=0x1ff} __attribute__ ((bitwidth(9))) x; + void set_X(enum X t) { x = t; } + enum X get_X(void) { return x; } }; int main() { - myClass c; - c.set_X(myClass::B); - c.set_X((myClass::X)0x2ff); - int i = (int)c.get_X(); - printf("%x\n", i); + myClass c; + c.set_X(myClass::B); + c.set_X((myClass::X)0x2ff); + int i = (int)c.get_X(); + printf("%x\n", i); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/exception.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.4 llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.5 --- llvm-test/SingleSource/UnitTests/Integer/exception.cpp:1.4 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/exception.cpp Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- exception.cpp --- Test Cases for Bit Accurate Types --------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test of exception handling with non-regular data @@ -10,7 +10,9 @@ // //===----------------------------------------------------------------------===// + #include + typedef int __attribute__ ((bitwidth(31))) int31; typedef int __attribute__ ((bitwidth(1))) int1; typedef int __attribute__ ((bitwidth(7))) int7; @@ -20,39 +22,30 @@ double throw_test(double x, int31 y) { - if(y==0) - throw ex_num; - - - if(y==1) - throw (int1)true; - - if(y==2) - throw (int7)2; - - if(y == 3) - throw (int17)3; - - return x; + if(y==0) + throw ex_num; + if(y==1) + throw (int1)true; + if(y==2) + throw (int7)2; + if(y == 3) + throw (int17)3; + return x; } int main() { - try{ - throw_test(10, 3); - } - catch(int31 i){ - printf("int31 branch\n"); - } - catch(int1 b){ - printf("int1 branch\n"); - } - catch(int7 c){ - printf("int7 branch\n"); - } - catch(int17 s){ - printf("int17 branch\n"); - } + try{ + throw_test(10, 3); + } catch(int31 i){ + printf("int31 branch\n"); + } catch(int1 b){ + printf("int1 branch\n"); + } catch(int7 c){ + printf("int7 branch\n"); + } catch(int17 s){ + printf("int17 branch\n"); + } - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c diff -u llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.5 llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/extern-inline-redef.c Mon Jan 22 18:17:21 2007 @@ -1,30 +1,32 @@ //===--- extern_inline_redef.c --- Test Cases for Bit Accurate Types ------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // this is used to test redefining inline function. // //===----------------------------------------------------------------------===// + + #include typedef int __attribute__ ((bitwidth(61))) int61; extern __inline int61 -__strtol_l (int a) + __strtol_l (int a) { return 0; } int61 -__strtol_l (int a) + __strtol_l (int a) { return 0; } int main() { - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/field.c diff -u llvm-test/SingleSource/UnitTests/Integer/field.c:1.4 llvm-test/SingleSource/UnitTests/Integer/field.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/field.c:1.4 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/field.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- field.c --- Test Cases for Bit Accurate Types --------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is used to test struct with field specifier. We suppose the @@ -10,7 +10,11 @@ // struct using bit accurate types. // //===----------------------------------------------------------------------===// + + #include + + typedef int __attribute__ ((bitwidth(7))) int7; typedef int __attribute__ ((bitwidth(17))) int17; typedef int __attribute__ ((bitwidth(32))) int32; @@ -26,28 +30,26 @@ int main() { - myStruct x; - myStruct2 y; + myStruct x; + myStruct2 y; - void* ptr, *ptr1, *ptr2, *ptr3; - unsigned int offset, offset1; + void* ptr, *ptr1, *ptr2, *ptr3; + unsigned int offset, offset1; - // printf("sizeof(int7) = %d, sizeof(int17) = %d, sizeof(int33) = %d\n", - // sizeof(char7), sizeof(short17), sizeof(long33)); - ptr = &(x.i); - ptr1 = &(x.c2); + ptr = &(x.i); + ptr1 = &(x.c2); - ptr2 = &(y.i); - ptr3 = &(y.c2); + ptr2 = &(y.i); + ptr3 = &(y.c2); - offset = ptr1 - ptr; - offset1 = ptr3 - ptr2; + offset = ptr1 - ptr; + offset1 = ptr3 - ptr2; - if(offset != offset1) - printf("error: offset=%x, offset1=%x\n", offset, offset1); - if(sizeof(myStruct) != sizeof(myStruct2)) - printf("error2: sizeof myStruct = %d, sizeof myStruct2 = %d\n", - sizeof(myStruct), sizeof(myStruct2)); + if(offset != offset1) + printf("error: offset=%x, offset1=%x\n", offset, offset1); + if(sizeof(myStruct) != sizeof(myStruct2)) + printf("error2: sizeof myStruct = %d, sizeof myStruct2 = %d\n", + sizeof(myStruct), sizeof(myStruct2)); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/folding.c diff -u llvm-test/SingleSource/UnitTests/Integer/folding.c:1.4 llvm-test/SingleSource/UnitTests/Integer/folding.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/folding.c:1.4 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/folding.c Mon Jan 22 18:17:21 2007 @@ -1,15 +1,17 @@ -//===--- folding.c --- Test Cases for Bit Accurate Types ------------------===// +//===--- folding.c --- Test Cases for Bit Accurate Types ------------------===//// +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. //===----------------------------------------------------------------------===// // // This is used to test constant folding optimization. // //===----------------------------------------------------------------------===// + #include + + typedef int __attribute__ ((bitwidth(7))) int7; typedef unsigned int __attribute__ ((bitwidth(7))) uint7; typedef int __attribute__ ((bitwidth(15))) int15; @@ -19,29 +21,29 @@ int main() { - int7 x; - int7 y; - int15 z; - uint7 u; + int7 x; + int7 y; + int15 z; + uint7 u; - x = myConst << 3; // constant 8 - y = x + myConst; // constant 9 - if(y -x != 1) - printf("error1: x = %d, y = %d\n", x, y); - - x = myConst << 7; // constant 0 - if(y -x != 9) - printf("error2: x = %d, y = %d\n", x, y); - - z = (int15) y; - z &= myConst2; - if(z != 0x9) - printf("error3: x = %d, y = %d\n", x, y); - - u = 0x7f; - u = u + (uint7)myConst; - if(u != 0) - printf("error4: x = %d, y = %d\n", x, y); + x = myConst << 3; // constant 8 + y = x + myConst; // constant 9 + if(y -x != 1) + printf("error1: x = %d, y = %d\n", x, y); + + x = myConst << 7; // constant 0 + if(y -x != 9) + printf("error2: x = %d, y = %d\n", x, y); + + z = (int15) y; + z &= myConst2; + if(z != 0x9) + printf("error3: x = %d, y = %d\n", x, y); + + u = 0x7f; + u = u + (uint7)myConst; + if(u != 0) + printf("error4: x = %d, y = %d\n", x, y); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/global.c diff -u llvm-test/SingleSource/UnitTests/Integer/global.c:1.4 llvm-test/SingleSource/UnitTests/Integer/global.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/global.c:1.4 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/global.c Mon Jan 22 18:17:21 2007 @@ -1,15 +1,18 @@ //===--- global.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is used to test global arrays. // //===----------------------------------------------------------------------===// + #include + + typedef int __attribute__ ((bitwidth(7))) int7; typedef int __attribute__ ((bitwidth(14))) int14; @@ -18,22 +21,21 @@ void test() { - int i = 0; - int j = 0; - for(i=0; i<4; ++i) - for(j=0; j<4; ++j) - { - array2[i][j] = array[i] * array[j]; - if(array2[i][j] <= 0) - printf("error: i=%d, j=%d, result = %d\n", i, j, array2[i][j]); - } + int i = 0; + int j = 0; + for(i=0; i<4; ++i) + for(j=0; j<4; ++j){ + array2[i][j] = array[i] * array[j]; + if(array2[i][j] <= 0) + printf("error: i=%d, j=%d, result = %d\n", i, j, array2[i][j]); + } } int main() { - int7 a = 127; - int7 b = 100; - printf("a=%d b=%d a*a=%d\n",a, b, a*a); - test(); - return 0; + int7 a = 127; + int7 b = 100; + printf("a=%d b=%d a*a=%d\n",a, b, a*a); + test(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/large-array.c diff -u llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.5 llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/large-array.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/large-array.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- large-array.c --- Test Cases for Bit Accurate Types --------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is used to test large local arrays. Some local arrays are @@ -16,40 +16,41 @@ typedef int __attribute__ ((bitwidth(13))) int13; -int13 test(int13 x) { +int13 test(int13 x) +{ const int13 XX[1000] = { 0, 0 }; const char S [1000] = "foo"; const int13 array[] = { - 17, 53, 523, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, - }; - return array[x]; + 17, 53, 523, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, 17, 23, 123, 123, 49, + }; + return array[x]; } int main() { - if(test(1) != 53) - printf("error\n"); - if(test(2) != 523) - printf("error2\n"); - return 0; + if(test(1) != 53) + printf("error\n"); + if(test(2) != 523) + printf("error2\n"); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/list.c diff -u llvm-test/SingleSource/UnitTests/Integer/list.c:1.5 llvm-test/SingleSource/UnitTests/Integer/list.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/list.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/list.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- list.c --- Test Cases for Bit Accurate Types ---------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for simple linked list operation. Data are added to @@ -39,44 +39,44 @@ void test() { - unsigned int i=0; - unsigned int cnt = sizeof(array)/sizeof(*array); + unsigned int i=0; + unsigned int cnt = sizeof(array)/sizeof(*array); - myList* head = 0; + myList* head = 0; - for(i; inext = head; - head = elem; - (*elem).s.x = array[i]; - (*elem).s.y = array[i] - 1; - } - - - i = 0; - while(head) - { - myList* tmp; - i+=1; - if(head->s.x != array[64*3 - i]) - printf("error: i = %d, x = %d, array = %d\n", - i,head->s.x, array[64*3 - i]); - if( (head->s.y ^ (int7)((array[64*3 - i] - 1)&0x7f)) != 0 ) - printf("error: i = %d, y = %hhd, expected = %hhd\n", - i, (unsigned char)(head->s.y), ((array[64*3 - i] - 1)&0x7f)); - //remove from the list - tmp = head; - head = head->next; - free(tmp); - } + for(i; inext = head; + head = elem; + (*elem).s.x = array[i]; + (*elem).s.y = array[i] - 1; + } + + + i = 0; + while(head) + { + myList* tmp; + i+=1; + if(head->s.x != array[64*3 - i]) + printf("error: i = %d, x = %d, array = %d\n", + i,head->s.x, array[64*3 - i]); + if( (head->s.y ^ (int7)((array[64*3 - i] - 1)&0x7f)) != 0 ) + printf("error: i = %d, y = %hhd, expected = %hhd\n", + i, (unsigned char)(head->s.y), ((array[64*3 - i] - 1)&0x7f)); + //remove from the list + tmp = head; + head = head->next; + free(tmp); + } } int main() { - test(); - return 0; + test(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/local-array.c diff -u llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.5 llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/local-array.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/local-array.c Mon Jan 22 18:17:21 2007 @@ -1,13 +1,15 @@ //===--- local-array.c --- Test Cases for Bit Accurate Types --------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is another test for local arrays. // //===----------------------------------------------------------------------===// + + #include typedef int __attribute__ ((bitwidth(4))) int4; @@ -15,20 +17,20 @@ int4 test(int6 X) { int4 student_t[32]={0 , 12 , 4 , 3 , 2 , 2 , - 2 , 2 , 2 , 2 , 2 , - 2 , 2 , 2 , 2 , 2 , - 2 , 2 , 2 , 2 , 2 , - 2 , 2 , 2 , 2 , 2 , - 2 , 2 , 2 , 2, 3, 4 }; + 2 , 2 , 2 , 2 , 2 , + 2 , 2 , 2 , 2 , 2 , + 2 , 2 , 2 , 2 , 2 , + 2 , 2 , 2 , 2 , 2 , + 2 , 2 , 2 , 2, 3, 4 }; return student_t[X]; } int main() { - int4 result = test(31); - if(result != 4) - printf("error: return = %d\n", result); + int4 result = test(31); + if(result != 4) + printf("error: return = %d\n", result); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/local-union.c diff -u llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.5 llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/local-union.c:1.5 Mon Jan 22 15:04:54 2007 +++ llvm-test/SingleSource/UnitTests/Integer/local-union.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- local-union.c --- Test Cases for Bit Accurate Types --------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for local union data type. @@ -15,19 +15,17 @@ union foo { int X; int33 Y;}; -double test(union foo* F) { - { - union foo { float X; int33 Y;} A; - A.Y = 0x1ffffffffULL; - return A.X; - } +double test(union foo* F) +{ + union foo { float X; int33 Y;} A; + A.Y = 0x1ffffffffULL; + return A.X; } int main() { - union foo F; + union foo F; - printf("return = %f\n", test(&F)); - - return 0; + printf("return = %f\n", test(&F)); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/matrix.c diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.6 llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.6 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- matrix.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for matrix with non-regular bitwidth data. In @@ -11,60 +11,57 @@ // two largest elements are used to get the gcd. // //===----------------------------------------------------------------------===// + + #include "matrix.h" #include #include typedef enum bool{false=0, true=1} bool; - - - - - void mysort(const int17 X[8], int17 Y[8]) { - unsigned int i, j; - int17 temp; - { - j = 0; - for ( ; ; ) { - bool ssdm_tmp_4 = (j < 8); - if (!ssdm_tmp_4) break; - Y[j] = X[j]; - j++; - } + unsigned int i, j; + int17 temp; + { + j = 0; + for ( ; ; ) { + bool ssdm_tmp_4 = (j < 8); + if (!ssdm_tmp_4) break; + Y[j] = X[j]; + j++; } - { - j = 0; - for ( ; ;j++ ) { - bool ssdm_tmp_5 = (j < 8); - if (!ssdm_tmp_5) break; - { - i = j; - for ( ; ; i++) { - bool ssdm_tmp_6 = (i < 8); - if (!ssdm_tmp_6) break; - { - if(Y[i]>Y[j]){ - temp = Y[j]; - Y[j] = Y[i]; - Y[i] = temp; - } - - } - } + } + { + j = 0; + for ( ; ;j++ ) { + bool ssdm_tmp_5 = (j < 8); + if (!ssdm_tmp_5) break; + { + i = j; + for ( ; ; i++) { + bool ssdm_tmp_6 = (i < 8); + if (!ssdm_tmp_6) break; + { + if(Y[i]>Y[j]){ + temp = Y[j]; + Y[j] = Y[i]; + Y[i] = temp; } - + + } } + } + } + } } int get_gcd(const int a, const int b) { - if (b == 0) + if (b == 0) return a; return get_gcd( b, a % b ); @@ -74,44 +71,44 @@ int my_test(int17 A[8][8], int17 B[8][8]) { - unsigned int i, j, k, dd; - int17 C[8][8]; - int17 D[8]; - int t; - { - i = 0; + unsigned int i, j, k, dd; + int17 C[8][8]; + int17 D[8]; + int t; + { + i = 0; + for ( ; ; ) { + bool ssdm_tmp_1 = (i < 8); + if (!ssdm_tmp_1) break; + { + j = 0; for ( ; ; ) { - bool ssdm_tmp_1 = (i < 8); - if (!ssdm_tmp_1) break; + bool ssdm_tmp_2 = (j < 8); + if (!ssdm_tmp_2) break; + { { - j = 0; - for ( ; ; ) { - bool ssdm_tmp_2 = (j < 8); - if (!ssdm_tmp_2) break; - { - { - C[i][j] = 0; - k = 0; - for ( ; ; ) { - bool ssdm_tmp_3 = (k < 8); - if (!ssdm_tmp_3) break; - C[i][j] += A[i][k] * B[k][j]; - ++k; - } - } + C[i][j] = 0; + k = 0; + for ( ; ; ) { + bool ssdm_tmp_3 = (k < 8); + if (!ssdm_tmp_3) break; + C[i][j] += A[i][k] * B[k][j]; + ++k; + } + } - } + } - ++j; - } - } - mysort(C[i], D); - t = get_gcd(D[0], D[1]); - printf("get_gcd(%d, %d) = %d\n", D[0], D[1], t); - ++i; + ++j; } + } + mysort(C[i], D); + t = get_gcd(D[0], D[1]); + printf("get_gcd(%d, %d) = %d\n", D[0], D[1], t); + ++i; } - return 0; + } + return 0; } @@ -119,19 +116,19 @@ int main() { - int i, j; + int i, j; - int17 X[8][8]; - int17 Y[8][8]; + int17 X[8][8]; + int17 Y[8][8]; - for(i=0; i<8; i++) - for(j=0; j<8; j++){ - X[i][j] = (i+1) * (j + 79); - Y[i][j] = (i-1) * (j + 255); - } - my_test(X, Y); + for(i=0; i<8; i++) + for(j=0; j<8; j++){ + X[i][j] = (i+1) * (j + 79); + Y[i][j] = (i-1) * (j + 255); + } + my_test(X, Y); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/memory.c diff -u llvm-test/SingleSource/UnitTests/Integer/memory.c:1.5 llvm-test/SingleSource/UnitTests/Integer/memory.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/memory.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/memory.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- memory.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for memory malloc and free operations. It tests @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// + #include #include @@ -20,34 +21,33 @@ void mem_test(int31 num) { - int inum = num; - unsigned int i = 0; + int inum = num; + unsigned int i = 0; - int31* array = (int31*) malloc(sizeof(int31) * inum); - for(i=0; i< num; ++i) - { - array[i] = i; - } + int31* array = (int31*) malloc(sizeof(int31) * inum); + for(i=0; i< num; ++i){ + array[i] = i; + } - free(array); + free(array); } void mem_test2() { - myStruct* ptr = malloc(sizeof(myStruct)); - ptr->y = 0; - if(ptr->y != 0) - printf("error\n"); - ptr->x = ++(ptr->y); - ptr->x *= 2; - if(ptr->x - ptr->y != 1) - printf("error\n"); - free(ptr); + myStruct* ptr = malloc(sizeof(myStruct)); + ptr->y = 0; + if(ptr->y != 0) + printf("error\n"); + ptr->x = ++(ptr->y); + ptr->x *= 2; + if(ptr->x - ptr->y != 1) + printf("error\n"); + free(ptr); } int main() { - mem_test(0xff); - mem_test2(); - return 0; + mem_test(0xff); + mem_test2(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/offset.c diff -u llvm-test/SingleSource/UnitTests/Integer/offset.c:1.5 llvm-test/SingleSource/UnitTests/Integer/offset.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/offset.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/offset.c Mon Jan 22 18:17:21 2007 @@ -1,29 +1,27 @@ //===--- offset.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for data size calculation with non-regular integral type. // //===----------------------------------------------------------------------===// + #include typedef int __attribute__ ((bitwidth(33))) int33; -struct s { - int33 field[0]; -}; +struct s { int33 field[0]; }; -#define OFFS \ - (((char *) &((struct s *) 0)->field[1]) - (char *) 0) +#define OFFS (((char *) &((struct s *) 0)->field[1]) - (char *) 0) int foo[OFFS]; int main() { - printf("%d\n", OFFS); - return 0; + printf("%d\n", OFFS); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/override.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.5 llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.6 --- llvm-test/SingleSource/UnitTests/Integer/override.cpp:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/override.cpp Mon Jan 22 18:17:21 2007 @@ -1,30 +1,33 @@ //===--- override.cpp --- Test Cases for Bit Accurate Types ---------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test of override test. // //===----------------------------------------------------------------------===// + + #include + typedef int __attribute__ ((bitwidth(31))) int31; typedef int __attribute__ ((bitwidth(32))) int32; void func(int32 i) { - printf("call func with int32: %d\n", (int)i); + printf("call func with int32: %d\n", (int)i); } void func(int31 s) { - printf("call func with int31: %d\n", (int)s); + printf("call func with int31: %d\n", (int)s); } int main() { - func( (int31) 1); - func( (int32) 2); - return 0; + func( (int31) 1); + func( (int32) 2); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/pointer.c diff -u llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.5 llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/pointer.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/pointer.c Mon Jan 22 18:17:21 2007 @@ -1,36 +1,40 @@ //===--- pointer.c --- Test Cases for Bit Accurate Types ------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for address calculation with non-regular integral type. // //===----------------------------------------------------------------------===// + + #include typedef int __attribute__ ((bitwidth(3))) int3; typedef int __attribute__ ((bitwidth(31))) int31; -int3 *test(int3* C) { +int3 *test(int3* C) +{ return C-1; } -int31 *test2(int31* I) { +int31 *test2(int31* I) +{ return I-1; } int main() { - int3 i3; - int31 i31; + int3 i3; + int31 i31; - if(&i3 != (test(&i3) + 1)) - printf("error\n"); + if(&i3 != (test(&i3) + 1)) + printf("error\n"); - if(&i31 != (test2(&i31)+1)) - printf("error2: &i31=%p, ret = %p\n", &i31, test2(&i31)); + if(&i31 != (test2(&i31)+1)) + printf("error2: &i31=%p, ret = %p\n", &i31, test2(&i31)); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/static.c diff -u llvm-test/SingleSource/UnitTests/Integer/static.c:1.4 llvm-test/SingleSource/UnitTests/Integer/static.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/static.c:1.4 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/static.c Mon Jan 22 18:17:21 2007 @@ -1,34 +1,36 @@ //===--- static.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for static data with non-regular integral data. // //===----------------------------------------------------------------------===// + + #include -typedef int __attribute__ ((bitwidth(31))) int31; +typedef int __attribute__ ((bitwidth(31))) int31; int31 test(int31 y, int31* z) { - static int31 x = 0; - *z = x; - x = y; - return x; + static int31 x = 0; + *z = x; + x = y; + return x; } int main() { - int31 a, b; - a = test(1, &b); - if(b != 0 || a != 1) - printf("error\n"); - a = test(-1, &b); - if(b != 1 || a != -1) - printf("error\n"); - return 0; + int31 a, b; + a = test(1, &b); + if(b != 0 || a != 1) + printf("error\n"); + a = test(-1, &b); + if(b != 1 || a != -1) + printf("error\n"); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/struct1.c diff -u llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.5 llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/struct1.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/struct1.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- struct1.c --- Test Cases for Bit Accurate Types ------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for struct data structure. If the data layout for @@ -11,13 +11,12 @@ // //===----------------------------------------------------------------------===// -#include +#include typedef int __attribute__ ((bitwidth(33))) int33; struct foo A; - struct foo { int33 x; double D; @@ -25,9 +24,9 @@ int main() { - A.D = -3.141593; - A.x = -1; - printf("%f\n", A.D); + A.D = -3.141593; + A.x = -1; + printf("%f\n", A.D); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/struct2.c diff -u llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.5 llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/struct2.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/struct2.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- struct2.c --- Test Cases for Bit Accurate Types ------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for struct data structure. We test the nested structure @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// + #include typedef int __attribute__ ((bitwidth(33))) int33; @@ -34,9 +35,9 @@ int main() { - assign(); - if(G.pInfo != G.info) - printf("error\n"); + assign(); + if(G.pInfo != G.info) + printf("error\n"); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/structInit.c diff -u llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.5 llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/structInit.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/structInit.c Mon Jan 22 18:17:21 2007 @@ -1,22 +1,24 @@ //===--- structInit.c --- Test Cases for Bit Accurate Types ---------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for struct data structure with initialization. // //===----------------------------------------------------------------------===// + + #include typedef int __attribute__ ((bitwidth(31))) int31; typedef int __attribute__ ((bitwidth(24))) int24; typedef struct Connection_Type { - int24 to; + int24 to; char type[10]; - int31 length; + int31 length; } Connection; Connection link[3] @@ -27,9 +29,9 @@ int main() { - int24 l; - for(l=0; l<3; l++) - printf("%d, %s, %d\n", link[l].to, link[l].type, link[l].length); + int24 l; + for(l=0; l<3; l++) + printf("%d, %s, %d\n", link[l].to, link[l].type, link[l].length); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/switch.c diff -u llvm-test/SingleSource/UnitTests/Integer/switch.c:1.5 llvm-test/SingleSource/UnitTests/Integer/switch.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/switch.c:1.5 Mon Jan 22 15:06:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/switch.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- switch.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for switch statement. The switch value is a @@ -10,6 +10,8 @@ // argument c. // //===----------------------------------------------------------------------===// + + #include typedef unsigned int __attribute__ ((bitwidth(7))) int7; @@ -21,31 +23,30 @@ int3 test(int3 c) { - switch(c){ - case 0: return seven >> 3; - case 1: return seven >>2; - case 2: return (seven >> 1) & 2; - case 3: return (seven >> 1); - case 4: return seven & 4; - case 5: return seven & 5; - case 6: return seven & 6; - case 7: return seven; - default: printf("error\n"); return -1; - } - return 0; + switch(c){ + case 0: return seven >> 3; + case 1: return seven >>2; + case 2: return (seven >> 1) & 2; + case 3: return (seven >> 1); + case 4: return seven & 4; + case 5: return seven & 5; + case 6: return seven & 6; + case 7: return seven; + default: printf("error\n"); return -1; + } + return 0; } int main() { - unsigned char c; - unsigned char i; + unsigned char c; + unsigned char i; - for(i=0; i< ((unsigned char)zero) + 8; i++) - { - c = (unsigned char)test((int3)i); - if(c != i) - printf("error: i=%hhd, c=%hhd\n", i, c); - } - return 0; + for(i=0; i< ((unsigned char)zero) + 8; i++){ + c = (unsigned char)test((int3)i); + if(c != i) + printf("error: i=%hhd, c=%hhd\n", i, c); + } + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/template.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.6 llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.7 --- llvm-test/SingleSource/UnitTests/Integer/template.cpp:1.6 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template.cpp Mon Jan 22 18:17:21 2007 @@ -1,55 +1,56 @@ //===--- template.cpp --- Test Cases for Bit Accurate Types ---------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for template functions. // //===----------------------------------------------------------------------===// + #include typedef int __attribute__ ((bitwidth(4))) int4; typedef unsigned int __attribute__ ((bitwidth(5))) int5; template -T& min(T &tParam1, T &tParam2) + T& min(T &tParam1, T &tParam2) { - if(tParam1 < tParam2) - return tParam1; - else - return tParam2; + if(tParam1 < tParam2) + return tParam1; + else + return tParam2; } template -T& min(T &tParam1, T &tParam2, T &tParam3) + T& min(T &tParam1, T &tParam2, T &tParam3) { - if(min(tParam1, tParam2) < tParam3) - return min(tParam1, tParam2) ; - else - return tParam3; + if(min(tParam1, tParam2) < tParam3) + return min(tParam1, tParam2) ; + else + return tParam3; } int main() { - int4 x , y, z; + int4 x , y, z; - x = 12; - y = 2; - z = 7; - - int m = min(x, y); - printf("min = %d\n", m); - - m = min(x, y, z); - printf("min = %d\n", m); - - int5 f, g; - f = 0x1f; - g = 0x0f; + x = 12; + y = 2; + z = 7; + + int m = min(x, y); + printf("min = %d\n", m); + + m = min(x, y, z); + printf("min = %d\n", m); + + int5 f, g; + f = 0x1f; + g = 0x0f; - m = min(f, g); - printf("min = %x\n", m); + m = min(f, g); + printf("min = %x\n", m); } Index: llvm-test/SingleSource/UnitTests/Integer/template2.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.4 llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.5 --- llvm-test/SingleSource/UnitTests/Integer/template2.cpp:1.4 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template2.cpp Mon Jan 22 18:17:21 2007 @@ -1,63 +1,65 @@ //===--- template2.cpp --- Test Cases for Bit Accurate Types --------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for template classes. // //===----------------------------------------------------------------------===// + + #include typedef int __attribute__ ((bitwidth(26))) int26; template -class MyQueue -{ + class MyQueue + { T data[128]; unsigned int idx; - public: + public: MyQueue(): idx(0){} - void Add(T const &); - void Remove(); - void Print(); -}; + void Add(T const &); + void Remove(); + void Print(); + }; template void MyQueue ::Add(T const &d) { - if(idx < 128 ){ - data[idx] = d; - idx += 1; - } + if(idx < 128 ){ + data[idx] = d; + idx += 1; + } } template void MyQueue::Remove() { - if(idx != 0) - idx -= 1; + if(idx != 0) + idx -= 1; } template void MyQueue::Print() { - for(unsigned int i = 0; i< idx; i++){ - int m = data[i]; - printf("%d, ", m); - } - printf("\n"); + for(unsigned int i = 0; i< idx; i++){ + int m = data[i]; + printf("%d, ", m); + } + printf("\n"); } int main() { - MyQueue q; + MyQueue q; - q.Add(-1); - q.Add(2); - q.Print(); + q.Add(-1); + q.Add(2); + q.Print(); - q.Remove(); - q.Print(); + q.Remove(); + q.Print(); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/template3.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.5 llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.6 --- llvm-test/SingleSource/UnitTests/Integer/template3.cpp:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/template3.cpp Mon Jan 22 18:17:21 2007 @@ -1,45 +1,49 @@ //===--- template3.cpp --- Test Cases for Bit Accurate Types --------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for partial specialization. // //===----------------------------------------------------------------------===// -#include +#include typedef int __attribute__ ((bitwidth(17))) int17; typedef int __attribute__ ((bitwidth(15))) int15; template struct X - { void f() { printf("Primary template\n"); } }; +{ void f() { printf("Primary template\n"); } }; template struct X - { void f() { printf("Partial specialization 1\n"); } }; +{ void f() { printf("Partial specialization 1\n"); } }; template struct X - { void f() { printf("Partial specialization 2\n"); } }; +{ void f() { printf("Partial specialization 2\n"); } }; template struct X - { void f() { printf("Partial specialization 3\n"); } }; +{ void f() { printf("Partial specialization 3\n"); } }; template struct X - { void f() { printf("Partial specialization 4\n"); } }; +{ void f() { printf("Partial specialization 4\n"); } }; int main() { - X a; - X b; - X bb; - - X c; - X d; - X e; -// X f; - a.f(); b.f(); bb.f(); c.f(); d.f(); e.f(); - - return 0; + X a; + X b; + X bb; + + X c; + X d; + X e; + + a.f(); + b.f(); + bb.f(); + c.f(); + d.f(); + e.f(); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/union-init.c diff -u llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.5 llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/union-init.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union-init.c Mon Jan 22 18:17:21 2007 @@ -1,44 +1,43 @@ //===--- union-init.c --- Test Cases for Bit Accurate Types ---------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for union initialization. // //===----------------------------------------------------------------------===// -#include +#include typedef int __attribute__ ((bitwidth(33))) int33; - struct Foo { - int33 a; - int33 b; - int33 c; + int33 a; + int33 b; + int33 c; }; struct Bar { - union { - void **a; - struct Foo b; - }u; + union { + void **a; + struct Foo b; + }u; }; struct Bar test = {0}; int main() { - if(test.u.b.a != 0) - printf("error: a = %d\n", test.u.b.a); - if(test.u.b.b != 0) - printf("error: a = %d\n", test.u.b.b); - if(test.u.b.c != 0) - printf("error: a = %d\n", test.u.b.c); - printf("%p\n", test.u.a); + if(test.u.b.a != 0) + printf("error: a = %d\n", test.u.b.a); + if(test.u.b.b != 0) + printf("error: a = %d\n", test.u.b.b); + if(test.u.b.c != 0) + printf("error: a = %d\n", test.u.b.c); + printf("%p\n", test.u.a); - return 0; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/union-struct.c diff -u llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.5 llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union-struct.c Mon Jan 22 18:17:21 2007 @@ -1,8 +1,8 @@ //===--- union-struct.c --- Test Cases for Bit Accurate Types -------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for struct with union inside. The purpose is to see @@ -10,25 +10,24 @@ // //===----------------------------------------------------------------------===// + #include typedef int __attribute__ ((bitwidth(31))) int31; struct Blend_Map_Entry { union { - float Colour[5]; - double Point_Slope[2]; - int31 weight[5]; + float Colour[5]; + double Point_Slope[2]; + int31 weight[5]; } Vals; }; -void test(struct Blend_Map_Entry* Foo) -{ -} + int main() { - if( sizeof(struct Blend_Map_Entry) == 5 * sizeof(int) ) - printf("error: %d\n", sizeof(struct Blend_Map_Entry)); - return 0; + if( sizeof(struct Blend_Map_Entry) == 5 * sizeof(int) ) + printf("error: %d\n", sizeof(struct Blend_Map_Entry)); + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/union2.c diff -u llvm-test/SingleSource/UnitTests/Integer/union2.c:1.4 llvm-test/SingleSource/UnitTests/Integer/union2.c:1.5 --- llvm-test/SingleSource/UnitTests/Integer/union2.c:1.4 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union2.c Mon Jan 22 18:17:21 2007 @@ -1,15 +1,18 @@ //===--- union2.c --- Test Cases for Bit Accurate Types -------------------===// // -// This file was developed by Guoling han and donated to the LLVM research -// group and is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// This file was developed by Guoling Han and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // This is a test for union type. By assigning values to different // fields, we can check whether the assignment is correctly performed. // //===----------------------------------------------------------------------===// + + #include + typedef int __attribute__ ((bitwidth(9))) int9; typedef int __attribute__ ((bitwidth(31))) int31; typedef union {short i; int9 i9; int31 i31;} myUnion; @@ -17,26 +20,25 @@ myStruct test(myUnion u) { - myStruct x; + myStruct x; - u.i31 = 0; - u.i = 0xffff; - int9* ptr = &(u.i9); - *ptr= 0x00; + u.i31 = 0; + u.i = 0xffff; + int9* ptr = &(u.i9); + *ptr= 0x00; - x.ptr = ptr; - x.i = u.i; + x.ptr = ptr; + x.i = u.i; - return x; - + return x; } static myUnion uu; int main() { - myStruct s = test(uu); - if(s.i == 0x0) - printf("error: s.i=%x\n", s.i); - return 0; + myStruct s = test(uu); + if(s.i == 0x0) + printf("error: s.i=%x\n", s.i); + return 0; } From sabre at nondot.org Mon Jan 22 18:36:33 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 22 Jan 2007 18:36:33 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp Message-ID: <200701230036.l0N0aX0O021496@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.137 -> 1.138 --- Log message: Fix a bunch of inline asm failures --- Diffs of the changes: (+1 -0) AsmPrinter.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.137 llvm/lib/CodeGen/AsmPrinter.cpp:1.138 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.137 Wed Jan 17 19:12:56 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Mon Jan 22 18:36:17 2007 @@ -779,6 +779,7 @@ const char *IDStart = LastEmitted; char *IDEnd; + errno = 0; long Val = strtol(IDStart, &IDEnd, 10); // We only accept numbers for IDs. if (!isdigit(*IDStart) || (Val == 0 && errno == EINVAL)) { cerr << "Bad $ operand number in inline asm string: '" From evan.cheng at apple.com Mon Jan 22 18:51:39 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 18:51:39 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200701230051.l0N0pdMm021836@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.86 -> 1.87 --- Log message: hasFP() is now a virtual method of MRegisterInfo. --- Diffs of the changes: (+5 -0) MRegisterInfo.h | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.86 llvm/include/llvm/Target/MRegisterInfo.h:1.87 --- llvm/include/llvm/Target/MRegisterInfo.h:1.86 Tue Jan 2 15:30:17 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Mon Jan 22 18:51:23 2007 @@ -367,6 +367,11 @@ return 0; } + /// hasFP - Return true if the specified function should have a dedicated frame + /// pointer register. For most targets this is true only if the function has + /// variable sized allocas or if frame pointer elimination is disabled. + virtual bool hasFP(const MachineFunction &MF) const = 0; + /// getCallFrameSetup/DestroyOpcode - These methods return the opcode of the /// frame setup/destroy instructions if they exist (-1 otherwise). Some /// targets use pseudo instructions in order to abstract away the difference From evan.cheng at apple.com Mon Jan 22 18:53:00 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 18:53:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp ARMRegisterInfo.h ARMRegisterInfo.td Message-ID: <200701230053.l0N0r0gQ021883@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.38 -> 1.39 ARMRegisterInfo.h updated: 1.5 -> 1.6 ARMRegisterInfo.td updated: 1.8 -> 1.9 --- Log message: hasFP() is now a virtual method of MRegisterInfo. --- Diffs of the changes: (+5 -2) ARMRegisterInfo.cpp | 2 +- ARMRegisterInfo.h | 2 ++ ARMRegisterInfo.td | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.38 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.39 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.38 Sat Jan 20 04:22:33 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Mon Jan 22 18:52:44 2007 @@ -277,7 +277,7 @@ /// pointer register. This is true if the function has variable sized allocas /// or if frame pointer elimination is disabled. /// -static bool hasFP(const MachineFunction &MF) { +bool ARMRegisterInfo::hasFP(const MachineFunction &MF) const { return NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects(); } Index: llvm/lib/Target/ARM/ARMRegisterInfo.h diff -u llvm/lib/Target/ARM/ARMRegisterInfo.h:1.5 llvm/lib/Target/ARM/ARMRegisterInfo.h:1.6 --- llvm/lib/Target/ARM/ARMRegisterInfo.h:1.5 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.h Mon Jan 22 18:52:44 2007 @@ -68,6 +68,8 @@ const TargetRegisterClass* const* getCalleeSavedRegClasses() const; + bool hasFP(const MachineFunction &MF) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const; Index: llvm/lib/Target/ARM/ARMRegisterInfo.td diff -u llvm/lib/Target/ARM/ARMRegisterInfo.td:1.8 llvm/lib/Target/ARM/ARMRegisterInfo.td:1.9 --- llvm/lib/Target/ARM/ARMRegisterInfo.td:1.8 Fri Jan 19 20:09:25 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.td Mon Jan 22 18:52:44 2007 @@ -150,6 +150,7 @@ GPRClass::iterator GPRClass::allocation_order_end(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); + const MRegisterInfo *RI = TM.getRegisterInfo(); const ARMSubtarget &Subtarget = TM.getSubtarget(); GPRClass::iterator I; if (Subtarget.isThumb()) @@ -167,7 +168,7 @@ } // Mac OS X requires FP not to be clobbered for backtracing purpose. - return (Subtarget.isTargetDarwin() || hasFP(MF)) ? I-1 : I; + return (Subtarget.isTargetDarwin() || RI->hasFP(MF)) ? I-1 : I; } }]; } From evan.cheng at apple.com Mon Jan 22 18:53:28 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 18:53:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp AlphaRegisterInfo.h Message-ID: <200701230053.l0N0rSVx021908@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaRegisterInfo.cpp updated: 1.55 -> 1.56 AlphaRegisterInfo.h updated: 1.16 -> 1.17 --- Log message: hasFP() is now a virtual method of MRegisterInfo. --- Diffs of the changes: (+3 -1) AlphaRegisterInfo.cpp | 2 +- AlphaRegisterInfo.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.55 llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.56 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.55 Tue Jan 2 15:32:26 2007 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Mon Jan 22 18:53:13 2007 @@ -186,7 +186,7 @@ // pointer register. This is true if the function has variable sized allocas or // if frame pointer elimination is disabled. // -static bool hasFP(const MachineFunction &MF) { +bool AlphaRegisterInfo::hasFP(const MachineFunction &MF) const { MachineFrameInfo *MFI = MF.getFrameInfo(); return MFI->hasVarSizedObjects(); } Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.h diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.16 llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.17 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.h:1.16 Tue Jan 2 15:32:26 2007 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.h Mon Jan 22 18:53:13 2007 @@ -49,6 +49,8 @@ const TargetRegisterClass* const* getCalleeSavedRegClasses() const; + bool hasFP(const MachineFunction &MF) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const; From evan.cheng at apple.com Mon Jan 22 18:53:56 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 18:53:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64RegisterInfo.cpp IA64RegisterInfo.h Message-ID: <200701230053.l0N0ruNq021968@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64RegisterInfo.cpp updated: 1.26 -> 1.27 IA64RegisterInfo.h updated: 1.10 -> 1.11 --- Log message: hasFP() is now a virtual method of MRegisterInfo. --- Diffs of the changes: (+3 -1) IA64RegisterInfo.cpp | 2 +- IA64RegisterInfo.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/IA64/IA64RegisterInfo.cpp diff -u llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.26 llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.27 --- llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.26 Tue Jan 2 15:32:44 2007 +++ llvm/lib/Target/IA64/IA64RegisterInfo.cpp Mon Jan 22 18:53:41 2007 @@ -114,7 +114,7 @@ // pointer register. This is true if the function has variable sized allocas or // if frame pointer elimination is disabled. // -static bool hasFP(const MachineFunction &MF) { +bool IA64RegisterInfo::hasFP(const MachineFunction &MF) const { return NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects(); } Index: llvm/lib/Target/IA64/IA64RegisterInfo.h diff -u llvm/lib/Target/IA64/IA64RegisterInfo.h:1.10 llvm/lib/Target/IA64/IA64RegisterInfo.h:1.11 --- llvm/lib/Target/IA64/IA64RegisterInfo.h:1.10 Tue Jan 2 15:32:44 2007 +++ llvm/lib/Target/IA64/IA64RegisterInfo.h Mon Jan 22 18:53:41 2007 @@ -48,6 +48,8 @@ const TargetRegisterClass* const* getCalleeSavedRegClasses() const; + bool hasFP(const MachineFunction &MF) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const; From evan.cheng at apple.com Mon Jan 22 18:55:36 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 18:55:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h Message-ID: <200701230055.l0N0taw1022068@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.95 -> 1.96 PPCRegisterInfo.h updated: 1.21 -> 1.22 --- Log message: hasFP() is now a virtual method of MRegisterInfo. --- Diffs of the changes: (+3 -1) PPCRegisterInfo.cpp | 2 +- PPCRegisterInfo.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.95 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.96 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.95 Tue Jan 2 15:33:01 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Mon Jan 22 18:55:21 2007 @@ -410,7 +410,7 @@ // hasFP - Return true if the specified function actually has a dedicated frame // pointer register. This is true if the function needs a frame pointer and has // a non-zero stack size. -static bool hasFP(const MachineFunction &MF) { +bool PPCRegisterInfo::hasFP(const MachineFunction &MF) const { const MachineFrameInfo *MFI = MF.getFrameInfo(); return MFI->getStackSize() && needsFP(MF); } Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.21 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.22 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.21 Tue Jan 2 15:33:01 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h Mon Jan 22 18:55:21 2007 @@ -58,6 +58,8 @@ const TargetRegisterClass* const* getCalleeSavedRegClasses() const; + bool hasFP(const MachineFunction &MF) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const; From evan.cheng at apple.com Mon Jan 22 18:57:03 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 18:57:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp SparcRegisterInfo.h Message-ID: <200701230057.l0N0v3Y4022109@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcRegisterInfo.cpp updated: 1.50 -> 1.51 SparcRegisterInfo.h updated: 1.16 -> 1.17 --- Log message: hasFP() is now a virtual method of MRegisterInfo. --- Diffs of the changes: (+5 -0) SparcRegisterInfo.cpp | 3 +++ SparcRegisterInfo.h | 2 ++ 2 files changed, 5 insertions(+) Index: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.50 llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.51 --- llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.50 Tue Jan 2 15:33:17 2007 +++ llvm/lib/Target/Sparc/SparcRegisterInfo.cpp Mon Jan 22 18:56:45 2007 @@ -122,6 +122,9 @@ return CalleeSavedRegClasses; } +bool SparcRegisterInfo::hasFP(const MachineFunction &MF) const { + return false; +} void SparcRegisterInfo:: eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, Index: llvm/lib/Target/Sparc/SparcRegisterInfo.h diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.16 llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.17 --- llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.16 Tue Jan 2 15:33:17 2007 +++ llvm/lib/Target/Sparc/SparcRegisterInfo.h Mon Jan 22 18:56:45 2007 @@ -52,6 +52,8 @@ const TargetRegisterClass* const* getCalleeSavedRegClasses() const; + bool hasFP(const MachineFunction &MF) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const; From evan.cheng at apple.com Mon Jan 22 18:58:04 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 22 Jan 2007 18:58:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86RegisterInfo.h X86RegisterInfo.td Message-ID: <200701230058.l0N0w4Gq022148@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.192 -> 1.193 X86RegisterInfo.h updated: 1.43 -> 1.44 X86RegisterInfo.td updated: 1.39 -> 1.40 --- Log message: hasFP() is now a virtual method of MRegisterInfo. --- Diffs of the changes: (+23 -13) X86RegisterInfo.cpp | 4 ++-- X86RegisterInfo.h | 2 ++ X86RegisterInfo.td | 30 +++++++++++++++++++----------- 3 files changed, 23 insertions(+), 13 deletions(-) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.192 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.193 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.192 Sat Jan 20 04:17:53 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Mon Jan 22 18:57:47 2007 @@ -891,7 +891,7 @@ // pointer register. This is true if the function has variable sized allocas or // if frame pointer elimination is disabled. // -static bool hasFP(const MachineFunction &MF) { +bool X86RegisterInfo::hasFP(const MachineFunction &MF) const { return (NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects() || MF.getInfo()->getForceFramePointer()); @@ -998,7 +998,7 @@ // Get the number of bytes to allocate from the FrameInfo unsigned NumBytes = MFI->getStackSize(); - if (MFI->hasCalls() || MF.getFrameInfo()->hasVarSizedObjects()) { + if (MFI->hasCalls() || MFI->hasVarSizedObjects()) { // When we have no frame pointer, we reserve argument space for call sites // in the function immediately on entry to the current function. This // eliminates the need for add/sub ESP brackets around call sites. Index: llvm/lib/Target/X86/X86RegisterInfo.h diff -u llvm/lib/Target/X86/X86RegisterInfo.h:1.43 llvm/lib/Target/X86/X86RegisterInfo.h:1.44 --- llvm/lib/Target/X86/X86RegisterInfo.h:1.43 Tue Jan 2 15:33:40 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.h Mon Jan 22 18:57:47 2007 @@ -78,6 +78,8 @@ /// length of this list match the getCalleeSavedRegs() list. const TargetRegisterClass* const* getCalleeSavedRegClasses() const; + bool hasFP(const MachineFunction &MF) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const; Index: llvm/lib/Target/X86/X86RegisterInfo.td diff -u llvm/lib/Target/X86/X86RegisterInfo.td:1.39 llvm/lib/Target/X86/X86RegisterInfo.td:1.40 --- llvm/lib/Target/X86/X86RegisterInfo.td:1.39 Fri Sep 8 01:48:29 2006 +++ llvm/lib/Target/X86/X86RegisterInfo.td Mon Jan 22 18:57:47 2007 @@ -197,10 +197,11 @@ GR8Class::iterator GR8Class::allocation_order_begin(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); + const MRegisterInfo *RI = TM.getRegisterInfo(); const X86Subtarget &Subtarget = TM.getSubtarget(); if (!Subtarget.is64Bit()) return X86_GR8_AO_32; - else if (hasFP(MF)) + else if (RI->hasFP(MF)) return X86_GR8_AO_64_fp; else return X86_GR8_AO_64; @@ -209,10 +210,11 @@ GR8Class::iterator GR8Class::allocation_order_end(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); + const MRegisterInfo *RI = TM.getRegisterInfo(); const X86Subtarget &Subtarget = TM.getSubtarget(); if (!Subtarget.is64Bit()) return X86_GR8_AO_32 + (sizeof(X86_GR8_AO_32) / sizeof(unsigned)); - else if (hasFP(MF)) + else if (RI->hasFP(MF)) return X86_GR8_AO_64_fp + (sizeof(X86_GR8_AO_64_fp) / sizeof(unsigned)); else return X86_GR8_AO_64 + (sizeof(X86_GR8_AO_64) / sizeof(unsigned)); @@ -248,14 +250,15 @@ GR16Class::iterator GR16Class::allocation_order_begin(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); + const MRegisterInfo *RI = TM.getRegisterInfo(); const X86Subtarget &Subtarget = TM.getSubtarget(); if (Subtarget.is64Bit()) { - if (hasFP(MF)) + if (RI->hasFP(MF)) return X86_GR16_AO_64_fp; else return X86_GR16_AO_64; } else { - if (hasFP(MF)) + if (RI->hasFP(MF)) return X86_GR16_AO_32_fp; else return X86_GR16_AO_32; @@ -265,14 +268,15 @@ GR16Class::iterator GR16Class::allocation_order_end(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); + const MRegisterInfo *RI = TM.getRegisterInfo(); const X86Subtarget &Subtarget = TM.getSubtarget(); if (Subtarget.is64Bit()) { - if (hasFP(MF)) + if (RI->hasFP(MF)) return X86_GR16_AO_64_fp+(sizeof(X86_GR16_AO_64_fp)/sizeof(unsigned)); else return X86_GR16_AO_64 + (sizeof(X86_GR16_AO_64) / sizeof(unsigned)); } else { - if (hasFP(MF)) + if (RI->hasFP(MF)) return X86_GR16_AO_32_fp+(sizeof(X86_GR16_AO_32_fp)/sizeof(unsigned)); else return X86_GR16_AO_32 + (sizeof(X86_GR16_AO_32) / sizeof(unsigned)); @@ -309,14 +313,15 @@ GR32Class::iterator GR32Class::allocation_order_begin(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); + const MRegisterInfo *RI = TM.getRegisterInfo(); const X86Subtarget &Subtarget = TM.getSubtarget(); if (Subtarget.is64Bit()) { - if (hasFP(MF)) + if (RI->hasFP(MF)) return X86_GR32_AO_64_fp; else return X86_GR32_AO_64; } else { - if (hasFP(MF)) + if (RI->hasFP(MF)) return X86_GR32_AO_32_fp; else return X86_GR32_AO_32; @@ -326,14 +331,15 @@ GR32Class::iterator GR32Class::allocation_order_end(const MachineFunction &MF) const { const TargetMachine &TM = MF.getTarget(); + const MRegisterInfo *RI = TM.getRegisterInfo(); const X86Subtarget &Subtarget = TM.getSubtarget(); if (Subtarget.is64Bit()) { - if (hasFP(MF)) + if (RI->hasFP(MF)) return X86_GR32_AO_64_fp+(sizeof(X86_GR32_AO_64_fp)/sizeof(unsigned)); else return X86_GR32_AO_64 + (sizeof(X86_GR32_AO_64) / sizeof(unsigned)); } else { - if (hasFP(MF)) + if (RI->hasFP(MF)) return X86_GR32_AO_32_fp+(sizeof(X86_GR32_AO_32_fp)/sizeof(unsigned)); else return X86_GR32_AO_32 + (sizeof(X86_GR32_AO_32) / sizeof(unsigned)); @@ -352,7 +358,9 @@ let MethodBodies = [{ GR64Class::iterator GR64Class::allocation_order_end(const MachineFunction &MF) const { - if (hasFP(MF)) // Does the function dedicate RBP to being a frame ptr? + const TargetMachine &TM = MF.getTarget(); + const MRegisterInfo *RI = TM.getRegisterInfo(); + if (RI->hasFP(MF)) // Does the function dedicate RBP to being a frame ptr? return end()-2; // If so, don't allocate RSP or RBP else return end()-1; // If not, just don't allocate RSP From sabre at nondot.org Mon Jan 22 18:59:31 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 22 Jan 2007 18:59:31 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallSet.h Message-ID: <200701230059.l0N0xVqa022226@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallSet.h added (r1.1) --- Log message: add a trivial SmallSet class, which operates on a similar principle to SmallVector. --- Diffs of the changes: (+76 -0) SmallSet.h | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 76 insertions(+) Index: llvm/include/llvm/ADT/SmallSet.h diff -c /dev/null llvm/include/llvm/ADT/SmallSet.h:1.1 *** /dev/null Mon Jan 22 18:59:25 2007 --- llvm/include/llvm/ADT/SmallSet.h Mon Jan 22 18:59:15 2007 *************** *** 0 **** --- 1,76 ---- + //===- llvm/ADT/SmallSet.h - 'Normally small' sets --------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Chris Lattner and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the SmallSet class. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_ADT_SMALLSET_H + #define LLVM_ADT_SMALLSET_H + + #include "llvm/ADT/SmallVector.h" + + namespace llvm { + + /// SmallSet - This maintains a set of unique values, optimizing for the case + /// when the set is small (less than N). In this case, the set can be + /// maintained with no mallocs. + /// + /// Note that this set does not guarantee that the elements in the set will be + /// ordered. + template + class SmallSet { + SmallVector Vector; + typedef typename SmallVector::iterator mutable_iterator; + public: + SmallSet() {} + + // Support iteration. + typedef typename SmallVector::const_iterator iterator; + typedef typename SmallVector::const_iterator const_iterator; + + iterator begin() const { return Vector.begin(); } + iterator end() const { return Vector.end(); } + + bool empty() const { return Vector.empty(); } + unsigned size() const { return Vector.size(); } + + /// count - Return true if the element is in the set. + unsigned count(const T &V) const { + // Since the collection is small, just do a linear search. + for (iterator I = begin(), E = end(); I != E; ++I) + if (*I == V) + return 1; + return 0; + } + + /// insert - Insert an element into the set if it isn't already there. + void insert(const T &V) { + if (count(V)) return; // Don't reinsert if it already exists. + Vector.push_back(V); + } + + void erase(const T &V) { + for (mutable_iterator I = Vector.begin(), E = Vector.end(); I != E; ++I) + if (*I == V) { + Vector.erase(I); + return; + } + } + + void clear() { + Vector.clear(); + } + + }; + + + } // end namespace llvm + + #endif From sabre at nondot.org Mon Jan 22 19:00:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 22 Jan 2007 19:00:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp Message-ID: <200701230100.l0N104nC022295@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: VirtRegMap.cpp updated: 1.93 -> 1.94 --- Log message: Switch this to use SmallSet to avoid mallocs in the common case. --- Diffs of the changes: (+3 -3) VirtRegMap.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.93 llvm/lib/CodeGen/VirtRegMap.cpp:1.94 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.93 Fri Jan 19 16:40:14 2007 +++ llvm/lib/CodeGen/VirtRegMap.cpp Mon Jan 22 18:59:48 2007 @@ -29,8 +29,8 @@ #include "llvm/Support/Compiler.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallSet.h" #include -#include using namespace llvm; STATISTIC(NumSpills, "Number of register spills"); @@ -471,7 +471,7 @@ unsigned GetRegForReload(unsigned PhysReg, MachineInstr *MI, AvailableSpills &Spills, std::map &MaybeDeadStores, - std::set &Rejected) { + SmallSet &Rejected) { if (Reuses.empty()) return PhysReg; // This is most often empty. for (unsigned ro = 0, e = Reuses.size(); ro != e; ++ro) { @@ -553,7 +553,7 @@ unsigned GetRegForReload(unsigned PhysReg, MachineInstr *MI, AvailableSpills &Spills, std::map &MaybeDeadStores) { - std::set Rejected; + SmallSet Rejected; return GetRegForReload(PhysReg, MI, Spills, MaybeDeadStores, Rejected); } }; From sabre at nondot.org Mon Jan 22 19:16:35 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 22 Jan 2007 19:16:35 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallSet.h Message-ID: <200701230116.l0N1GZKV022626@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallSet.h updated: 1.1 -> 1.2 --- Log message: make the SmallSet interface more std::set-like --- Diffs of the changes: (+13 -6) SmallSet.h | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) Index: llvm/include/llvm/ADT/SmallSet.h diff -u llvm/include/llvm/ADT/SmallSet.h:1.1 llvm/include/llvm/ADT/SmallSet.h:1.2 --- llvm/include/llvm/ADT/SmallSet.h:1.1 Mon Jan 22 18:59:15 2007 +++ llvm/include/llvm/ADT/SmallSet.h Mon Jan 22 19:16:19 2007 @@ -41,19 +41,26 @@ bool empty() const { return Vector.empty(); } unsigned size() const { return Vector.size(); } + iterator find(const T &V) const { + for (iterator I = begin(), E = end(); I != E; ++I) + if (*I == V) + return I; + return end(); + } + /// count - Return true if the element is in the set. unsigned count(const T &V) const { // Since the collection is small, just do a linear search. - for (iterator I = begin(), E = end(); I != E; ++I) - if (*I == V) - return 1; - return 0; + return find(V) != end(); } /// insert - Insert an element into the set if it isn't already there. - void insert(const T &V) { - if (count(V)) return; // Don't reinsert if it already exists. + std::pair insert(const T &V) { + iterator I = find(V); + if (I == end()) // Don't reinsert if it already exists. + return std::make_pair(I, false); Vector.push_back(V); + return std::make_pair(end()-1, true); } void erase(const T &V) { From nicholas at mxc.ca Mon Jan 22 22:08:02 2007 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 22 Jan 2007 22:08:02 -0600 Subject: [llvm-commits] CVS: llvm-www/ProjectsWithLLVM/index.html Message-ID: <200701230408.l0N4823E025734@zion.cs.uiuc.edu> Changes in directory llvm-www/ProjectsWithLLVM: index.html updated: 1.29 -> 1.30 --- Log message: Added LANL's Trident compiler. --- Diffs of the changes: (+27 -0) index.html | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+) Index: llvm-www/ProjectsWithLLVM/index.html diff -u llvm-www/ProjectsWithLLVM/index.html:1.29 llvm-www/ProjectsWithLLVM/index.html:1.30 --- llvm-www/ProjectsWithLLVM/index.html:1.29 Sat Mar 4 17:48:08 2006 +++ llvm-www/ProjectsWithLLVM/index.html Mon Jan 22 22:07:36 2007 @@ -35,6 +35,7 @@
    +
  • Trident Compiler
  • Ascenium Reconfigurable Processor Compiler
  • The PyPy Python Implementation Project
  • Scheme to LLVM Translator
  • @@ -54,6 +55,32 @@ + + + + +
    +

    +Trident is a compiler for +floating point algorithms written in C, producing Register Transfer +Level VHDL descriptions of circuits targetted for reconfigurable logic +devices. Trident automatically extracts parallelism and pipelines loop +bodies using conventional compiler optimizations and scheduling +techniques. Trident also provides an open framework for +experimentation, analysis, and optimization of floating point +algorithms on FPGAs and the flexibility to easily integrate custom +floating point libraries.

    + +

    +Trident uses the LLVM C/C++ front-end to parse input languages and +produce low-level platform independent code.

    +
    + + From sabre at nondot.org Mon Jan 22 23:00:14 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 22 Jan 2007 23:00:14 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallSet.h Message-ID: <200701230500.l0N50EfW026652@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallSet.h updated: 1.2 -> 1.3 --- Log message: fix typo --- Diffs of the changes: (+1 -1) SmallSet.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/ADT/SmallSet.h diff -u llvm/include/llvm/ADT/SmallSet.h:1.2 llvm/include/llvm/ADT/SmallSet.h:1.3 --- llvm/include/llvm/ADT/SmallSet.h:1.2 Mon Jan 22 19:16:19 2007 +++ llvm/include/llvm/ADT/SmallSet.h Mon Jan 22 22:59:58 2007 @@ -57,7 +57,7 @@ /// insert - Insert an element into the set if it isn't already there. std::pair insert(const T &V) { iterator I = find(V); - if (I == end()) // Don't reinsert if it already exists. + if (I != end()) // Don't reinsert if it already exists. return std::make_pair(I, false); Vector.push_back(V); return std::make_pair(end()-1, true); From baldrick at free.fr Tue Jan 23 01:40:04 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 23 Jan 2007 08:40:04 +0100 Subject: [llvm-commits] =?iso-8859-1?q?llvm-gcc4=3A_use_langhooks_rather_t?= =?iso-8859-1?q?han_front-end_calls=09in_i386=2Ec?= In-Reply-To: <92A23398-EB67-44BA-9673-5556ADAB46EA@apple.com> References: <200701172155.32302.baldrick@free.fr> <200701201543.27491.baldrick@free.fr> <92A23398-EB67-44BA-9673-5556ADAB46EA@apple.com> Message-ID: <200701230840.05180.baldrick@free.fr> On Monday 22 January 2007 21:06, Devang Patel wrote: > > On Jan 20, 2007, at 6:43 AM, Duncan Sands wrote: > > > Hi Devang, thanks for reviewing these patches. > > > >> Applied, after adding "APPLE LOCAL llvm" markers. > > > > This hasn't turned up in the llvm-gcc4 svn repository > > yet. Did you apply it there or to some other tree? > > (I'm waiting for it to turn up, so I can see how the > > APPLE markers should be done). > > Do you see this change ? On my side, svn commit succeeded > on 18th and this change should show up in mirror next day. It turned up on the 21st. This is not the first time recently that I've observed the mirror to be several days behind. Best wishes, Duncan. From evan.cheng at apple.com Tue Jan 23 03:36:28 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 03:36:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <200701230936.l0N9aS4k007705@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PrologEpilogInserter.cpp updated: 1.65 -> 1.66 --- Log message: PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary. --- Diffs of the changes: (+16 -1) PrologEpilogInserter.cpp | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.65 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.66 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.65 Sat Jan 20 03:21:54 2007 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Tue Jan 23 03:36:03 2007 @@ -386,7 +386,22 @@ } } - // Set the final value of the stack pointer... + // Round up the size to a multiple of the alignment, but only if there are + // calls or alloca's in the function. This ensures that any calls to + // subroutines have their stack frames suitable aligned. + if (FFI->hasCalls() || FFI->hasVarSizedObjects()) { + // When we have no frame pointer, we reserve argument space for call sites + // in the function immediately on entry to the current function. This + // eliminates the need for add/sub sp brackets around call sites. + const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo(); + if (!RegInfo->hasFP(Fn)) + Offset += FFI->getMaxCallFrameSize(); + + unsigned AlignMask = TFI.getStackAlignment() - 1; + Offset = (Offset + AlignMask) & ~AlignMask; + } + + // Update frame info to pretend that this is part of the stack... FFI->setStackSize(Offset+TFI.getOffsetOfLocalArea()); // Remember the required stack alignment in case targets need it to perform From evan.cheng at apple.com Tue Jan 23 03:37:37 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 03:37:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701230937.l0N9bbKV007750@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.39 -> 1.40 --- Log message: PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary. --- Diffs of the changes: (+0 -15) ARMRegisterInfo.cpp | 15 --------------- 1 files changed, 15 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.39 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.40 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.39 Mon Jan 22 18:52:44 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Tue Jan 23 03:37:21 2007 @@ -915,21 +915,6 @@ } } - // If necessary, add one more SUBri to account for the call frame - // and/or local storage, alloca area. - if (MFI->hasCalls() || MF.getFrameInfo()->hasVarSizedObjects()) { - // We reserve argument space for call sites in the function immediately on - // entry to the current function. This eliminates the need for add/sub - // brackets around call sites. - if (!hasFP(MF)) - NumBytes += MFI->getMaxCallFrameSize(); - - // Round the size to a multiple of the alignment. - NumBytes = (NumBytes+Align-1)/Align*Align; - } - - MFI->setStackSize(NumBytes); - // Determine starting offsets of spill areas. if (AFI->hasStackFrame()) { unsigned DPRCSOffset = NumBytes - (GPRCS1Size + GPRCS2Size + DPRCSSize); From evan.cheng at apple.com Tue Jan 23 03:37:54 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 03:37:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Message-ID: <200701230937.l0N9bs16007768@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaRegisterInfo.cpp updated: 1.56 -> 1.57 --- Log message: PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary. --- Diffs of the changes: (+0 -10) AlphaRegisterInfo.cpp | 10 ---------- 1 files changed, 10 deletions(-) Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.56 llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.57 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.56 Mon Jan 22 18:53:13 2007 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Tue Jan 23 03:37:38 2007 @@ -302,16 +302,6 @@ // Get the number of bytes to allocate from the FrameInfo long NumBytes = MFI->getStackSize(); - if (MFI->hasCalls() && !FP) { - // We reserve argument space for call sites in the function immediately on - // entry to the current function. This eliminates the need for add/sub - // brackets around call sites. - //If there is a frame pointer, then we don't do this - NumBytes += MFI->getMaxCallFrameSize(); - DOUT << "Added " << MFI->getMaxCallFrameSize() - << " to the stack due to calls\n"; - } - if (FP) NumBytes += 8; //reserve space for the old FP From evan.cheng at apple.com Tue Jan 23 03:38:10 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 03:38:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64RegisterInfo.cpp Message-ID: <200701230938.l0N9cANS007788@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64RegisterInfo.cpp updated: 1.27 -> 1.28 --- Log message: PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary. --- Diffs of the changes: (+0 -7) IA64RegisterInfo.cpp | 7 ------- 1 files changed, 7 deletions(-) Index: llvm/lib/Target/IA64/IA64RegisterInfo.cpp diff -u llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.27 llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.28 --- llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.27 Mon Jan 22 18:53:41 2007 +++ llvm/lib/Target/IA64/IA64RegisterInfo.cpp Tue Jan 23 03:37:54 2007 @@ -256,13 +256,6 @@ // Get the number of bytes to allocate from the FrameInfo unsigned NumBytes = MFI->getStackSize(); - if (MFI->hasCalls() && !FP) { - // We reserve argument space for call sites in the function immediately on - // entry to the current function. This eliminates the need for add/sub - // brackets around call sites. - NumBytes += MFI->getMaxCallFrameSize(); - } - if(FP) NumBytes += 8; // reserve space for the old FP From evan.cheng at apple.com Tue Jan 23 03:38:26 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 03:38:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200701230938.l0N9cQe1007809@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.193 -> 1.194 --- Log message: PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary. --- Diffs of the changes: (+0 -17) X86RegisterInfo.cpp | 17 ----------------- 1 files changed, 17 deletions(-) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.193 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.194 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.193 Mon Jan 22 18:57:47 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Tue Jan 23 03:38:11 2007 @@ -991,29 +991,12 @@ MachineBasicBlock::iterator MBBI = MBB.begin(); MachineFrameInfo *MFI = MF.getFrameInfo(); unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment(); - unsigned AlignMask = Align - 1; const Function* Fn = MF.getFunction(); const X86Subtarget* Subtarget = &MF.getTarget().getSubtarget(); MachineInstr *MI; // Get the number of bytes to allocate from the FrameInfo unsigned NumBytes = MFI->getStackSize(); - if (MFI->hasCalls() || MFI->hasVarSizedObjects()) { - // When we have no frame pointer, we reserve argument space for call sites - // in the function immediately on entry to the current function. This - // eliminates the need for add/sub ESP brackets around call sites. - // - if (!hasFP(MF)) - NumBytes += MFI->getMaxCallFrameSize(); - - // Round the size to a multiple of the alignment (don't forget the 4/8 byte - // offset pushed by the caller though). No need to align the stack if this - // is a leaf function. - NumBytes = (((NumBytes+SlotSize) + AlignMask) & ~AlignMask) - SlotSize; - } - - // Update frame info to pretend that this is part of the stack... - MFI->setStackSize(NumBytes); if (NumBytes) { // adjust stack pointer: ESP -= numbytes if (NumBytes >= 4096 && Subtarget->isTargetCygMing()) { From llvm at cs.uiuc.edu Tue Jan 23 04:26:28 2007 From: llvm at cs.uiuc.edu (LLVM) Date: Tue, 23 Jan 2007 04:26:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/Disassembler.cpp Message-ID: <200701231026.l0NAQSsV009761@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Disassembler.cpp (r1.1) removed --- Log message: Moved disassembler to libSystem --- Diffs of the changes: (+0 -0) 0 files changed From asl at math.spbu.ru Tue Jan 23 04:26:29 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 23 Jan 2007 04:26:29 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Disassembler.h Message-ID: <200701231026.l0NAQTHQ009766@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Disassembler.h added (r1.1) --- Log message: Moved disassembler to libSystem --- Diffs of the changes: (+31 -0) Disassembler.h | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+) Index: llvm/include/llvm/System/Disassembler.h diff -c /dev/null llvm/include/llvm/System/Disassembler.h:1.1 *** /dev/null Tue Jan 23 04:26:18 2007 --- llvm/include/llvm/System/Disassembler.h Tue Jan 23 04:26:08 2007 *************** *** 0 **** --- 1,31 ---- + //===- llvm/Support/Disassembler.h ------------------------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Anton Korobeynikov and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the necessary glue to call external disassembler + // libraries. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_SYSTEM_DISASSEMBLER_H + #define LLVM_SYSTEM_DISASSEMBLER_H + + #include "llvm/Support/DataTypes.h" + #include + + namespace llvm { + namespace sys { + + /// This function provides some "glue" code to call external disassembler + /// libraries. + std::string disassembleBuffer(uint8_t* start, size_t length, uint64_t pc = 0); + + } + } + + #endif // LLVM_SYSTEM_DISASSEMBLER_H From asl at math.spbu.ru Tue Jan 23 04:26:33 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 23 Jan 2007 04:26:33 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <200701231026.l0NAQXBq009773@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JITEmitter.cpp updated: 1.127 -> 1.128 --- Log message: Moved disassembler to libSystem --- Diffs of the changes: (+2 -10) JITEmitter.cpp | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.127 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.128 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.127 Sat Jan 20 14:51:43 2007 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Tue Jan 23 04:26:08 2007 @@ -27,8 +27,8 @@ #include "llvm/Target/TargetJITInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/Disassembler.h" #include "llvm/Support/MutexGuard.h" +#include "llvm/System/Disassembler.h" #include "llvm/ADT/Statistic.h" #include "llvm/System/Memory.h" #include @@ -868,15 +868,7 @@ #ifndef NDEBUG DOUT << "Disassembled code:\n" -#if defined(__i386__) - << disassembleBuffer(FnStart, FnEnd-FnStart, - Disassembler::X86_32, (uint32_t)FnStart); -#elif defined(__amd64__) || defined(__x86_64__) - << disassembleBuffer(FnStart, FnEnd-FnStart, - Disassembler::X86_64, (uint64_t)FnStart); -#else - << "N/A\n"; -#endif + << sys::disassembleBuffer(FnStart, FnEnd-FnStart, (uintptr_t)FnStart); #endif return false; From asl at math.spbu.ru Tue Jan 23 04:26:33 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 23 Jan 2007 04:26:33 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Disassembler.cpp Message-ID: <200701231026.l0NAQXtl009778@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Disassembler.cpp added (r1.1) --- Log message: Moved disassembler to libSystem --- Diffs of the changes: (+65 -0) Disassembler.cpp | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+) Index: llvm/lib/System/Disassembler.cpp diff -c /dev/null llvm/lib/System/Disassembler.cpp:1.1 *** /dev/null Tue Jan 23 04:26:19 2007 --- llvm/lib/System/Disassembler.cpp Tue Jan 23 04:26:08 2007 *************** *** 0 **** --- 1,65 ---- + //===- lib/System/Disassembler.cpp ------------------------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Anton Korobeynikov and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the necessary glue to call external disassembler + // libraries. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Config/config.h" + #include "llvm/System/Disassembler.h" + + #include + #include + #include + #include + + #if USE_UDIS86 + #include + #endif + + using namespace llvm; + + std::string llvm::sys::disassembleBuffer(uint8_t* start, size_t length, + uint64_t pc) { + std::stringstream res; + + #if defined (__i386__) || defined (__amd64__) || defined (__x86_64__) + unsigned bits; + # if defined(__i386__) + bits = 32; + # else + bits = 64; + # endif + + # if USE_UDIS86 + ud_t ud_obj; + + ud_init(&ud_obj); + ud_set_input_buffer(&ud_obj, start, length); + ud_set_mode(&ud_obj, bits); + ud_set_pc(&ud_obj, pc); + ud_set_syntax(&ud_obj, UD_SYN_ATT); + + res << std::setbase(16) + << std::setw(bits/4); + + while (ud_disassemble(&ud_obj)) { + res << ud_insn_off(&ud_obj) << ":\t" << ud_insn_asm(&ud_obj) << "\n"; + } + # else + res << "No disassembler available. See configure help for avaiable options.\n"; + # endif + + #else + res << "No disassembler available. See configure help for avaiable options.\n"; + #endif + + return res.str(); + } From llvm at cs.uiuc.edu Tue Jan 23 04:26:34 2007 From: llvm at cs.uiuc.edu (LLVM) Date: Tue, 23 Jan 2007 04:26:34 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/Disassembler.h Message-ID: <200701231026.l0NAQY4K009783@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: Disassembler.h (r1.1) removed --- Log message: Moved disassembler to libSystem --- Diffs of the changes: (+0 -0) 0 files changed From baldrick at free.fr Tue Jan 23 04:53:23 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 23 Jan 2007 11:53:23 +0100 Subject: [llvm-commits] llvm-gcc4: gimplifier fixes In-Reply-To: References: <200701172216.06669.baldrick@free.fr> Message-ID: <200701231153.24317.baldrick@free.fr> > > Backported from gcc-4.3. These should only effect the Ada front-end. >... > This was part of bigger C++ patch. I am hesitated to bring in partial > patch without further testing. > > Please bring in test case and also add "APPLE LOCAL llvm" markers > appropriately. Please let us know how you have verified that there is > no C++ regression caused by this patch. And why other parts of same > bug fix are not required. If this particular part of the patch is > necessary for Ada then I'd prefer to bring in entire C++ bug fix after > appropriate C++ testing is done. Hi Devang, you are right that this effects C++ also: in rare cases C++ produces expressions of type address_of_static_constructor. This currently causes llvm-gcc4 to abort, at least with the testcase below. With my patch it no longer aborts, so the danger is that wrong code may be produced. Here is the testcase from gcc PR c++/23171: p.c: int *p = (int*)(int[1]){0}; Without my patch: $ g++ -c -O p.c llvm-backend.cpp:491: void emit_global_to_llvm(tree_node*): Assertion `((__extension__ ({ const tree __t = ((__extension__ ({ const tree __t = (decl); if (tree_code_type[(int) (((enum tree_code) (__t)->common.code))] != (tcc_declaration)) tree_class_check_failed (__t, (tcc_declaration), "../../gcc.llvm.master/gcc/llvm-backend.cpp", 491, __FUNCTION__); __t; })->decl.initial)); char const __c = tree_code_type[(int) (((enum tree_code) (__t)->common.code))]; if (!((__c) != tcc_type)) tree_class_check_failed (__t, tcc_type, "../../gcc.llvm.master/gcc/llvm-backend.cpp", 491, __FUNCTION__); __t; })->common.constant_flag) || ((enum tree_code) ((__extension__ ({ const tree __t = (decl); if (tree_code_type[(int) (((enum tree_code) (__t)->common.code))] != (tcc_declaration)) tree_class_check_failed (__t, (tcc_declaration), "../../gcc.llvm.master/gcc/llvm-backend.cpp", 491, __FUNCTION__); __t; })->decl.initial))->common.code) == STRING_CST) && "Global initializer should be constant!"' failed. p.c:0: internal compiler error: Aborted With my patch this produces the following LLVM: ; ModuleID = 'p.c' target datalayout = "e-p:32:32" target endian = little target pointersize = 32 target triple = "i686-pc-linux-gnu" %p = global i32* null ; [#uses=0] %llvm.global_ctors = appending global [0 x { i32, void ()* }] zeroinitializer ; <[0 x { i32, void ()* }]*> [#uses=0] implementation ; Functions: I think this is wrong, because the initializer is not static as it should be. This was a problem with the original gcc patch too (svn revision 109035; equivalent to the patch I sent), leading to a subsequent much larger patch (svn revision 109075). So if you consider this bug worth fixing in C++, then both patches need to be backported (only the patch I sent is needed for Ada, see comments later). To put some perspective on this, I put a noisy abort statement in this code path and compiled as much C++ as I had easily available: I bootstrapped the compiler, built LLVM, ran the testsuite, and built the boost libraries. The abort was never triggered, so it seems that this kind of code is rare in C++. However this construct is often produced by the Ada front-end. In fact it triggered the LLVM assert in the very first Ada file compiled when bootstrapping! So this patch is needed if you want to get anywhere with Ada. Historically, additional changes were needed for the Ada front-end too, however I am working with a backport of the Ada front-end from gcc 4.3, so those fixes are already in there. (I'm not using the 4.0 Ada f-e because it was notoriously weak, producing all kinds of bogus trees). My preference is to backport the complete patch set. I have some questions about this though: (1) where should the testcase go? Presumably in the llvm copy of the testsuite; (2) should the gcc changelog entries be backported too? (3) how to test? I have no C++ code that exercises these code paths except for the testcase above. I have plenty of Ada but that's useless for the moment since Ada doesn't build. I propose that I check that the testcase produces appropriate LLVM, and check that the changes don't produce any new build failures in the collection of C++ I build before. What do you think? All the best, Duncan. From jlaskey at apple.com Tue Jan 23 05:56:37 2007 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 23 Jan 2007 07:56:37 -0400 Subject: [llvm-commits] llvm-gcc4: use langhooks rather than front-end calls in i386.c In-Reply-To: <200701230840.05180.baldrick@free.fr> References: <200701172155.32302.baldrick@free.fr> <200701201543.27491.baldrick@free.fr> <92A23398-EB67-44BA-9673-5556ADAB46EA@apple.com> <200701230840.05180.baldrick@free.fr> Message-ID: The server has been been failing quite a bit over the last month and the cron rsync of the mirror is one of the last things that gets restored after bring up. The good news is that the server was replaced on the weekend. Cheers, -- Jim On 23-Jan-07, at 03:40 AM, Duncan Sands wrote: > On Monday 22 January 2007 21:06, Devang Patel wrote: >> >> On Jan 20, 2007, at 6:43 AM, Duncan Sands wrote: >> >>> Hi Devang, thanks for reviewing these patches. >>> >>>> Applied, after adding "APPLE LOCAL llvm" markers. >>> >>> This hasn't turned up in the llvm-gcc4 svn repository >>> yet. Did you apply it there or to some other tree? >>> (I'm waiting for it to turn up, so I can see how the >>> APPLE markers should be done). >> >> Do you see this change ? On my side, svn commit succeeded >> on 18th and this change should show up in mirror next day. > > It turned up on the 21st. This is not the first time recently > that I've observed the mirror to be several days behind. > > Best wishes, > > Duncan. > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070123/3cd408d7/attachment.bin From asl at math.spbu.ru Tue Jan 23 06:36:01 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 23 Jan 2007 06:36:01 -0600 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html LangRef.html ReleaseNotes.html Message-ID: <200701231236.l0NCa17T012282@zion.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.151 -> 1.152 LangRef.html updated: 1.202 -> 1.203 ReleaseNotes.html updated: 1.366 -> 1.367 --- Log message: Updating documentation: - Document visibility stuff - Fix gcc' supported attributes list - Document udis86 configure option --- Diffs of the changes: (+59 -17) GettingStarted.html | 7 ++++++- LangRef.html | 50 ++++++++++++++++++++++++++++++++++++++++++++------ ReleaseNotes.html | 19 +++++++++---------- 3 files changed, 59 insertions(+), 17 deletions(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.151 llvm/docs/GettingStarted.html:1.152 --- llvm/docs/GettingStarted.html:1.151 Thu Jan 4 01:08:27 2007 +++ llvm/docs/GettingStarted.html Tue Jan 23 06:35:46 2007 @@ -849,6 +849,11 @@ documentation from the source code. This is disabled by default because generating the documentation can take a long time and producess 100s of megabytes of output. +
    --with-udis86
    +
    LLVM can use external disassembler library for various purposes (now it's + used only for examining code produced by JIT). This option will enable usage + of udis86 x86 (both 32 and 64 + bits) disassembler library.

    To configure LLVM, follow these steps:

    @@ -1626,7 +1631,7 @@ Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/01/04 07:08:27 $ + Last modified: $Date: 2007/01/23 12:35:46 $ Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.202 llvm/docs/LangRef.html:1.203 --- llvm/docs/LangRef.html:1.202 Sat Jan 20 18:29:25 2007 +++ llvm/docs/LangRef.html Tue Jan 23 06:35:46 2007 @@ -580,6 +580,40 @@ + +
    + +

    +All Global Variables and Functions have one of the following visibility styles: +

    + +
    +
    "default" - Default style:
    + +
    On ELF, default visibility means that the declaration is visible to other + modules and, in shared libraries, means that the declared entity may be + overridden. On Darwin, default visibility means that the declaration is + visible to other modules. Default visibility corresponds to "external + linkage" in the language. +
    + +
    "hidden" - Hidden style:
    + +
    Two declarations of an object with hidden visibility refer to the same + object if they are in the same shared object. Usually, hidden visibility + indicates that the symbol will not be placed into the dynamic symbol table, + so no other module (executable or shared library) can reference it + directly. +
    + +
    + +
    + + + @@ -638,14 +672,18 @@

    LLVM function definitions consist of the "define" keyord, an optional linkage type, an optional +visibility style, an optional calling convention, a return type, an optional parameter attribute for the return type, a function name, a (possibly empty) argument list (each with optional -parameter attributes), an optional section, an -optional alignment, an opening curly brace, a list of basic blocks, and a -closing curly brace. LLVM function declarations -consist of the "declare" keyword, an optional calling convention, a return type, an optional +parameter attributes), an optional section, an +optional alignment, an opening curly brace, a list of basic blocks, and a +closing curly brace. + +LLVM function declarations consist of the "declare" keyword, an +optional linkage type, an optional +visibility style, an optional +calling convention, a return type, an optional parameter attribute for the return type, a function name, a possibly empty list of arguments, and an optional alignment.

    @@ -4481,7 +4519,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/01/21 00:29:25 $ + Last modified: $Date: 2007/01/23 12:35:46 $ Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.366 llvm/docs/ReleaseNotes.html:1.367 --- llvm/docs/ReleaseNotes.html:1.366 Sat Nov 18 02:04:48 2006 +++ llvm/docs/ReleaseNotes.html Tue Jan 23 06:35:46 2007 @@ -510,27 +510,26 @@ Supported: constructor, destructor, deprecated, fastcall, format, format_arg, non_null, noreturn, - stdcall, unused, used, - warn_unused_result, weak
    + section, stdcall, unused, used, + visibility, warn_unused_result, weak
    Ignored: noinline, always_inline, pure, const, nothrow, malloc, no_instrument_function, cdecl
    - Unsupported: section, alias, - visibility, regparm, all other target specific + Unsupported: alias, regparm, all other target specific attributes
  • Variable Attributes: Specifying attributes of variables.
    Supported: cleanup, common, nocommon, - deprecated, dllimport, - dllexport, transparent_union, - unused, used, weak
    + deprecated, dllimport, dllexport, + section, transparent_union, unused, + used, weak
    Unsupported: aligned, mode, packed, - section, shared, tls_model, - vector_size, all target specific attributes. + shared, tls_model, + vector_size, all target specific attributes.
  • Type Attributes: Specifying attributes of types.
    @@ -681,7 +680,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2006/11/18 08:04:48 $ + Last modified: $Date: 2007/01/23 12:35:46 $ From asl at math.spbu.ru Tue Jan 23 06:44:09 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 23 Jan 2007 06:44:09 -0600 Subject: [llvm-commits] CVS: llvm/docs/BytecodeFormat.html Message-ID: <200701231244.l0NCi9Qo012483@zion.cs.uiuc.edu> Changes in directory llvm/docs: BytecodeFormat.html updated: 1.59 -> 1.60 --- Log message: One more small fix to documentation --- Diffs of the changes: (+6 -2) BytecodeFormat.html | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/docs/BytecodeFormat.html diff -u llvm/docs/BytecodeFormat.html:1.59 llvm/docs/BytecodeFormat.html:1.60 --- llvm/docs/BytecodeFormat.html:1.59 Fri Jan 12 13:20:46 2007 +++ llvm/docs/BytecodeFormat.html Tue Jan 23 06:43:53 2007 @@ -1492,9 +1492,13 @@ 2=Appending, 3=Internal, 4=LinkOnce, 5=DllImport, 6=DllExport1 - bit(16-31) + bit(16-18) Visibility style: 0=Default, 1=Hidden. + + bit(19-31) + Reid Spencer and Chris Lattner
    The LLVM Compiler Infrastructure
    -Last modified: $Date: 2007/01/12 19:20:46 $ +Last modified: $Date: 2007/01/23 12:43:53 $ From asl at math.spbu.ru Tue Jan 23 07:13:18 2007 From: asl at math.spbu.ru (Anton Korobeynikov) Date: Tue, 23 Jan 2007 16:13:18 +0300 Subject: [llvm-commits] InReg patch for review Message-ID: <1169557998.14117.151.camel@asl.dorms.spbu.ru> Hello, Everyone. Attached patch will implement "inreg" function argument attribute, which is used to tell backend "place this argument in register, if possible". The needed changes in x86 backend were made as well. This also allowed to merge C & StdCall CCs and Fast & FastCall CCs inside x86 backend. This patch is first step for supporting gcc's "regparm" function attribute. -- With best regards, Anton Korobeynikov. Faculty of Mathematics & Mechanics, Saint Petersburg State University. -------------- next part -------------- A non-text attachment was scrubbed... Name: huge.diff Type: text/x-patch Size: 67084 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070123/48b03950/attachment.bin From evan.cheng at apple.com Tue Jan 23 11:49:49 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 11:49:49 -0600 Subject: [llvm-commits] CVS: llvm/test/CFrontend/cast-to-bool.c Message-ID: <200701231749.l0NHnnQH018204@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: cast-to-bool.c updated: 1.2 -> 1.3 --- Log message: Fix test case. --- Diffs of the changes: (+1 -1) cast-to-bool.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CFrontend/cast-to-bool.c diff -u llvm/test/CFrontend/cast-to-bool.c:1.2 llvm/test/CFrontend/cast-to-bool.c:1.3 --- llvm/test/CFrontend/cast-to-bool.c:1.2 Sun Nov 26 23:08:03 2006 +++ llvm/test/CFrontend/cast-to-bool.c Tue Jan 23 11:49:33 2007 @@ -1,5 +1,5 @@ // RUN: %llvmgcc -S %s -o - | grep 'trunc.*to bool' -// RUN: %llvmgcc -S %s -o - | llvm-as | llc -march=x86 | grep 'test.*1' +// RUN: %llvmgcc -S %s -o - | llvm-as | opt -instcombine | llc -march=x86 | grep 'test.*1' int main ( int argc, char** argv) { From clattner at apple.com Tue Jan 23 12:35:08 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 23 Jan 2007 10:35:08 -0800 Subject: [llvm-commits] llvm-gcc4: implement FLOOR_MOD_EXPR and ROUND_DIV_EXPR In-Reply-To: <200701191409.05578.baldrick@free.fr> References: <200701191409.05578.baldrick@free.fr> Message-ID: <94A36CE0-1939-47D5-813A-F22C5BF8730B@apple.com> On Jan 19, 2007, at 5:09 AM, Duncan Sands wrote: > FLOOR_MOD_EXPR is generated by the Ada and Fortran front-ends. > ROUND_DIV_EXPR is only generated by the Ada front-end. > > Tested by taking all possible combinations of 8 bit signed and > unsigned > input operands, and checking that the results coincide with those > produced > by mainline gcc. Looks great, applied, thanks! -Chris From clattner at apple.com Tue Jan 23 12:52:17 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 23 Jan 2007 10:52:17 -0800 Subject: [llvm-commits] llvm-gcc4: gimplifier fixes In-Reply-To: <200701231153.24317.baldrick@free.fr> References: <200701172216.06669.baldrick@free.fr> <200701231153.24317.baldrick@free.fr> Message-ID: <6A8B1430-2458-48D9-BD23-186C2189E727@apple.com> > Hi Devang, you are right that this effects C++ also: in rare cases C++ > produces expressions of type address_of_static_constructor. This > currently > causes llvm-gcc4 to abort, at least with the testcase below. With > my patch > it no longer aborts, so the danger is that wrong code may be > produced. Here > is the testcase from gcc PR c++/23171: > > p.c: > int *p = (int*)(int[1]){0}; > > Without my patch: > > $ g++ -c -O p.c > llvm-backend.cpp:491: void emit_global_to_llvm(tree_node*): > Assertion `((__extension__ ({ const tree __t = ((__extension__ > ({ const tree __t = (decl); if (tree_code_type[(int) (((enum > tree_code) (__t) Yuck. > With my patch this produces the following LLVM: > > ; ModuleID = 'p.c' > target datalayout = "e-p:32:32" > target endian = little > target pointersize = 32 > target triple = "i686-pc-linux-gnu" > %p = global i32* null ; [#uses=0] > %llvm.global_ctors = appending global [0 x { i32, void ()* }] > zeroinitializer ; <[0 x { i32, void ()* }]*> [#uses=0] > > implementation ; Functions: > > I think this is wrong, because the initializer is not static as it > should be. > This was a problem with the original gcc patch too (svn revision > 109035; equivalent > to the patch I sent), leading to a subsequent much larger patch > (svn revision 109075). This is definitely wrong. I get this machine code with native GCC for this test: .globl _p .data _p: .long LC0 .const LC0: .long 0 This basically corresponds to LLVM like this: %tmp = constant i32 0 %p = global i32* %tmp > So if you consider this bug worth fixing in C++, then both patches > need to be backported > (only the patch I sent is needed for Ada, see comments later). Yeah, it definitely is worth fixing :) > To put some perspective on this, I put a noisy abort statement in > this code path and > compiled as much C++ as I had easily available: I bootstrapped the > compiler, built LLVM, > ran the testsuite, and built the boost libraries. The abort was > never triggered, so it > seems that this kind of code is rare in C++. Ok, but while rare, it still can happen, thus it's still a bug :( > However this construct is often produced by the Ada front-end. In > fact it triggered the > LLVM assert in the very first Ada file compiled when > bootstrapping! So this patch is > needed if you want to get anywhere with Ada. Historically, > additional changes were needed > for the Ada front-end too, however I am working with a backport of > the Ada front-end from > gcc 4.3, so those fixes are already in there. (I'm not using the > 4.0 Ada f-e because it > was notoriously weak, producing all kinds of bogus trees). Right. > My preference is to backport the complete patch set. I have some > questions about this > though: > (1) where should the testcase go? Presumably in the llvm copy of > the testsuite; llvm/test/C++Frontend you can add a new llvm/test/AdaFrontend as well eventually. > (2) should the gcc changelog entries be backported too? This is up to Devang :) > (3) how to test? I have no C++ code that exercises these code > paths except for the > testcase above. I have plenty of Ada but that's useless for the > moment since Ada > doesn't build. I propose that I check that the testcase produces > appropriate LLVM, > and check that the changes don't produce any new build failures in > the collection of > C++ I build before. Testing the code with the testcase above and Ada tests seem fine. -Chris From dpatel at apple.com Tue Jan 23 12:56:03 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 23 Jan 2007 10:56:03 -0800 Subject: [llvm-commits] llvm-gcc4: gimplifier fixes In-Reply-To: <6A8B1430-2458-48D9-BD23-186C2189E727@apple.com> References: <200701172216.06669.baldrick@free.fr> <200701231153.24317.baldrick@free.fr> <6A8B1430-2458-48D9-BD23-186C2189E727@apple.com> Message-ID: <18997F9E-BC51-4934-8436-E1EEA011DF48@apple.com> On Jan 23, 2007, at 10:52 AM, Chris Lattner wrote: >> (2) should the gcc changelog entries be backported too? > Yes. If this patch causes confusion when llvm-gcc is synchronized with GCC-4.2 (or higher) then ChangeLog entry is a quick way to find relevant patches and discussions. - Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070123/ce2b5f97/attachment.html From evan.cheng at apple.com Tue Jan 23 13:06:19 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 13:06:19 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp Message-ID: <200701231906.l0NJ6JD4019467@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMTargetAsmInfo.cpp updated: 1.6 -> 1.7 --- Log message: Darwin HiddenDirective is .private_extern. --- Diffs of the changes: (+1 -0) ARMTargetAsmInfo.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.6 llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.7 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.6 Fri Jan 19 13:23:47 2007 +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp Tue Jan 23 13:06:03 2007 @@ -25,6 +25,7 @@ ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill SetDirective = "\t.set"; WeakRefDirective = "\t.weak_reference\t"; + HiddenDirective = "\t.private_extern\t"; JumpTableDataSection = ".const"; CStringSection = "\t.cstring"; LCOMMDirective = "\t.lcomm\t"; From dpatel at apple.com Tue Jan 23 15:52:51 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 23 Jan 2007 15:52:51 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h Message-ID: <200701232152.l0NLqpgK022237@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.7 -> 1.8 --- Log message: Add CallGraphSCCPass::assignPassManager(). This enables CalLGraphPassManager. --- Diffs of the changes: (+4 -0) CallGraphSCCPass.h | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.7 llvm/include/llvm/CallGraphSCCPass.h:1.8 --- llvm/include/llvm/CallGraphSCCPass.h:1.7 Thu Apr 21 15:11:51 2005 +++ llvm/include/llvm/CallGraphSCCPass.h Tue Jan 23 15:52:35 2007 @@ -27,6 +27,7 @@ class CallGraphNode; class CallGraph; +class PMStack; struct CallGraphSCCPass : public ModulePass { @@ -54,6 +55,9 @@ /// virtual bool runOnModule(Module &M); + /// Assign pass manager to manager this pass + virtual void assignPassManager(PMStack &PMS, + PassManagerType PMT = PMT_CallGraphPassManager); /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should From dpatel at apple.com Tue Jan 23 15:52:53 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 23 Jan 2007 15:52:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Message-ID: <200701232152.l0NLqrvO022242@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraphSCCPass.cpp updated: 1.11 -> 1.12 --- Log message: Add CallGraphSCCPass::assignPassManager(). This enables CalLGraphPassManager. --- Diffs of the changes: (+38 -0) CallGraphSCCPass.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+) Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.11 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.12 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.11 Wed Jan 17 15:45:01 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Tue Jan 23 15:52:35 2007 @@ -144,6 +144,44 @@ return Changed; } +/// Assign pass manager to manager this pass +void CallGraphSCCPass::assignPassManager(PMStack &PMS, + PassManagerType PreferredType) { + // Find CGPassManager + while (!PMS.empty()) { + if (PMS.top()->getPassManagerType() > PMT_CallGraphPassManager) + PMS.pop(); + else; + break; + } + + CGPassManager *CGP = dynamic_cast(PMS.top()); + + // Create new Call Graph SCC Pass Manager if it does not exist. + if (!CGP) { + + assert (!PMS.empty() && "Unable to create Call Graph Pass Manager"); + PMDataManager *PMD = PMS.top(); + + // [1] Create new Call Graph Pass Manager + CGP = new CGPassManager(PMD->getDepth() + 1); + + // [2] Set up new manager's top level manager + PMTopLevelManager *TPM = PMD->getTopLevelManager(); + TPM->addIndirectPassManager(CGP); + + // [3] Assign manager to manage this new manager. This may create + // and push new managers into PMS + Pass *P = dynamic_cast(CGP); + P->assignPassManager(PMS); + + // [4] Push new manager into PMS + PMS.push(CGP); + } + + CGP->add(this); +} + /// getAnalysisUsage - For this class, we declare that we require and preserve /// the call graph. If the derived class implements this method, it should /// always explicitly call the implementation here. From dpatel at apple.com Tue Jan 23 15:55:33 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 23 Jan 2007 15:55:33 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Message-ID: <200701232155.l0NLtXeS022299@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraphSCCPass.cpp updated: 1.12 -> 1.13 --- Log message: Fix typo. --- Diffs of the changes: (+1 -1) CallGraphSCCPass.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.12 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.13 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.12 Tue Jan 23 15:52:35 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Tue Jan 23 15:55:17 2007 @@ -144,7 +144,7 @@ return Changed; } -/// Assign pass manager to manager this pass +/// Assign pass manager to manage this pass. void CallGraphSCCPass::assignPassManager(PMStack &PMS, PassManagerType PreferredType) { // Find CGPassManager From evan.cheng at apple.com Tue Jan 23 16:48:14 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 16:48:14 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/ldr_ext.ll Message-ID: <200701232248.l0NMmEpj023281@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: ldr_ext.ll updated: 1.1 -> 1.2 --- Log message: Thumb test cases. --- Diffs of the changes: (+25 -21) ldr_ext.ll | 46 +++++++++++++++++++++++++--------------------- 1 files changed, 25 insertions(+), 21 deletions(-) Index: llvm/test/CodeGen/ARM/ldr_ext.ll diff -u llvm/test/CodeGen/ARM/ldr_ext.ll:1.1 llvm/test/CodeGen/ARM/ldr_ext.ll:1.2 --- llvm/test/CodeGen/ARM/ldr_ext.ll:1.1 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/ldr_ext.ll Tue Jan 23 16:47:58 2007 @@ -1,29 +1,33 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldrb" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldrsb" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldrh" | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldrsh" | wc -l | grep 1 +; RUN: llvm-as < %s | llc -march=arm && +; RUN: llvm-as < %s | llc -march=arm | grep "ldrb" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep "ldrh" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep "ldrsb" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm | grep "ldrsh" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep "ldrb" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep "ldrh" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep "ldrsb" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep "ldrsh" | wc -l | grep 1 -int %test1(ubyte* %v) { - %tmp = load ubyte* %v - %tmp1 = cast ubyte %tmp to int - ret int %tmp1 +define i32 %test1(i8* %v.pntr.s0.u1) { + %tmp.u = load i8* %v.pntr.s0.u1 + %tmp1.s = zext i8 %tmp.u to i32 + ret i32 %tmp1.s } -int %test2(ushort* %v) { - %tmp = load ushort* %v - %tmp1 = cast ushort %tmp to int - ret int %tmp1 +define i32 %test2(i16* %v.pntr.s0.u1) { + %tmp.u = load i16* %v.pntr.s0.u1 + %tmp1.s = zext i16 %tmp.u to i32 + ret i32 %tmp1.s } -int %test3(sbyte* %v) { - %tmp = load sbyte* %v - %tmp1 = cast sbyte %tmp to int - ret int %tmp1 +define i32 %test3(i8* %v.pntr.s1.u0) { + %tmp.s = load i8* %v.pntr.s1.u0 + %tmp1.s = sext i8 %tmp.s to i32 + ret i32 %tmp1.s } -int %test4(short* %v) { - %tmp = load short* %v - %tmp1 = cast short %tmp to int - ret int %tmp1 +define i32 %test4() { + %tmp.s = load i16* null + %tmp1.s = sext i16 %tmp.s to i32 + ret i32 %tmp1.s } From dpatel at apple.com Tue Jan 23 16:56:44 2007 From: dpatel at apple.com (Devang Patel) Date: Tue, 23 Jan 2007 16:56:44 -0600 Subject: [llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html Message-ID: <200701232256.l0NMuiFR023484@zion.cs.uiuc.edu> Changes in directory llvm/docs: WritingAnLLVMPass.html updated: 1.51 -> 1.52 --- Log message: Fix cut-n-pasto. --- Diffs of the changes: (+7 -7) WritingAnLLVMPass.html | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/docs/WritingAnLLVMPass.html diff -u llvm/docs/WritingAnLLVMPass.html:1.51 llvm/docs/WritingAnLLVMPass.html:1.52 --- llvm/docs/WritingAnLLVMPass.html:1.51 Thu Dec 7 14:04:41 2006 +++ llvm/docs/WritingAnLLVMPass.html Tue Jan 23 16:56:28 2007 @@ -29,10 +29,10 @@
  • The CallGraphSCCPass class
  • The FunctionPass class @@ -534,14 +534,14 @@
    -  virtual bool doInitialization(Module &M);
    +  virtual bool doInitialization(CallGraph &CG);
     

    The doIninitialize method is allowed to do most of the things that @@ -573,14 +573,14 @@

    -  virtual bool doFinalization(Module &M);
    +  virtual bool doFinalization(CallGraph &CG);
     

    The doFinalization method is an infrequently used method that is @@ -1711,7 +1711,7 @@ Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2006/12/07 20:04:41 $ + Last modified: $Date: 2007/01/23 22:56:28 $ From evan.cheng at apple.com Tue Jan 23 16:59:29 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 16:59:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMISelDAGToDAG.cpp ARMInstrThumb.td Message-ID: <200701232259.l0NMxTf5023535@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.45 -> 1.46 ARMISelDAGToDAG.cpp updated: 1.99 -> 1.100 ARMInstrThumb.td updated: 1.1 -> 1.2 --- Log message: - Reorg Thumb load / store instructions. Combine each rr and ri pair of instructions into one (e.g. tLDRrr, tLDRri -> tLDR). - Thumb ldrsb and ldrsh only have the [reg, reg] address format. If the address is not an add, materialize a 0 immediate into a register and use it as the offset field. --- Diffs of the changes: (+118 -110) ARMAsmPrinter.cpp | 29 +++++++---- ARMISelDAGToDAG.cpp | 67 ++++++++++++++++---------- ARMInstrThumb.td | 132 ++++++++++++++++++++++------------------------------ 3 files changed, 118 insertions(+), 110 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.45 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.46 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.45 Fri Jan 19 13:25:36 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Tue Jan 23 16:59:13 2007 @@ -98,9 +98,9 @@ void printThumbAddrModeRROperand(const MachineInstr *MI, int OpNo); void printThumbAddrModeRI5Operand(const MachineInstr *MI, int OpNo, unsigned Scale); - void printThumbAddrModeRI5_1Operand(const MachineInstr *MI, int OpNo); - void printThumbAddrModeRI5_2Operand(const MachineInstr *MI, int OpNo); - void printThumbAddrModeRI5_4Operand(const MachineInstr *MI, int OpNo); + void printThumbAddrModeS1Operand(const MachineInstr *MI, int OpNo); + void printThumbAddrModeS2Operand(const MachineInstr *MI, int OpNo); + void printThumbAddrModeS4Operand(const MachineInstr *MI, int OpNo); void printThumbAddrModeSPOperand(const MachineInstr *MI, int OpNo); void printCCOperand(const MachineInstr *MI, int opNum); void printPCLabel(const MachineInstr *MI, int opNum); @@ -518,7 +518,7 @@ ARMAsmPrinter::printThumbAddrModeRI5Operand(const MachineInstr *MI, int Op, unsigned Scale) { const MachineOperand &MO1 = MI->getOperand(Op); - const MachineOperand &MO2 = MI->getOperand(Op+1); + const MachineOperand &MO2 = MI->getOperand(Op+2); if (!MO1.isRegister()) { // FIXME: This is for CP entries, but isn't right. printOperand(MI, Op); @@ -535,16 +535,25 @@ } void -ARMAsmPrinter::printThumbAddrModeRI5_1Operand(const MachineInstr *MI, int Op) { - printThumbAddrModeRI5Operand(MI, Op, 1); +ARMAsmPrinter::printThumbAddrModeS1Operand(const MachineInstr *MI, int Op) { + if (MI->getOperand(Op+1).getReg()) + printThumbAddrModeRROperand(MI, Op); + else + printThumbAddrModeRI5Operand(MI, Op, 1); } void -ARMAsmPrinter::printThumbAddrModeRI5_2Operand(const MachineInstr *MI, int Op) { - printThumbAddrModeRI5Operand(MI, Op, 2); +ARMAsmPrinter::printThumbAddrModeS2Operand(const MachineInstr *MI, int Op) { + if (MI->getOperand(Op+1).getReg()) + printThumbAddrModeRROperand(MI, Op); + else + printThumbAddrModeRI5Operand(MI, Op, 2); } void -ARMAsmPrinter::printThumbAddrModeRI5_4Operand(const MachineInstr *MI, int Op) { - printThumbAddrModeRI5Operand(MI, Op, 4); +ARMAsmPrinter::printThumbAddrModeS4Operand(const MachineInstr *MI, int Op) { + if (MI->getOperand(Op+1).getReg()) + printThumbAddrModeRROperand(MI, Op); + else + printThumbAddrModeRI5Operand(MI, Op, 4); } void ARMAsmPrinter::printThumbAddrModeSPOperand(const MachineInstr *MI,int Op) { Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.99 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.100 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.99 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jan 23 16:59:13 2007 @@ -71,12 +71,12 @@ bool SelectThumbAddrModeRR(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset); - bool SelectThumbAddrModeRI5_1(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset); - bool SelectThumbAddrModeRI5_2(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset); - bool SelectThumbAddrModeRI5_4(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset); + bool SelectThumbAddrModeS1(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Offset, SDOperand &OffImm); + bool SelectThumbAddrModeS2(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Offset, SDOperand &OffImm); + bool SelectThumbAddrModeS4(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Offset, SDOperand &OffImm); bool SelectThumbAddrModeSP(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset); @@ -340,8 +340,16 @@ bool ARMDAGToDAGISel::SelectThumbAddrModeRR(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset){ - if (N.getOpcode() != ISD::ADD) - return false; + if (N.getOpcode() != ISD::ADD) { + Base = N; + // We must materialize a zero in a reg! Returning an constant here won't + // work since its node is -1 so it won't get added to the selection queue. + // Explicitly issue a tMOVri8 node! + Offset = SDOperand(CurDAG->getTargetNode(ARM::tMOVri8, MVT::i32, + CurDAG->getTargetConstant(0, MVT::i32)), 0); + return true; + } + Base = N.getOperand(0); Offset = N.getOperand(1); return true; @@ -349,13 +357,15 @@ static bool SelectThumbAddrModeRI5(SDOperand N, unsigned Scale, TargetLowering &TLI, SelectionDAG *CurDAG, - SDOperand &Base, SDOperand &Offset) { + SDOperand &Base, SDOperand &Offset, + SDOperand &OffImm) { if (N.getOpcode() == ISD::FrameIndex) return false; if (N.getOpcode() != ISD::ADD) { Base = (N.getOpcode() == ARMISD::Wrapper) ? N.getOperand(0) : N; - Offset = CurDAG->getTargetConstant(0, MVT::i32); + Offset = CurDAG->getRegister(0, MVT::i32); + OffImm = CurDAG->getTargetConstant(0, MVT::i32); return true; } @@ -366,28 +376,35 @@ RHSC /= Scale; if (RHSC >= 0 && RHSC < 32) { Base = N.getOperand(0); - Offset = CurDAG->getTargetConstant(RHSC, MVT::i32); + Offset = CurDAG->getRegister(0, MVT::i32); + OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32); return true; } } } - return false; -} - -bool ARMDAGToDAGISel::SelectThumbAddrModeRI5_1(SDOperand Op, SDOperand N, - SDOperand &Base, SDOperand &Offset){ - return SelectThumbAddrModeRI5(N, 1, TLI, CurDAG, Base, Offset); -} - -bool ARMDAGToDAGISel::SelectThumbAddrModeRI5_2(SDOperand Op, SDOperand N, - SDOperand &Base, SDOperand &Offset){ - return SelectThumbAddrModeRI5(N, 2, TLI, CurDAG, Base, Offset); + Base = N.getOperand(0); + Offset = N.getOperand(1); + OffImm = CurDAG->getTargetConstant(0, MVT::i32); + return true; } -bool ARMDAGToDAGISel::SelectThumbAddrModeRI5_4(SDOperand Op, SDOperand N, - SDOperand &Base, SDOperand &Offset){ - return SelectThumbAddrModeRI5(N, 4, TLI, CurDAG, Base, Offset); +bool ARMDAGToDAGISel::SelectThumbAddrModeS1(SDOperand Op, SDOperand N, + SDOperand &Base, SDOperand &Offset, + SDOperand &OffImm) { + return SelectThumbAddrModeRI5(N, 1, TLI, CurDAG, Base, Offset, OffImm); +} + +bool ARMDAGToDAGISel::SelectThumbAddrModeS2(SDOperand Op, SDOperand N, + SDOperand &Base, SDOperand &Offset, + SDOperand &OffImm) { + return SelectThumbAddrModeRI5(N, 2, TLI, CurDAG, Base, Offset, OffImm); +} + +bool ARMDAGToDAGISel::SelectThumbAddrModeS4(SDOperand Op, SDOperand N, + SDOperand &Base, SDOperand &Offset, + SDOperand &OffImm) { + return SelectThumbAddrModeRI5(N, 4, TLI, CurDAG, Base, Offset, OffImm); } bool ARMDAGToDAGISel::SelectThumbAddrModeSP(SDOperand Op, SDOperand N, Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.1 llvm/lib/Target/ARM/ARMInstrThumb.td:1.2 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.1 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Tue Jan 23 16:59:13 2007 @@ -114,22 +114,31 @@ let MIOperandInfo = (ops GPR:$base, GPR:$offsreg); } -// t_addrmode_ri5_{1|2|4} := reg + imm5 * {1|2|4} +// t_addrmode_s4 := reg + reg +// reg + imm5 * 4 // -def t_addrmode_ri5_1 : Operand, - ComplexPattern { - let PrintMethod = "printThumbAddrModeRI5_1Operand"; - let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm); +def t_addrmode_s4 : Operand, + ComplexPattern { + let PrintMethod = "printThumbAddrModeS4Operand"; + let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm); } -def t_addrmode_ri5_2 : Operand, - ComplexPattern { - let PrintMethod = "printThumbAddrModeRI5_2Operand"; - let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm); + +// t_addrmode_s2 := reg + reg +// reg + imm5 * 2 +// +def t_addrmode_s2 : Operand, + ComplexPattern { + let PrintMethod = "printThumbAddrModeS2Operand"; + let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm); } -def t_addrmode_ri5_4 : Operand, - ComplexPattern { - let PrintMethod = "printThumbAddrModeRI5_4Operand"; - let MIOperandInfo = (ops GPR:$base, i32imm:$offsimm); + +// t_addrmode_s1 := reg + reg +// reg + imm5 +// +def t_addrmode_s1 : Operand, + ComplexPattern { + let PrintMethod = "printThumbAddrModeS1Operand"; + let MIOperandInfo = (ops GPR:$base, GPR:$offsreg, i32imm:$offsimm); } // t_addrmode_sp := sp + imm8 * 4 @@ -191,71 +200,48 @@ // let isLoad = 1 in { -def tLDRri : TI4<(ops GPR:$dst, t_addrmode_ri5_4:$addr), - "ldr $dst, $addr", - [(set GPR:$dst, (load t_addrmode_ri5_4:$addr))]>; - -def tLDRrr : TI<(ops GPR:$dst, t_addrmode_rr:$addr), - "ldr $dst, $addr", - [(set GPR:$dst, (load t_addrmode_rr:$addr))]>; +def tLDR : TI4<(ops GPR:$dst, t_addrmode_s4:$addr), + "ldr $dst, $addr", + [(set GPR:$dst, (load t_addrmode_s4:$addr))]>; + +def tLDRB : TI1<(ops GPR:$dst, t_addrmode_s1:$addr), + "ldrb $dst, $addr", + [(set GPR:$dst, (zextloadi8 t_addrmode_s1:$addr))]>; + +def tLDRH : TI2<(ops GPR:$dst, t_addrmode_s2:$addr), + "ldrh $dst, $addr", + [(set GPR:$dst, (zextloadi16 t_addrmode_s2:$addr))]>; + +def tLDRSB : TI1<(ops GPR:$dst, t_addrmode_rr:$addr), + "ldrsb $dst, $addr", + [(set GPR:$dst, (sextloadi8 t_addrmode_rr:$addr))]>; + +def tLDRSH : TI2<(ops GPR:$dst, t_addrmode_rr:$addr), + "ldrsh $dst, $addr", + [(set GPR:$dst, (sextloadi16 t_addrmode_rr:$addr))]>; + // def tLDRpci def tLDRspi : TIs<(ops GPR:$dst, t_addrmode_sp:$addr), "ldr $dst, $addr", [(set GPR:$dst, (load t_addrmode_sp:$addr))]>; - -def tLDRBri : TI1<(ops GPR:$dst, t_addrmode_ri5_1:$addr), - "ldrb $dst, $addr", - [(set GPR:$dst, (zextloadi8 t_addrmode_ri5_1:$addr))]>; - -def tLDRBrr : TI1<(ops GPR:$dst, t_addrmode_rr:$addr), - "ldrb $dst, $addr", - [(set GPR:$dst, (zextloadi8 t_addrmode_rr:$addr))]>; - -def tLDRHri : TI2<(ops GPR:$dst, t_addrmode_ri5_2:$addr), - "ldrh $dst, $addr", - [(set GPR:$dst, (zextloadi16 t_addrmode_ri5_2:$addr))]>; - -def tLDRHrr : TI2<(ops GPR:$dst, t_addrmode_rr:$addr), - "ldrh $dst, $addr", - [(set GPR:$dst, (zextloadi16 t_addrmode_rr:$addr))]>; - -def tLDRSBrr : TI1<(ops GPR:$dst, t_addrmode_rr:$addr), - "ldrsb $dst, $addr", - [(set GPR:$dst, (sextloadi8 t_addrmode_rr:$addr))]>; - -def tLDRSHrr : TI2<(ops GPR:$dst, t_addrmode_rr:$addr), - "ldrsh $dst, $addr", - [(set GPR:$dst, (sextloadi16 t_addrmode_rr:$addr))]>; } // isLoad let isStore = 1 in { -def tSTRri : TI4<(ops GPR:$src, t_addrmode_ri5_4:$addr), - "str $src, $addr", - [(store GPR:$src, t_addrmode_ri5_4:$addr)]>; - -def tSTRrr : TI<(ops GPR:$src, t_addrmode_rr:$addr), - "str $src, $addr", - [(store GPR:$src, t_addrmode_rr:$addr)]>; +def tSTR : TI4<(ops GPR:$src, t_addrmode_s4:$addr), + "str $src, $addr", + [(store GPR:$src, t_addrmode_s4:$addr)]>; + +def tSTRB : TI1<(ops GPR:$src, t_addrmode_s1:$addr), + "strb $src, $addr", + [(truncstorei8 GPR:$src, t_addrmode_s1:$addr)]>; + +def tSTRH : TI2<(ops GPR:$src, t_addrmode_s2:$addr), + "strh $src, $addr", + [(truncstorei16 GPR:$src, t_addrmode_s2:$addr)]>; def tSTRspi : TIs<(ops GPR:$src, t_addrmode_sp:$addr), "str $src, $addr", [(store GPR:$src, t_addrmode_sp:$addr)]>; - -def tSTRBri : TI1<(ops GPR:$src, t_addrmode_ri5_1:$addr), - "strb $src, $addr", - [(truncstorei8 GPR:$src, t_addrmode_ri5_1:$addr)]>; - -def tSTRBrr : TI1<(ops GPR:$src, t_addrmode_rr:$addr), - "strb $src, $addr", - [(truncstorei8 GPR:$src, t_addrmode_rr:$addr)]>; - -def tSTRHri : TI2<(ops GPR:$src, t_addrmode_ri5_2:$addr), - "strh $src, $addr", - [(truncstorei16 GPR:$src, t_addrmode_ri5_1:$addr)]>; - -def tSTRHrr : TI2<(ops GPR:$src, t_addrmode_rr:$addr), - "strh $src, $addr", - [(truncstorei16 GPR:$src, t_addrmode_rr:$addr)]>; } //===----------------------------------------------------------------------===// @@ -491,16 +477,12 @@ def : ThumbV5Pat<(ARMcall GPR:$dst), (tBLXr GPR:$dst)>; // zextload i1 -> zextload i8 -def : ThumbPat<(zextloadi1 t_addrmode_ri5_1:$addr), - (tLDRBri t_addrmode_ri5_1:$addr)>; -def : ThumbPat<(zextloadi1 t_addrmode_rr:$addr), - (tLDRBri t_addrmode_rr:$addr)>; +def : ThumbPat<(zextloadi1 t_addrmode_s1:$addr), + (tLDRB t_addrmode_s1:$addr)>; // truncstore i1 -> truncstore i8 -def : ThumbPat<(truncstorei1 GPR:$src, t_addrmode_ri5_1:$dst), - (tSTRBri GPR:$src, t_addrmode_ri5_1:$dst)>; -def : ThumbPat<(truncstorei1 GPR:$src, t_addrmode_rr:$dst), - (tSTRBrr GPR:$src, t_addrmode_rr:$dst)>; +def : ThumbPat<(truncstorei1 GPR:$src, t_addrmode_s1:$dst), + (tSTRB GPR:$src, t_addrmode_s1:$dst)>; // Large immediate handling. From evan.cheng at apple.com Tue Jan 23 17:29:05 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 17:29:05 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/mul.ll Message-ID: <200701232329.l0NNT5Tf024099@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: mul.ll updated: 1.3 -> 1.4 --- Log message: Thumb test cases. --- Diffs of the changes: (+21 -10) mul.ll | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) Index: llvm/test/CodeGen/ARM/mul.ll diff -u llvm/test/CodeGen/ARM/mul.ll:1.3 llvm/test/CodeGen/ARM/mul.ll:1.4 --- llvm/test/CodeGen/ARM/mul.ll:1.3 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/mul.ll Tue Jan 23 17:28:50 2007 @@ -1,14 +1,25 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep mul | wc -l | grep 2 +; RUN: llvm-as < %s | llc -march=arm && +; RUN: llvm-as < %s | llc -march=arm | grep mul | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=arm | grep lsl | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep mul | wc -l | grep 3 && +; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep lsl | wc -l | grep 1 -int %f1(int %u) { -entry: - %tmp = mul int %u, %u; - ret int %tmp +define i32 %f1(i32 %u) { + %tmp = mul i32 %u, %u + ret i32 %tmp } -int %f2(int %u, int %v) { -entry: - %tmp = mul int %u, %v; - ret int %tmp +define i32 %f2(i32 %u, i32 %v) { + %tmp = mul i32 %u, %v + ret i32 %tmp +} + +define i32 %f3(i32 %u) { + %tmp = mul i32 %u, 5 + ret i32 %tmp +} + +define i32 %f4(i32 %u) { + %tmp = mul i32 %u, 4 + ret i32 %tmp } From evan.cheng at apple.com Tue Jan 23 20:21:37 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 20:21:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Message-ID: <200701240221.l0O2Lb4x027033@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.100 -> 1.101 --- Log message: Various Thumb mode load / store isel bug fixes. --- Diffs of the changes: (+38 -13) ARMISelDAGToDAG.cpp | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 38 insertions(+), 13 deletions(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.100 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.101 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.100 Tue Jan 23 16:59:13 2007 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jan 23 20:21:22 2007 @@ -71,6 +71,9 @@ bool SelectThumbAddrModeRR(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset); + bool SelectThumbAddrModeRI5(SDOperand Op, SDOperand N, unsigned Scale, + SDOperand &Base, SDOperand &Offset, + SDOperand &OffImm); bool SelectThumbAddrModeS1(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset, SDOperand &OffImm); bool SelectThumbAddrModeS2(SDOperand Op, SDOperand N, SDOperand &Base, @@ -78,7 +81,7 @@ bool SelectThumbAddrModeS4(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset, SDOperand &OffImm); bool SelectThumbAddrModeSP(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Offset); + SDOperand &OffImm); bool SelectShifterOperandReg(SDOperand Op, SDOperand N, SDOperand &A, SDOperand &B, SDOperand &C); @@ -355,13 +358,16 @@ return true; } -static bool SelectThumbAddrModeRI5(SDOperand N, unsigned Scale, - TargetLowering &TLI, SelectionDAG *CurDAG, - SDOperand &Base, SDOperand &Offset, - SDOperand &OffImm) { - if (N.getOpcode() == ISD::FrameIndex) - return false; - +bool +ARMDAGToDAGISel::SelectThumbAddrModeRI5(SDOperand Op, SDOperand N, + unsigned Scale, SDOperand &Base, + SDOperand &Offset, SDOperand &OffImm) { + if (Scale == 4) { + SDOperand TmpBase, TmpOffImm; + if (SelectThumbAddrModeSP(Op, N, TmpBase, TmpOffImm)) + return false; // We want to select tLDRspi / tSTRspi instead. + } + if (N.getOpcode() != ISD::ADD) { Base = (N.getOpcode() == ARMISD::Wrapper) ? N.getOperand(0) : N; Offset = CurDAG->getRegister(0, MVT::i32); @@ -392,29 +398,46 @@ bool ARMDAGToDAGISel::SelectThumbAddrModeS1(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset, SDOperand &OffImm) { - return SelectThumbAddrModeRI5(N, 1, TLI, CurDAG, Base, Offset, OffImm); + return SelectThumbAddrModeRI5(Op, N, 1, Base, Offset, OffImm); } bool ARMDAGToDAGISel::SelectThumbAddrModeS2(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset, SDOperand &OffImm) { - return SelectThumbAddrModeRI5(N, 2, TLI, CurDAG, Base, Offset, OffImm); + return SelectThumbAddrModeRI5(Op, N, 2, Base, Offset, OffImm); } bool ARMDAGToDAGISel::SelectThumbAddrModeS4(SDOperand Op, SDOperand N, SDOperand &Base, SDOperand &Offset, SDOperand &OffImm) { - return SelectThumbAddrModeRI5(N, 4, TLI, CurDAG, Base, Offset, OffImm); + return SelectThumbAddrModeRI5(Op, N, 4, Base, Offset, OffImm); } bool ARMDAGToDAGISel::SelectThumbAddrModeSP(SDOperand Op, SDOperand N, - SDOperand &Base, SDOperand &Offset) { + SDOperand &Base, SDOperand &OffImm) { if (N.getOpcode() == ISD::FrameIndex) { int FI = cast(N)->getIndex(); Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy()); - Offset = CurDAG->getTargetConstant(0, MVT::i32); + OffImm = CurDAG->getTargetConstant(0, MVT::i32); return true; } + + if (N.getOpcode() == ISD::ADD && + N.getOperand(0).getOpcode() == ISD::FrameIndex) { + // If the RHS is + imm8 * scale, fold into addr mode. + if (ConstantSDNode *RHS = dyn_cast(N.getOperand(1))) { + int RHSC = (int)RHS->getValue(); + if ((RHSC & 3) == 0) { // The constant is implicitly multiplied. + RHSC >>= 2; + if (RHSC >= 0 && RHSC < 256) { + int FI = cast(N.getOperand(0))->getIndex(); + Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy()); + OffImm = CurDAG->getTargetConstant(RHSC, MVT::i32); + return true; + } + } + } + } return false; } @@ -492,6 +515,8 @@ CurDAG->getTargetConstant(0, MVT::i32)); } case ISD::MUL: + if (Subtarget->isThumb()) + break; if (ConstantSDNode *C = dyn_cast(Op.getOperand(1))) { unsigned RHSV = C->getValue(); if (!RHSV) break; From evan.cheng at apple.com Tue Jan 23 20:27:18 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 20:27:18 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/ldr_frame.ll Message-ID: <200701240227.l0O2RIj5027136@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: ldr_frame.ll added (r1.1) --- Log message: Added some load from stack frames test cases. --- Diffs of the changes: (+34 -0) ldr_frame.ll | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+) Index: llvm/test/CodeGen/ARM/ldr_frame.ll diff -c /dev/null llvm/test/CodeGen/ARM/ldr_frame.ll:1.1 *** /dev/null Tue Jan 23 20:27:13 2007 --- llvm/test/CodeGen/ARM/ldr_frame.ll Tue Jan 23 20:27:03 2007 *************** *** 0 **** --- 1,34 ---- + ; RUN: llvm-as < %s | llc -march=arm && + ; RUN: llvm-as < %s | llc -march=arm | not grep mov && + ; RUN: llvm-as < %s | llc -march=arm -enable-thumb && + ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep cpy | wc -l | grep 2 + + define i32 %f1() { + %buf = alloca [32 x i32], align 4 + %tmp = getelementptr [32 x i32]* %buf, i32 0, i32 0 + %tmp1 = load i32* %tmp + ret i32 %tmp1 + } + + define i32 %f2() { + %buf = alloca [32 x i8], align 4 + %tmp = getelementptr [32 x i8]* %buf, i32 0, i32 0 + %tmp1 = load i8* %tmp + %tmp2 = zext i8 %tmp1 to i32 + ret i32 %tmp2 + } + + define i32 %f3() { + %buf = alloca [32 x i32], align 4 + %tmp = getelementptr [32 x i32]* %buf, i32 0, i32 32 + %tmp1 = load i32* %tmp + ret i32 %tmp1 + } + + define i32 %f4() { + %buf = alloca [32 x i8], align 4 + %tmp = getelementptr [32 x i8]* %buf, i32 0, i32 2 + %tmp1 = load i8* %tmp + %tmp2 = zext i8 %tmp1 to i32 + ret i32 %tmp2 + } From evan.cheng at apple.com Tue Jan 23 20:45:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 23 Jan 2007 20:45:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Message-ID: <200701240245.l0O2jfhu027444@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.101 -> 1.102 --- Log message: Allow [ fi#c, imm ] as ARM load / store addresses. --- Diffs of the changes: (+39 -25) ARMISelDAGToDAG.cpp | 64 +++++++++++++++++++++++++++++++--------------------- 1 files changed, 39 insertions(+), 25 deletions(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.101 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.102 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.101 Tue Jan 23 20:21:22 2007 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jan 23 20:45:25 2007 @@ -122,17 +122,21 @@ if (N.getOpcode() == ISD::ADD) if (ConstantSDNode *RHS = dyn_cast(N.getOperand(1))) { int RHSC = (int)RHS->getValue(); - if (RHSC >= 0 && RHSC < 0x1000) { // 12 bits. - Base = N.getOperand(0); - Offset = CurDAG->getRegister(0, MVT::i32); - Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(ARM_AM::add, RHSC, - ARM_AM::no_shift), - MVT::i32); - return true; - } else if (RHSC < 0 && RHSC > -0x1000) { + if ((RHSC >= 0 && RHSC < 0x1000) || + (RHSC < 0 && RHSC > -0x1000)) { // 12 bits. Base = N.getOperand(0); + if (Base.getOpcode() == ISD::FrameIndex) { + int FI = cast(Base)->getIndex(); + Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy()); + } Offset = CurDAG->getRegister(0, MVT::i32); - Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(ARM_AM::sub, -RHSC, + + ARM_AM::AddrOpc AddSub = ARM_AM::add; + if (RHSC < 0) { + AddSub = ARM_AM::sub; + RHSC = - RHSC; + } + Opc = CurDAG->getTargetConstant(ARM_AM::getAM2Opc(AddSub, RHSC, ARM_AM::no_shift), MVT::i32); return true; @@ -245,17 +249,21 @@ // If the RHS is +/- imm8, fold into addr mode. if (ConstantSDNode *RHS = dyn_cast(N.getOperand(1))) { int RHSC = (int)RHS->getValue(); - if (RHSC >= 0 && RHSC < 256) { - Base = N.getOperand(0); - Offset = CurDAG->getRegister(0, MVT::i32); - Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::add, RHSC), - MVT::i32); - return true; - } else if (RHSC < 0 && RHSC > -256) { // note -256 itself isn't allowed. + if ((RHSC >= 0 && RHSC < 256) || + (RHSC < 0 && RHSC > -256)) { // note -256 itself isn't allowed. Base = N.getOperand(0); + if (Base.getOpcode() == ISD::FrameIndex) { + int FI = cast(Base)->getIndex(); + Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy()); + } Offset = CurDAG->getRegister(0, MVT::i32); - Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(ARM_AM::sub, -RHSC), - MVT::i32); + + ARM_AM::AddrOpc AddSub = ARM_AM::add; + if (RHSC < 0) { + AddSub = ARM_AM::sub; + RHSC = - RHSC; + } + Opc = CurDAG->getTargetConstant(ARM_AM::getAM3Opc(AddSub, RHSC),MVT::i32); return true; } } @@ -309,14 +317,20 @@ int RHSC = (int)RHS->getValue(); if ((RHSC & 3) == 0) { // The constant is implicitly multiplied by 4. RHSC >>= 2; - if (RHSC >= 0 && RHSC < 256) { - Base = N.getOperand(0); - Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(ARM_AM::add, RHSC), - MVT::i32); - return true; - } else if (RHSC < 0 && RHSC > -256) { // note -256 itself isn't allowed. + if ((RHSC >= 0 && RHSC < 256) || + (RHSC < 0 && RHSC > -256)) { // note -256 itself isn't allowed. Base = N.getOperand(0); - Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(ARM_AM::sub,-RHSC), + if (Base.getOpcode() == ISD::FrameIndex) { + int FI = cast(Base)->getIndex(); + Base = CurDAG->getTargetFrameIndex(FI, TLI.getPointerTy()); + } + + ARM_AM::AddrOpc AddSub = ARM_AM::add; + if (RHSC < 0) { + AddSub = ARM_AM::sub; + RHSC = - RHSC; + } + Offset = CurDAG->getTargetConstant(ARM_AM::getAM5Opc(AddSub, RHSC), MVT::i32); return true; } From isanbard at gmail.com Tue Jan 23 21:36:23 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:36:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetMachOWriterInfo.cpp Message-ID: <200701240336.l0O3aN7p028250@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetMachOWriterInfo.cpp added (r1.1) --- Log message: New "TargetMachOWriterInfo" class. It holds target-specific information that the MachOWriter needs in order to do its writing stuff 'n things. --- Diffs of the changes: (+23 -0) TargetMachOWriterInfo.cpp | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+) Index: llvm/lib/Target/TargetMachOWriterInfo.cpp diff -c /dev/null llvm/lib/Target/TargetMachOWriterInfo.cpp:1.1 *** /dev/null Tue Jan 23 21:36:15 2007 --- llvm/lib/Target/TargetMachOWriterInfo.cpp Tue Jan 23 21:36:05 2007 *************** *** 0 **** --- 1,23 ---- + //===-- llvm/Target/TargetMachOWriterInfo.h - MachO Writer Info -*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Bill Wendling and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the TargetMachOWriterInfo class. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Target/TargetMachOWriterInfo.h" + #include "llvm/CodeGen/MachineRelocation.h" + using namespace llvm; + + MachineRelocation + TargetMachOWriterInfo::GetJTRelocation(unsigned Offset, + MachineBasicBlock *MBB) const { + // FIXME: do something about PIC + return MachineRelocation::getBB(Offset, MachineRelocation::VANILLA, MBB); + } From isanbard at gmail.com Tue Jan 23 21:36:25 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:36:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp PPCMachOWriterInfo.h Message-ID: <200701240336.l0O3aPhY028262@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCMachOWriterInfo.cpp added (r1.1) PPCMachOWriterInfo.h added (r1.1) --- Log message: New "TargetMachOWriterInfo" class. It holds target-specific information that the MachOWriter needs in order to do its writing stuff 'n things. --- Diffs of the changes: (+57 -0) PPCMachOWriterInfo.cpp | 22 ++++++++++++++++++++++ PPCMachOWriterInfo.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) Index: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp diff -c /dev/null llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp:1.1 *** /dev/null Tue Jan 23 21:36:15 2007 --- llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp Tue Jan 23 21:36:05 2007 *************** *** 0 **** --- 1,22 ---- + //===-- PPCMachOWriterInfo.cpp - Mach-O Writer Info for the PowerPC -------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Bill Wendling and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements Mach-O writer information for the PowerPC backend. + // + //===----------------------------------------------------------------------===// + + #include "PPCMachOWriterInfo.h" + #include "PPCTargetMachine.h" + using namespace llvm; + + PPCMachOWriterInfo::PPCMachOWriterInfo(const PPCTargetMachine &TM) + : TargetMachOWriterInfo(TM.getTargetData()->getPointerSizeInBits() == 64 ? + HDR_CPU_TYPE_POWERPC64 : + HDR_CPU_TYPE_POWERPC, + HDR_CPU_SUBTYPE_POWERPC_ALL) {} Index: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h diff -c /dev/null llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h:1.1 *** /dev/null Tue Jan 23 21:36:25 2007 --- llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h Tue Jan 23 21:36:05 2007 *************** *** 0 **** --- 1,35 ---- + //===-- PPCMachOWriterInfo.h - Mach-O Writer Info for PowerPC ---*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Bill Wendling and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements Mach-O writer information for the PowerPC backend. + // + //===----------------------------------------------------------------------===// + + #ifndef PPC_MACHO_WRITER_INFO_H + #define PPC_MACHO_WRITER_INFO_H + + #include "llvm/Target/TargetMachOWriterInfo.h" + + namespace llvm { + + // Forward declarations + class PPCTargetMachine; + + struct PPCMachOWriterInfo : public TargetMachOWriterInfo { + PPCMachOWriterInfo(const PPCTargetMachine &TM); + virtual ~PPCMachOWriterInfo() {} + + virtual const char *getPassName() const { + return "PowerPC Mach-O Writer"; + } + }; + + } // end llvm namespace + + #endif // PPC_MACHO_WRITER_INFO_H From isanbard at gmail.com Tue Jan 23 21:36:25 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:36:25 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetMachOWriterInfo.h Message-ID: <200701240336.l0O3aPCp028255@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetMachOWriterInfo.h added (r1.1) --- Log message: New "TargetMachOWriterInfo" class. It holds target-specific information that the MachOWriter needs in order to do its writing stuff 'n things. --- Diffs of the changes: (+103 -0) TargetMachOWriterInfo.h | 103 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 103 insertions(+) Index: llvm/include/llvm/Target/TargetMachOWriterInfo.h diff -c /dev/null llvm/include/llvm/Target/TargetMachOWriterInfo.h:1.1 *** /dev/null Tue Jan 23 21:36:15 2007 --- llvm/include/llvm/Target/TargetMachOWriterInfo.h Tue Jan 23 21:36:05 2007 *************** *** 0 **** --- 1,103 ---- + //===-- llvm/Target/TargetMachOWriterInfo.h - MachO Writer Info--*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Bill Wendling and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the TargetMachOWriterInfo class. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_TARGET_TARGETMACHOWRITERINFO_H + #define LLVM_TARGET_TARGETMACHOWRITERINFO_H + + #include "llvm/CodeGen/MachineRelocation.h" + + namespace llvm { + + class MachineBasicBlock; + + //===--------------------------------------------------------------------===// + // TargetMachOWriterInfo + //===--------------------------------------------------------------------===// + + struct TargetMachOWriterInfo { + uint32_t CPUType; // CPU specifier + uint32_t CPUSubType; // Machine specifier + + // The various CPU_TYPE_* constants are already defined by at least one + // system header file and create compilation errors if not respected. + #if !defined(CPU_TYPE_I386) + #define CPU_TYPE_I386 7 + #endif + #if !defined(CPU_TYPE_X86_64) + #define CPU_TYPE_X86_64 (CPU_TYPE_I386 | 0x1000000) + #endif + #if !defined(CPU_TYPE_ARM) + #define CPU_TYPE_ARM 12 + #endif + #if !defined(CPU_TYPE_SPARC) + #define CPU_TYPE_SPARC 14 + #endif + #if !defined(CPU_TYPE_POWERPC) + #define CPU_TYPE_POWERPC 18 + #endif + #if !defined(CPU_TYPE_POWERPC64) + #define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | 0x1000000) + #endif + + // Constants for the cputype field + // see + enum { + HDR_CPU_TYPE_I386 = CPU_TYPE_I386, + HDR_CPU_TYPE_X86_64 = CPU_TYPE_X86_64, + HDR_CPU_TYPE_ARM = CPU_TYPE_ARM, + HDR_CPU_TYPE_SPARC = CPU_TYPE_SPARC, + HDR_CPU_TYPE_POWERPC = CPU_TYPE_POWERPC, + HDR_CPU_TYPE_POWERPC64 = CPU_TYPE_POWERPC64 + }; + + #if !defined(CPU_SUBTYPE_I386_ALL) + #define CPU_SUBTYPE_I386_ALL 3 + #endif + #if !defined(CPU_SUBTYPE_X86_64_ALL) + #define CPU_SUBTYPE_X86_64_ALL 3 + #endif + #if !defined(CPU_SUBTYPE_ARM_ALL) + #define CPU_SUBTYPE_ARM_ALL 0 + #endif + #if !defined(CPU_SUBTYPE_SPARC_ALL) + #define CPU_SUBTYPE_SPARC_ALL 0 + #endif + #if !defined(CPU_SUBTYPE_POWERPC_ALL) + #define CPU_SUBTYPE_POWERPC_ALL 0 + #endif + + // Constants for the cpusubtype field + // see + enum { + HDR_CPU_SUBTYPE_I386_ALL = CPU_SUBTYPE_I386_ALL, + HDR_CPU_SUBTYPE_X86_64_ALL = CPU_SUBTYPE_X86_64_ALL, + HDR_CPU_SUBTYPE_ARM_ALL = CPU_SUBTYPE_ARM_ALL, + HDR_CPU_SUBTYPE_SPARC_ALL = CPU_SUBTYPE_SPARC_ALL, + HDR_CPU_SUBTYPE_POWERPC_ALL = CPU_SUBTYPE_POWERPC_ALL + }; + + TargetMachOWriterInfo(uint32_t cputype, uint32_t cpusubtype) + : CPUType(cputype), CPUSubType(cpusubtype) {} + virtual ~TargetMachOWriterInfo() {} + + virtual MachineRelocation GetJTRelocation(unsigned Offset, + MachineBasicBlock *MBB) const; + + virtual const char *getPassName() const { + return "Mach-O Writer"; + } + }; + + } // end llvm namespace + + #endif // LLVM_TARGET_TARGETMACHOWRITERINFO_H From isanbard at gmail.com Tue Jan 23 21:37:34 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:37:34 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h Message-ID: <200701240337.l0O3bYvD028292@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachOWriter.h updated: 1.14 -> 1.15 --- Log message: Moved target-specific information to the TargetMachOWriterInfo obj. --- Diffs of the changes: (+7 -62) MachOWriter.h | 69 +++++----------------------------------------------------- 1 files changed, 7 insertions(+), 62 deletions(-) Index: llvm/include/llvm/CodeGen/MachOWriter.h diff -u llvm/include/llvm/CodeGen/MachOWriter.h:1.14 llvm/include/llvm/CodeGen/MachOWriter.h:1.15 --- llvm/include/llvm/CodeGen/MachOWriter.h:1.14 Wed Jan 17 16:22:31 2007 +++ llvm/include/llvm/CodeGen/MachOWriter.h Tue Jan 23 21:37:18 2007 @@ -19,6 +19,7 @@ #include "llvm/CodeGen/MachineRelocation.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetMachOWriterInfo.h" namespace llvm { class GlobalVariable; @@ -126,8 +127,6 @@ /// specific architecture type/subtype pair that is emitted to the file. struct MachOHeader { uint32_t magic; // mach magic number identifier - uint32_t cputype; // cpu specifier - uint32_t cpusubtype; // machine specifier uint32_t filetype; // type of file uint32_t ncmds; // number of load commands uint32_t sizeofcmds; // the size of all the load commands @@ -138,62 +137,6 @@ /// up for emission to the file. DataBuffer HeaderData; - // The various CPU_TYPE_* constants are already defined by at least one - // system header file and create compilation errors if not respected. -#if !defined(CPU_TYPE_I386) -#define CPU_TYPE_I386 7 -#endif -#if !defined(CPU_TYPE_X86_64) -#define CPU_TYPE_X86_64 (CPU_TYPE_I386 | 0x1000000) -#endif -#if !defined(CPU_TYPE_ARM) -#define CPU_TYPE_ARM 12 -#endif -#if !defined(CPU_TYPE_SPARC) -#define CPU_TYPE_SPARC 14 -#endif -#if !defined(CPU_TYPE_POWERPC) -#define CPU_TYPE_POWERPC 18 -#endif -#if !defined(CPU_TYPE_POWERPC64) -#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | 0x1000000) -#endif - - // Constants for the cputype field - // see - enum { HDR_CPU_TYPE_I386 = CPU_TYPE_I386, - HDR_CPU_TYPE_X86_64 = CPU_TYPE_X86_64, - HDR_CPU_TYPE_ARM = CPU_TYPE_ARM, - HDR_CPU_TYPE_SPARC = CPU_TYPE_SPARC, - HDR_CPU_TYPE_POWERPC = CPU_TYPE_POWERPC, - HDR_CPU_TYPE_POWERPC64 = CPU_TYPE_POWERPC64 - }; - -#if !defined(CPU_SUBTYPE_I386_ALL) -#define CPU_SUBTYPE_I386_ALL 3 -#endif -#if !defined(CPU_SUBTYPE_X86_64_ALL) -#define CPU_SUBTYPE_X86_64_ALL 3 -#endif -#if !defined(CPU_SUBTYPE_ARM_ALL) -#define CPU_SUBTYPE_ARM_ALL 0 -#endif -#if !defined(CPU_SUBTYPE_SPARC_ALL) -#define CPU_SUBTYPE_SPARC_ALL 0 -#endif -#if !defined(CPU_SUBTYPE_POWERPC_ALL) -#define CPU_SUBTYPE_POWERPC_ALL 0 - -#endif - // Constants for the cpusubtype field - // see - enum { HDR_CPU_SUBTYPE_I386_ALL = CPU_SUBTYPE_I386_ALL, - HDR_CPU_SUBTYPE_X86_64_ALL = CPU_SUBTYPE_X86_64_ALL, - HDR_CPU_SUBTYPE_ARM_ALL = CPU_SUBTYPE_ARM_ALL, - HDR_CPU_SUBTYPE_SPARC_ALL = CPU_SUBTYPE_SPARC_ALL, - HDR_CPU_SUBTYPE_POWERPC_ALL = CPU_SUBTYPE_POWERPC_ALL - }; - // Constants for the filetype field // see for additional info on the various types enum { MH_OBJECT = 1, // relocatable object file @@ -261,8 +204,8 @@ // stack execution privilege. Only used in MH_EXECUTE filetype }; - MachOHeader() : magic(0), cputype(0), cpusubtype(0), filetype(0), - ncmds(0), sizeofcmds(0), flags(0), reserved(0) { } + MachOHeader() : magic(0), filetype(0), ncmds(0), sizeofcmds(0), flags(0), + reserved(0) { } /// cmdSize - This routine returns the size of the MachOSection as written /// to disk, depending on whether the destination is a 64 bit Mach-O file. @@ -671,8 +614,10 @@ void BufferSymbolAndStringTable(); void CalculateRelocations(MachOSection &MOS); - virtual MachineRelocation GetJTRelocation(unsigned Offset, - MachineBasicBlock *MBB) = 0; + MachineRelocation GetJTRelocation(unsigned Offset, + MachineBasicBlock *MBB) const { + return TM.getMachOWriterInfo()->GetJTRelocation(Offset, MBB); + } virtual void GetTargetRelocation(MachineRelocation &MR, MachOSection &From, MachOSection &To) = 0; }; From isanbard at gmail.com Tue Jan 23 21:38:30 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:38:30 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetMachine.h Message-ID: <200701240338.l0O3cUjm028319@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetMachine.h updated: 1.73 -> 1.74 --- Log message: A virtual method to return the TargetMachOWriterInfo object. This returns a real value in derived classes, of course. --- Diffs of the changes: (+6 -0) TargetMachine.h | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/Target/TargetMachine.h diff -u llvm/include/llvm/Target/TargetMachine.h:1.73 llvm/include/llvm/Target/TargetMachine.h:1.74 --- llvm/include/llvm/Target/TargetMachine.h:1.73 Wed Jan 17 03:06:13 2007 +++ llvm/include/llvm/Target/TargetMachine.h Tue Jan 23 21:38:14 2007 @@ -34,6 +34,7 @@ class FunctionPassManager; class PassManager; class Pass; +struct TargetMachOWriterInfo; // Relocation model types. namespace Reloc { @@ -143,6 +144,11 @@ return InstrItineraryData(); } + /// getMachOWriterInfo - If this target supports a Mach-O writer, return + /// information for it, otherwise return null. + /// + virtual const TargetMachOWriterInfo *getMachOWriterInfo() const { return 0; } + /// getRelocationModel - Returns the code generation relocation model. The /// choices are static, PIC, and dynamic-no-pic, and target default. static Reloc::Model getRelocationModel(); From isanbard at gmail.com Tue Jan 23 21:39:03 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:39:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.cpp Message-ID: <200701240339.l0O3d3ge028342@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachOWriter.cpp updated: 1.17 -> 1.18 --- Log message: Use the TargetMachOWriterInfo class to get this information. --- Diffs of the changes: (+2 -2) MachOWriter.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.17 llvm/lib/CodeGen/MachOWriter.cpp:1.18 --- llvm/lib/CodeGen/MachOWriter.cpp:1.17 Sat Jan 20 16:35:55 2007 +++ llvm/lib/CodeGen/MachOWriter.cpp Tue Jan 23 21:38:47 2007 @@ -461,8 +461,8 @@ OutputBuffer FHOut(FH, is64Bit, isLittleEndian); FHOut.outword(Header.magic); - FHOut.outword(Header.cputype); - FHOut.outword(Header.cpusubtype); + FHOut.outword(TM.getMachOWriterInfo()->CPUType); + FHOut.outword(TM.getMachOWriterInfo()->CPUSubType); FHOut.outword(Header.filetype); FHOut.outword(Header.ncmds); FHOut.outword(Header.sizeofcmds); From isanbard at gmail.com Tue Jan 23 21:40:49 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:40:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCMachOWriter.cpp Message-ID: <200701240340.l0O3entL028386@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCMachOWriter.cpp updated: 1.13 -> 1.14 --- Log message: Move the getJTRelocation method out of here. --- Diffs of the changes: (+7 -26) PPCMachOWriter.cpp | 33 +++++++-------------------------- 1 files changed, 7 insertions(+), 26 deletions(-) Index: llvm/lib/Target/PowerPC/PPCMachOWriter.cpp diff -u llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.13 llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.14 --- llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.13 Wed Jan 17 19:23:11 2007 +++ llvm/lib/Target/PowerPC/PPCMachOWriter.cpp Tue Jan 23 21:40:33 2007 @@ -23,23 +23,11 @@ namespace { class VISIBILITY_HIDDEN PPCMachOWriter : public MachOWriter { public: - PPCMachOWriter(std::ostream &O, PPCTargetMachine &TM) : MachOWriter(O, TM) { - if (TM.getTargetData()->getPointerSizeInBits() == 64) { - Header.cputype = MachOHeader::HDR_CPU_TYPE_POWERPC64; - } else { - Header.cputype = MachOHeader::HDR_CPU_TYPE_POWERPC; - } - Header.cpusubtype = MachOHeader::HDR_CPU_SUBTYPE_POWERPC_ALL; - } + PPCMachOWriter(std::ostream &O, PPCTargetMachine &TM) + : MachOWriter(O, TM) {} virtual void GetTargetRelocation(MachineRelocation &MR, MachOSection &From, MachOSection &To); - virtual MachineRelocation GetJTRelocation(unsigned Offset, - MachineBasicBlock *MBB); - - virtual const char *getPassName() const { - return "PowerPC Mach-O Writer"; - } // Constants for the relocation r_type field. // see @@ -67,20 +55,20 @@ /// GetTargetRelocation - For the MachineRelocation MR, convert it to one or /// more PowerPC MachORelocation(s), add the new relocations to the -/// MachOSection, and rewrite the instruction at the section offset if required +/// MachOSection, and rewrite the instruction at the section offset if required /// by that relocation type. void PPCMachOWriter::GetTargetRelocation(MachineRelocation &MR, MachOSection &From, MachOSection &To) { uint64_t Addr = 0; - + // Keep track of whether or not this is an externally defined relocation. bool isExtern = false; - + // Get the address of whatever it is we're relocating, if possible. if (!isExtern) Addr = (uintptr_t)MR.getResultPointer() + To.addr; - + switch ((PPC::RelocationType)MR.getRelocationType()) { default: assert(0 && "Unknown PPC relocation type!"); case PPC::reloc_absolute_low_ix: @@ -89,7 +77,7 @@ case PPC::reloc_vanilla: { // FIXME: need to handle 64 bit vanilla relocs - MachORelocation VANILLA(MR.getMachineCodeOffset(), To.Index, false, 2, + MachORelocation VANILLA(MR.getMachineCodeOffset(), To.Index, false, 2, isExtern, PPC_RELOC_VANILLA); ++From.nreloc; @@ -165,10 +153,3 @@ } } } - -MachineRelocation PPCMachOWriter::GetJTRelocation(unsigned Offset, - MachineBasicBlock *MBB) { - // FIXME: do something about PIC - return MachineRelocation::getBB(Offset, PPC::reloc_vanilla, MBB); -} - From isanbard at gmail.com Tue Jan 23 21:41:52 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:41:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp PPCTargetMachine.h Message-ID: <200701240341.l0O3fqcp028419@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCTargetMachine.cpp updated: 1.114 -> 1.115 PPCTargetMachine.h updated: 1.27 -> 1.28 --- Log message: Add a field for and construction of the PPCMachOWriterInfo object. --- Diffs of the changes: (+7 -2) PPCTargetMachine.cpp | 2 +- PPCTargetMachine.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.114 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.115 --- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.114 Wed Jan 17 03:06:13 2007 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp Tue Jan 23 21:41:36 2007 @@ -87,7 +87,7 @@ : Subtarget(*this, M, FS, is64Bit), DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this), FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this), - InstrItins(Subtarget.getInstrItineraryData()) { + InstrItins(Subtarget.getInstrItineraryData()), MachOWriterInfo(*this) { if (getRelocationModel() == Reloc::Default) if (Subtarget.isDarwin()) Index: llvm/lib/Target/PowerPC/PPCTargetMachine.h diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.27 llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.28 --- llvm/lib/Target/PowerPC/PPCTargetMachine.h:1.27 Wed Jan 17 03:06:13 2007 +++ llvm/lib/Target/PowerPC/PPCTargetMachine.h Tue Jan 23 21:41:36 2007 @@ -19,6 +19,7 @@ #include "PPCJITInfo.h" #include "PPCInstrInfo.h" #include "PPCISelLowering.h" +#include "PPCMachOWriterInfo.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetData.h" @@ -36,7 +37,8 @@ PPCJITInfo JITInfo; PPCTargetLowering TLInfo; InstrItineraryData InstrItins; - + PPCMachOWriterInfo MachOWriterInfo; + protected: virtual const TargetAsmInfo *createTargetAsmInfo() const; @@ -58,6 +60,9 @@ virtual const InstrItineraryData getInstrItineraryData() const { return InstrItins; } + virtual const PPCMachOWriterInfo *getMachOWriterInfo() const { + return &MachOWriterInfo; + } // Pass Pipeline Configuration virtual bool addInstSelector(FunctionPassManager &PM, bool Fast); From isanbard at gmail.com Tue Jan 23 21:42:19 2007 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 23 Jan 2007 21:42:19 -0600 Subject: [llvm-commits] CVS: llvm/Xcode/LLVM.xcodeproj/project.pbxproj Message-ID: <200701240342.l0O3gJY6028442@zion.cs.uiuc.edu> Changes in directory llvm/Xcode/LLVM.xcodeproj: project.pbxproj updated: 1.28 -> 1.29 --- Log message: Added new files. --- Diffs of the changes: (+11 -0) project.pbxproj | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/Xcode/LLVM.xcodeproj/project.pbxproj diff -u llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.28 llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.29 --- llvm/Xcode/LLVM.xcodeproj/project.pbxproj:1.28 Mon Jan 22 08:13:45 2007 +++ llvm/Xcode/LLVM.xcodeproj/project.pbxproj Tue Jan 23 21:42:03 2007 @@ -65,6 +65,10 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 84115FFE0B66D87400E1293E /* TargetMachOWriterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TargetMachOWriterInfo.cpp; sourceTree = ""; }; + 84115FFF0B66D89B00E1293E /* PPCMachOWriterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PPCMachOWriterInfo.cpp; sourceTree = ""; }; + 841160000B66D8AC00E1293E /* PPCMachOWriterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCMachOWriterInfo.h; sourceTree = ""; }; + 8443EF210B66B62D00959964 /* TargetMachOWriterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetMachOWriterInfo.h; sourceTree = ""; }; CF1ACC9709C9DE4400D3C5EB /* IntrinsicInst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IntrinsicInst.cpp; path = ../lib/VMCore/IntrinsicInst.cpp; sourceTree = ""; }; CF26835B09178F5500C5F253 /* TargetInstrItineraries.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetInstrItineraries.h; sourceTree = ""; }; CF32AF5C0AEE6A4E00D24CD4 /* LLVMTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LLVMTargetMachine.cpp; sourceTree = ""; }; @@ -1479,6 +1483,7 @@ DE66EE9608ABEE5D00323D32 /* lib/Target */ = { isa = PBXGroup; children = ( + 84115FFE0B66D87400E1293E /* TargetMachOWriterInfo.cpp */, DE66EE9708ABEE5D00323D32 /* Alpha */, CF8F1BCF0B64FC8A00BB4199 /* ARM */, DE66EEC908ABEE5E00323D32 /* CBackend */, @@ -1592,6 +1597,8 @@ DE66EF1108ABEE5E00323D32 /* PowerPC */ = { isa = PBXGroup; children = ( + 841160000B66D8AC00E1293E /* PPCMachOWriterInfo.h */, + 84115FFF0B66D89B00E1293E /* PPCMachOWriterInfo.cpp */, CFA702CB0A6FA8AD0006009A /* PPCGenAsmWriter.inc */, CFA702CC0A6FA8AD0006009A /* PPCGenCodeEmitter.inc */, CFA702CD0A6FA8AD0006009A /* PPCGenDAGISel.inc */, @@ -2151,6 +2158,7 @@ DE66F29F08ABF03200323D32 /* Target */ = { isa = PBXGroup; children = ( + 8443EF210B66B62D00959964 /* TargetMachOWriterInfo.h */, DE66F2A008ABF03200323D32 /* MRegisterInfo.h */, CF9BCD0808C74DE0001E7011 /* SubtargetFeature.h */, CF47BD380AAF40BC00A8B13E /* TargetAsmInfo.h */, @@ -2535,9 +2543,12 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = DE66EC5008ABE78900323D32 /* Build configuration list for PBXProject "LLVM" */; + compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* LLVM */; projectDirPath = ""; + projectRoot = ""; + shouldCheckCompatibility = 1; targets = ( D28A88AD04BDD90700651E21 /* LLVM */, CF0329B608D1BE110030FD33 /* LLVM lib */, From sabre at nondot.org Tue Jan 23 23:24:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 23 Jan 2007 23:24:25 -0600 Subject: [llvm-commits] CVS: llvm-www/www-index.html Message-ID: <200701240524.l0O5OPfK030093@zion.cs.uiuc.edu> Changes in directory llvm-www: www-index.html updated: 1.132 -> 1.133 --- Log message: backends have multiplied --- Diffs of the changes: (+3 -3) www-index.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm-www/www-index.html diff -u llvm-www/www-index.html:1.132 llvm-www/www-index.html:1.133 --- llvm-www/www-index.html:1.132 Mon Nov 20 01:44:49 2006 +++ llvm-www/www-index.html Tue Jan 23 23:24:10 2007 @@ -35,9 +35,9 @@ GCC-based C & C++ front-end, a link-time optimization framework with a growing set of global and interprocedural analyses and transformations, static back-ends for the X86, -PowerPC, IA-64, Alpha and SPARC architectures, a back-end which emits -portable C code, and a Just-In-Time compiler for X86 and PowerPC -processors.

  • +X86-64, PowerPC 32/64, ARM, Thumb, IA-64, Alpha and SPARC architectures, +a back-end which emits portable C code, and a Just-In-Time compiler for X86, +X86-64, PowerPC 32/64 processors.

  • LLVM does not imply things that you would expect from a high-level virtual machine. It does not require garbage collection or From sabre at nondot.org Tue Jan 23 23:26:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 23 Jan 2007 23:26:25 -0600 Subject: [llvm-commits] CVS: llvm-www/Features.html Message-ID: <200701240526.l0O5QPi3030186@zion.cs.uiuc.edu> Changes in directory llvm-www: Features.html updated: 1.18 -> 1.19 --- Log message: Update. --- Diffs of the changes: (+5 -3) Features.html | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm-www/Features.html diff -u llvm-www/Features.html:1.18 llvm-www/Features.html:1.19 --- llvm-www/Features.html:1.18 Wed Nov 15 00:56:55 2006 +++ llvm-www/Features.html Tue Jan 23 23:26:09 2007 @@ -27,10 +27,12 @@ optimizations.

  • An easily retargettable code generator, which currently supports X86, - X86-64, PowerPC, PowerPC-64, SPARC, Alpha, and IA-64.
  • + X86-64, PowerPC, PowerPC-64, ARM, Thumb, SPARC, Alpha, and IA-64. -
  • A Just-In-Time (JIT) code generation system for X86, X86-64, - PowerPC and PowerPC-64.
  • +
  • A Just-In-Time (JIT) code generation system, which currently supports + X86, X86-64, PowerPC and PowerPC-64.
  • + +
  • Support for generating DWARF debugging information.
  • A C back-end useful for testing and for generating native code on targets other than the ones listed above.
  • From sabre at nondot.org Tue Jan 23 23:27:34 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 23 Jan 2007 23:27:34 -0600 Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html Message-ID: <200701240527.l0O5RYJa030268@zion.cs.uiuc.edu> Changes in directory llvm-www: OpenProjects.html updated: 1.16 -> 1.17 --- Log message: ARM exists. --- Diffs of the changes: (+2 -3) OpenProjects.html | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm-www/OpenProjects.html diff -u llvm-www/OpenProjects.html:1.16 llvm-www/OpenProjects.html:1.17 --- llvm-www/OpenProjects.html:1.16 Wed Jul 19 12:53:23 2006 +++ llvm-www/OpenProjects.html Tue Jan 23 23:27:16 2007 @@ -320,8 +320,7 @@ registers clobbered by a function. Use the pass to fine tune register usage in callers based on *actual* registers used by the callee.
  • Write a new backend for a target -(ARM? - MIPS? +(MIPS? MMIX?)
  • @@ -374,7 +373,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2006/07/19 17:53:23 $ + Last modified: $Date: 2007/01/24 05:27:16 $ From sabre at nondot.org Tue Jan 23 23:28:26 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 23 Jan 2007 23:28:26 -0600 Subject: [llvm-commits] CVS: llvm-www/OpenProjects.html Message-ID: <200701240528.l0O5SQ5j030326@zion.cs.uiuc.edu> Changes in directory llvm-www: OpenProjects.html updated: 1.17 -> 1.18 --- Log message: also done --- Diffs of the changes: (+1 -2) OpenProjects.html | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm-www/OpenProjects.html diff -u llvm-www/OpenProjects.html:1.17 llvm-www/OpenProjects.html:1.18 --- llvm-www/OpenProjects.html:1.17 Tue Jan 23 23:27:16 2007 +++ llvm-www/OpenProjects.html Tue Jan 23 23:28:10 2007 @@ -181,7 +181,6 @@
      -
    1. Rework the PassManager to be more flexible
    2. Some transformations and analyses only work on reducible flow graphs. It would be nice to have a transformation which could be "required" by these passes @@ -373,7 +372,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
      - Last modified: $Date: 2007/01/24 05:27:16 $ + Last modified: $Date: 2007/01/24 05:28:10 $ From evan.cheng at apple.com Wed Jan 24 01:03:59 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 24 Jan 2007 01:03:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200701240703.l0O73x88031970@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.81 -> 1.82 --- Log message: Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift(). --- Diffs of the changes: (+2 -2) TargetData.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.81 llvm/lib/Target/TargetData.cpp:1.82 --- llvm/lib/Target/TargetData.cpp:1.81 Mon Jan 22 17:08:19 2007 +++ llvm/lib/Target/TargetData.cpp Wed Jan 24 01:03:39 2007 @@ -450,7 +450,7 @@ return Align; } -unsigned char TargetData::getTypeAlignmentShift(const Type *Ty) const { +unsigned char TargetData::getPreferredTypeAlignmentShift(const Type *Ty) const { unsigned Align = getTypeAlignmentPref(Ty); assert(!(Align & (Align-1)) && "Alignment is not a power of two!"); return Log2_32(Align); @@ -508,7 +508,7 @@ /// requested alignment (if the global has one). unsigned TargetData::getPreferredAlignmentLog(const GlobalVariable *GV) const { const Type *ElemType = GV->getType()->getElementType(); - unsigned Alignment = getTypeAlignmentShift(ElemType); + unsigned Alignment = getPreferredTypeAlignmentShift(ElemType); if (GV->getAlignment() > (1U << Alignment)) Alignment = Log2_32(GV->getAlignment()); From evan.cheng at apple.com Wed Jan 24 01:04:04 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 24 Jan 2007 01:04:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp Message-ID: <200701240704.l0O744mZ031975@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaAsmPrinter.cpp updated: 1.60 -> 1.61 --- Log message: Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift(). --- Diffs of the changes: (+1 -1) AlphaAsmPrinter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp diff -u llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.60 llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.61 --- llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.60 Tue Dec 19 16:59:25 2006 +++ llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp Wed Jan 24 01:03:39 2007 @@ -212,7 +212,7 @@ std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); unsigned Size = TD->getTypeSize(C->getType()); - // unsigned Align = TD->getTypeAlignmentShift(C->getType()); + // unsigned Align = TD->getPreferredTypeAlignmentShift(C->getType()); unsigned Align = TD->getPreferredAlignmentLog(I); if (C->isNullValue() && From evan.cheng at apple.com Wed Jan 24 01:04:05 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 24 Jan 2007 01:04:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64AsmPrinter.cpp Message-ID: <200701240704.l0O74541031985@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64AsmPrinter.cpp updated: 1.41 -> 1.42 --- Log message: Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift(). --- Diffs of the changes: (+1 -1) IA64AsmPrinter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/IA64/IA64AsmPrinter.cpp diff -u llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.41 llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.42 --- llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.41 Tue Dec 19 16:59:26 2006 +++ llvm/lib/Target/IA64/IA64AsmPrinter.cpp Wed Jan 24 01:03:39 2007 @@ -272,7 +272,7 @@ std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); unsigned Size = TD->getTypeSize(C->getType()); - unsigned Align = TD->getTypeAlignmentShift(C->getType()); + unsigned Align = TD->getPreferredTypeAlignmentShift(C->getType()); if (C->isNullValue() && (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || From evan.cheng at apple.com Wed Jan 24 01:04:05 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 24 Jan 2007 01:04:05 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h Message-ID: <200701240704.l0O745jK031988@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.47 -> 1.48 --- Log message: Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift(). --- Diffs of the changes: (+2 -2) TargetData.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.47 llvm/include/llvm/Target/TargetData.h:1.48 --- llvm/include/llvm/Target/TargetData.h:1.47 Mon Jan 22 17:14:52 2007 +++ llvm/include/llvm/Target/TargetData.h Wed Jan 24 01:03:39 2007 @@ -233,10 +233,10 @@ /// the specified type. unsigned char getTypeAlignmentPref(const Type *Ty) const; - /// getTypeAlignmentShift - Return the preferred alignment for the + /// getPreferredTypeAlignmentShift - Return the preferred alignment for the /// specified type, returned as log2 of the value (a shift amount). /// - unsigned char getTypeAlignmentShift(const Type *Ty) const; + unsigned char getPreferredTypeAlignmentShift(const Type *Ty) const; /// getIntPtrType - Return an unsigned integer type that is the same size or /// greater to the host pointer size. From evan.cheng at apple.com Wed Jan 24 01:04:04 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 24 Jan 2007 01:04:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Message-ID: <200701240704.l0O744tf031978@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAG.cpp updated: 1.115 -> 1.116 --- Log message: Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift(). --- Diffs of the changes: (+1 -1) ScheduleDAG.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.115 llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.116 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.115 Mon Jan 22 17:13:55 2007 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Jan 24 01:03:39 2007 @@ -330,7 +330,7 @@ const Type *Type = CP->getType(); // MachineConstantPool wants an explicit alignment. if (Align == 0) { - Align = TM.getTargetData()->getTypeAlignmentShift(Type); + Align = TM.getTargetData()->getPreferredTypeAlignmentShift(Type); if (Align == 0) { // Alignment of packed types. FIXME! Align = TM.getTargetData()->getTypeSize(Type); From isanbard at gmail.com Wed Jan 24 01:14:15 2007 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 24 Jan 2007 01:14:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.cpp Message-ID: <200701240714.l0O7EFPd032162@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: MachOWriter.cpp updated: 1.18 -> 1.19 --- Log message: Make ivars private and use getters. Have the MachOWriter return "Mach-O Writer" for the pass name. --- Diffs of the changes: (+2 -2) MachOWriter.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.18 llvm/lib/CodeGen/MachOWriter.cpp:1.19 --- llvm/lib/CodeGen/MachOWriter.cpp:1.18 Tue Jan 23 21:38:47 2007 +++ llvm/lib/CodeGen/MachOWriter.cpp Wed Jan 24 01:13:56 2007 @@ -461,8 +461,8 @@ OutputBuffer FHOut(FH, is64Bit, isLittleEndian); FHOut.outword(Header.magic); - FHOut.outword(TM.getMachOWriterInfo()->CPUType); - FHOut.outword(TM.getMachOWriterInfo()->CPUSubType); + FHOut.outword(TM.getMachOWriterInfo()->getCPUType()); + FHOut.outword(TM.getMachOWriterInfo()->getCPUSubType()); FHOut.outword(Header.filetype); FHOut.outword(Header.ncmds); FHOut.outword(Header.sizeofcmds); From isanbard at gmail.com Wed Jan 24 01:14:15 2007 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 24 Jan 2007 01:14:15 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h Message-ID: <200701240714.l0O7EFK0032167@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachOWriter.h updated: 1.15 -> 1.16 --- Log message: Make ivars private and use getters. Have the MachOWriter return "Mach-O Writer" for the pass name. --- Diffs of the changes: (+4 -2) MachOWriter.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/include/llvm/CodeGen/MachOWriter.h diff -u llvm/include/llvm/CodeGen/MachOWriter.h:1.15 llvm/include/llvm/CodeGen/MachOWriter.h:1.16 --- llvm/include/llvm/CodeGen/MachOWriter.h:1.15 Tue Jan 23 21:37:18 2007 +++ llvm/include/llvm/CodeGen/MachOWriter.h Wed Jan 24 01:13:55 2007 @@ -85,11 +85,13 @@ MachineCodeEmitter &getMachineCodeEmitter() const { return *(MachineCodeEmitter*)MCE; } + virtual ~MachOWriter(); - ~MachOWriter(); + virtual const char *getPassName() const { + return "Mach-O Writer"; + } typedef std::vector DataBuffer; - protected: MachOWriter(std::ostream &O, TargetMachine &TM); From isanbard at gmail.com Wed Jan 24 01:14:15 2007 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 24 Jan 2007 01:14:15 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetMachOWriterInfo.h Message-ID: <200701240714.l0O7EFe9032169@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetMachOWriterInfo.h updated: 1.1 -> 1.2 --- Log message: Make ivars private and use getters. Have the MachOWriter return "Mach-O Writer" for the pass name. --- Diffs of the changes: (+4 -5) TargetMachOWriterInfo.h | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) Index: llvm/include/llvm/Target/TargetMachOWriterInfo.h diff -u llvm/include/llvm/Target/TargetMachOWriterInfo.h:1.1 llvm/include/llvm/Target/TargetMachOWriterInfo.h:1.2 --- llvm/include/llvm/Target/TargetMachOWriterInfo.h:1.1 Tue Jan 23 21:36:05 2007 +++ llvm/include/llvm/Target/TargetMachOWriterInfo.h Wed Jan 24 01:13:55 2007 @@ -24,10 +24,10 @@ // TargetMachOWriterInfo //===--------------------------------------------------------------------===// - struct TargetMachOWriterInfo { + class TargetMachOWriterInfo { uint32_t CPUType; // CPU specifier uint32_t CPUSubType; // Machine specifier - + public: // The various CPU_TYPE_* constants are already defined by at least one // system header file and create compilation errors if not respected. #if !defined(CPU_TYPE_I386) @@ -93,9 +93,8 @@ virtual MachineRelocation GetJTRelocation(unsigned Offset, MachineBasicBlock *MBB) const; - virtual const char *getPassName() const { - return "Mach-O Writer"; - } + uint32_t getCPUType() const { return CPUType; } + uint32_t getCPUSubType() const { return CPUSubType; } }; } // end llvm namespace From isanbard at gmail.com Wed Jan 24 01:14:18 2007 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 24 Jan 2007 01:14:18 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h Message-ID: <200701240714.l0O7EIT7032177@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCMachOWriterInfo.h updated: 1.1 -> 1.2 --- Log message: Make ivars private and use getters. Have the MachOWriter return "Mach-O Writer" for the pass name. --- Diffs of the changes: (+2 -5) PPCMachOWriterInfo.h | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) Index: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h diff -u llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h:1.1 llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h:1.2 --- llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h:1.1 Tue Jan 23 21:36:05 2007 +++ llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h Wed Jan 24 01:13:56 2007 @@ -21,13 +21,10 @@ // Forward declarations class PPCTargetMachine; - struct PPCMachOWriterInfo : public TargetMachOWriterInfo { + class PPCMachOWriterInfo : public TargetMachOWriterInfo { + public: PPCMachOWriterInfo(const PPCTargetMachine &TM); virtual ~PPCMachOWriterInfo() {} - - virtual const char *getPassName() const { - return "PowerPC Mach-O Writer"; - } }; } // end llvm namespace From evan.cheng at apple.com Wed Jan 24 02:53:59 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 24 Jan 2007 02:53:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp ARMISelDAGToDAG.cpp ARMInstrThumb.td Message-ID: <200701240853.l0O8rxq5010054@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.1 -> 1.2 ARMISelDAGToDAG.cpp updated: 1.102 -> 1.103 ARMInstrThumb.td updated: 1.2 -> 1.3 --- Log message: Use PC relative ldr to load from a constantpool in Thumb mode. --- Diffs of the changes: (+25 -9) ARMConstantIslandPass.cpp | 3 +++ ARMISelDAGToDAG.cpp | 25 +++++++++++++++++-------- ARMInstrThumb.td | 6 +++++- 3 files changed, 25 insertions(+), 9 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.1 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.2 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.1 Fri Jan 19 01:51:42 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jan 24 02:53:17 2007 @@ -245,6 +245,9 @@ case ARMII::AddrModeT4: MaxOffs = 1 << (5+2); break; + case ARMII::AddrModeTs: + MaxOffs = 1 << (8+2); + break; } // Remember that this is a user of a CP entry. Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.102 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.103 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.102 Tue Jan 23 20:45:25 2007 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Wed Jan 24 02:53:17 2007 @@ -380,6 +380,9 @@ SDOperand TmpBase, TmpOffImm; if (SelectThumbAddrModeSP(Op, N, TmpBase, TmpOffImm)) return false; // We want to select tLDRspi / tSTRspi instead. + if (N.getOpcode() == ARMISD::Wrapper && + N.getOperand(0).getOpcode() == ISD::TargetConstantPool) + return false; // We want to select tLDRpci instead. } if (N.getOpcode() != ISD::ADD) { @@ -505,14 +508,20 @@ SDOperand CPIdx = CurDAG->getTargetConstantPool(ConstantInt::get(Type::Int32Ty, Val), TLI.getPointerTy()); - SDOperand Ops[] = { - CPIdx, - CurDAG->getRegister(0, MVT::i32), - CurDAG->getTargetConstant(0, MVT::i32), - CurDAG->getEntryNode() - }; - SDNode *ResNode = - CurDAG->getTargetNode(ARM::LDR, MVT::i32, MVT::Other, Ops, 4); + + SDNode *ResNode; + if (Subtarget->isThumb()) + ResNode = CurDAG->getTargetNode(ARM::tLDRpci, MVT::i32, MVT::Other, + CPIdx, CurDAG->getEntryNode()); + else { + SDOperand Ops[] = { + CPIdx, + CurDAG->getRegister(0, MVT::i32), + CurDAG->getTargetConstant(0, MVT::i32), + CurDAG->getEntryNode() + }; + ResNode = CurDAG->getTargetNode(ARM::LDR, MVT::i32, MVT::Other, Ops, 4); + } ReplaceUses(Op, SDOperand(ResNode, 0)); return NULL; } Index: llvm/lib/Target/ARM/ARMInstrThumb.td diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.2 llvm/lib/Target/ARM/ARMInstrThumb.td:1.3 --- llvm/lib/Target/ARM/ARMInstrThumb.td:1.2 Tue Jan 23 16:59:13 2007 +++ llvm/lib/Target/ARM/ARMInstrThumb.td Wed Jan 24 02:53:17 2007 @@ -220,10 +220,14 @@ "ldrsh $dst, $addr", [(set GPR:$dst, (sextloadi16 t_addrmode_rr:$addr))]>; -// def tLDRpci def tLDRspi : TIs<(ops GPR:$dst, t_addrmode_sp:$addr), "ldr $dst, $addr", [(set GPR:$dst, (load t_addrmode_sp:$addr))]>; + +// Load tconstpool +def tLDRpci : TIs<(ops GPR:$dst, i32imm:$addr), + "ldr $dst, $addr", + [(set GPR:$dst, (load (ARMWrapper tconstpool:$addr)))]>; } // isLoad let isStore = 1 in { From jlaskey at apple.com Wed Jan 24 07:12:48 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 07:12:48 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h Message-ID: <200701241312.l0ODCmJ8014806@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: AsmPrinter.h updated: 1.58 -> 1.59 --- Log message: Use asm printer to emit alignment --- Diffs of the changes: (+2 -0) AsmPrinter.h | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/CodeGen/AsmPrinter.h diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.58 llvm/include/llvm/CodeGen/AsmPrinter.h:1.59 --- llvm/include/llvm/CodeGen/AsmPrinter.h:1.58 Sun Dec 17 21:37:18 2006 +++ llvm/include/llvm/CodeGen/AsmPrinter.h Wed Jan 24 07:12:32 2007 @@ -174,12 +174,14 @@ /// do nothing and return false. bool EmitSpecialLLVMGlobal(const GlobalVariable *GV); + public: /// EmitAlignment - Emit an alignment directive to the specified power of /// two boundary. For example, if you pass in 3 here, you will get an 8 /// byte alignment. If a global value is specified, and if that global has /// an explicit alignment requested, it will override the alignment request. void EmitAlignment(unsigned NumBits, const GlobalValue *GV = 0) const; + protected: /// EmitZeros - Emit a block of zeros. /// void EmitZeros(uint64_t NumZeros) const; From jlaskey at apple.com Wed Jan 24 07:12:50 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 07:12:50 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200701241312.l0ODCoFm014811@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.111 -> 1.112 --- Log message: Use asm printer to emit alignment --- Diffs of the changes: (+2 -8) DwarfWriter.cpp | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.111 llvm/lib/CodeGen/DwarfWriter.cpp:1.112 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.111 Mon Jan 8 16:15:18 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Wed Jan 24 07:12:32 2007 @@ -945,12 +945,6 @@ O << "\n"; } - /// EmitAlign - Print a align directive. - /// - void EmitAlign(unsigned Alignment) const { - O << TAI->getAlignDirective() << Alignment << "\n"; - } - /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an /// unsigned leb128 value. void EmitULEB128Bytes(unsigned Value) const { @@ -2444,7 +2438,7 @@ EmitFrameMoves(NULL, 0, Moves); for (unsigned i = 0, N = Moves.size(); i < N; ++i) delete Moves[i]; - EmitAlign(2); + Asm->EmitAlignment(2); EmitLabel("frame_common_end", 0); O << "\n"; @@ -2477,7 +2471,7 @@ EmitFrameMoves("func_begin", SubprogramCount, Moves); - EmitAlign(2); + Asm->EmitAlignment(2); EmitLabel("frame_end", SubprogramCount); O << "\n"; From sabre at nondot.org Wed Jan 24 12:31:16 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 24 Jan 2007 12:31:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.td Message-ID: <200701241831.l0OIVG9Y020416@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.td updated: 1.297 -> 1.298 --- Log message: Fix a misencoding of CBW and CWD. This fixes PR1030: http://llvm.org/PR1030 . --- Diffs of the changes: (+2 -2) X86InstrInfo.td | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.297 llvm/lib/Target/X86/X86InstrInfo.td:1.298 --- llvm/lib/Target/X86/X86InstrInfo.td:1.297 Tue Dec 5 13:50:18 2006 +++ llvm/lib/Target/X86/X86InstrInfo.td Wed Jan 24 12:31:00 2007 @@ -2394,12 +2394,12 @@ [(set GR32:$dst, (zextloadi32i16 addr:$src))]>, TB; def CBW : I<0x98, RawFrm, (ops), - "{cbtw|cbw}", []>, Imp<[AL],[AX]>; // AX = signext(AL) + "{cbtw|cbw}", []>, Imp<[AL],[AX]>, OpSize; // AX = signext(AL) def CWDE : I<0x98, RawFrm, (ops), "{cwtl|cwde}", []>, Imp<[AX],[EAX]>; // EAX = signext(AX) def CWD : I<0x99, RawFrm, (ops), - "{cwtd|cwd}", []>, Imp<[AX],[AX,DX]>; // DX:AX = signext(AX) + "{cwtd|cwd}", []>, Imp<[AX],[AX,DX]>, OpSize; // DX:AX = signext(AX) def CDQ : I<0x99, RawFrm, (ops), "{cltd|cdq}", []>, Imp<[EAX],[EAX,EDX]>; // EDX:EAX = signext(EAX) From alenhar2 at cs.uiuc.edu Wed Jan 24 12:43:30 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 24 Jan 2007 12:43:30 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Message-ID: <200701241843.l0OIhUOb020838@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.66 -> 1.67 --- Log message: Fix unordered fp on alpha --- Diffs of the changes: (+35 -15) AlphaISelDAGToDAG.cpp | 50 +++++++++++++++++++++++++++++++++++--------------- 1 files changed, 35 insertions(+), 15 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.66 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.67 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.66 Fri Jan 19 15:13:56 2007 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Wed Jan 24 12:43:14 2007 @@ -350,30 +350,50 @@ case ISD::SETCC: if (MVT::isFloatingPoint(N->getOperand(0).Val->getValueType(0))) { - unsigned Opc = Alpha::WTF; ISD::CondCode CC = cast(N->getOperand(2))->get(); + + unsigned Opc = Alpha::WTF; bool rev = false; - bool isNE = false; + bool inv = false; switch(CC) { default: DEBUG(N->dump()); assert(0 && "Unknown FP comparison!"); - case ISD::SETEQ: case ISD::SETOEQ: case ISD::SETUEQ: Opc = Alpha::CMPTEQ; break; - case ISD::SETLT: case ISD::SETOLT: case ISD::SETULT: Opc = Alpha::CMPTLT; break; - case ISD::SETLE: case ISD::SETOLE: case ISD::SETULE: Opc = Alpha::CMPTLE; break; - case ISD::SETGT: case ISD::SETOGT: case ISD::SETUGT: Opc = Alpha::CMPTLT; rev = true; break; - case ISD::SETGE: case ISD::SETOGE: case ISD::SETUGE: Opc = Alpha::CMPTLE; rev = true; break; - case ISD::SETNE: case ISD::SETONE: case ISD::SETUNE: Opc = Alpha::CMPTEQ; isNE = true; break; + case ISD::SETEQ: case ISD::SETOEQ: case ISD::SETUEQ: + Opc = Alpha::CMPTEQ; break; + case ISD::SETLT: case ISD::SETOLT: case ISD::SETULT: + Opc = Alpha::CMPTLT; break; + case ISD::SETLE: case ISD::SETOLE: case ISD::SETULE: + Opc = Alpha::CMPTLE; break; + case ISD::SETGT: case ISD::SETOGT: case ISD::SETUGT: + Opc = Alpha::CMPTLT; rev = true; break; + case ISD::SETGE: case ISD::SETOGE: case ISD::SETUGE: + Opc = Alpha::CMPTLE; rev = true; break; + case ISD::SETNE: case ISD::SETONE: case ISD::SETUNE: + Opc = Alpha::CMPTEQ; inv = true; break; + case ISD::SETO: + Opc = Alpha::CMPTUN; inv = true; break; + case ISD::SETUO: + Opc = Alpha::CMPTUN; break; }; - SDOperand tmp1 = N->getOperand(0); - SDOperand tmp2 = N->getOperand(1); + SDOperand tmp1 = N->getOperand(rev?1:0); + SDOperand tmp2 = N->getOperand(rev?0:1); AddToISelQueue(tmp1); AddToISelQueue(tmp2); - SDNode *cmp = CurDAG->getTargetNode(Opc, MVT::f64, - rev?tmp2:tmp1, - rev?tmp1:tmp2); - if (isNE) + SDNode *cmp = CurDAG->getTargetNode(Opc, MVT::f64, tmp1, tmp2); + if (inv) cmp = CurDAG->getTargetNode(Alpha::CMPTEQ, MVT::f64, SDOperand(cmp, 0), CurDAG->getRegister(Alpha::F31, MVT::f64)); - + switch(CC) { + case ISD::SETUEQ: case ISD::SETULT: case ISD::SETULE: + case ISD::SETUNE: case ISD::SETUGT: case ISD::SETUGE: + { + SDNode* cmp2 = CurDAG->getTargetNode(Alpha::CMPTUN, MVT::f64, tmp1, tmp2); + cmp = CurDAG->getTargetNode(Alpha::ADDT, MVT::f64, + SDOperand(cmp2, 0), SDOperand(cmp, 0)); + break; + } + default: break; + } + SDOperand LD; if (AlphaLowering.hasITOF()) { LD = CurDAG->getNode(AlphaISD::FTOIT_, MVT::i64, SDOperand(cmp, 0)); From jlaskey at apple.com Wed Jan 24 12:45:32 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 12:45:32 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200701241845.l0OIjWDK020900@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.87 -> 1.88 --- Log message: Repair debug frames as a prelude to eh_frames. Switched to using MachineMoves by value so that clean up is less confusing (these vectors tend to be small.) --- Diffs of the changes: (+1 -1) MRegisterInfo.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.87 llvm/include/llvm/Target/MRegisterInfo.h:1.88 --- llvm/include/llvm/Target/MRegisterInfo.h:1.87 Mon Jan 22 18:51:23 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Wed Jan 24 12:45:12 2007 @@ -456,7 +456,7 @@ /// getInitialFrameState - Returns a list of machine moves that are assumed /// on entry to all functions. Note that LabelID is ignored (assumed to be /// the beginning of the function.) - virtual void getInitialFrameState(std::vector &Moves) const; + virtual void getInitialFrameState(std::vector &Moves) const; }; // This is useful when building DenseMaps keyed on virtual registers From jlaskey at apple.com Wed Jan 24 12:45:38 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 12:45:38 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineDebugInfo.h MachineLocation.h Message-ID: <200701241845.l0OIjcR9020907@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineDebugInfo.h updated: 1.47 -> 1.48 MachineLocation.h updated: 1.2 -> 1.3 --- Log message: Repair debug frames as a prelude to eh_frames. Switched to using MachineMoves by value so that clean up is less confusing (these vectors tend to be small.) --- Diffs of the changes: (+10 -4) MachineDebugInfo.h | 4 ++-- MachineLocation.h | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) Index: llvm/include/llvm/CodeGen/MachineDebugInfo.h diff -u llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.47 llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.48 --- llvm/include/llvm/CodeGen/MachineDebugInfo.h:1.47 Thu Nov 30 08:35:45 2006 +++ llvm/include/llvm/CodeGen/MachineDebugInfo.h Wed Jan 24 12:45:12 2007 @@ -985,7 +985,7 @@ // FrameMoves - List of moves done by a function's prolog. Used to construct // frame maps by debug consumers. - std::vector FrameMoves; + std::vector FrameMoves; public: MachineDebugInfo(); @@ -1145,7 +1145,7 @@ /// getFrameMoves - Returns a reference to a list of moves done in the current /// function's prologue. Used to construct frame maps for debug comsumers. - std::vector &getFrameMoves() { return FrameMoves; } + std::vector &getFrameMoves() { return FrameMoves; } }; // End class MachineDebugInfo Index: llvm/include/llvm/CodeGen/MachineLocation.h diff -u llvm/include/llvm/CodeGen/MachineLocation.h:1.2 llvm/include/llvm/CodeGen/MachineLocation.h:1.3 --- llvm/include/llvm/CodeGen/MachineLocation.h:1.2 Fri Apr 7 11:34:45 2006 +++ llvm/include/llvm/CodeGen/MachineLocation.h Wed Jan 24 12:45:12 2007 @@ -79,10 +79,16 @@ unsigned LabelID; // Label ID number for post-instruction // address when result of move takes // effect. - const MachineLocation Destination; // Move to location. - const MachineLocation Source; // Move from location. + MachineLocation Destination; // Move to location. + MachineLocation Source; // Move from location. public: + MachineMove() + : LabelID(0) + , Destination() + , Source() + {} + MachineMove(unsigned ID, MachineLocation &D, MachineLocation &S) : LabelID(ID) , Destination(D) From jlaskey at apple.com Wed Jan 24 12:45:38 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 12:45:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/MRegisterInfo.cpp Message-ID: <200701241845.l0OIjcJv020912@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: MRegisterInfo.cpp updated: 1.17 -> 1.18 --- Log message: Repair debug frames as a prelude to eh_frames. Switched to using MachineMoves by value so that clean up is less confusing (these vectors tend to be small.) --- Diffs of the changes: (+1 -1) MRegisterInfo.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/MRegisterInfo.cpp diff -u llvm/lib/Target/MRegisterInfo.cpp:1.17 llvm/lib/Target/MRegisterInfo.cpp:1.18 --- llvm/lib/Target/MRegisterInfo.cpp:1.17 Fri Nov 17 15:19:15 2006 +++ llvm/lib/Target/MRegisterInfo.cpp Wed Jan 24 12:45:13 2007 @@ -64,7 +64,7 @@ /// getInitialFrameState - Returns a list of machine moves that are assumed /// on entry to a function. void -MRegisterInfo::getInitialFrameState(std::vector &Moves) const { +MRegisterInfo::getInitialFrameState(std::vector &Moves) const { // Default is to do nothing. } From jlaskey at apple.com Wed Jan 24 12:45:38 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 12:45:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp MachineDebugInfo.cpp Message-ID: <200701241845.l0OIjcnO020919@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.112 -> 1.113 MachineDebugInfo.cpp updated: 1.69 -> 1.70 --- Log message: Repair debug frames as a prelude to eh_frames. Switched to using MachineMoves by value so that clean up is less confusing (these vectors tend to be small.) --- Diffs of the changes: (+28 -16) DwarfWriter.cpp | 43 ++++++++++++++++++++++++++++--------------- MachineDebugInfo.cpp | 1 - 2 files changed, 28 insertions(+), 16 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.112 llvm/lib/CodeGen/DwarfWriter.cpp:1.113 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.112 Wed Jan 24 07:12:32 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Wed Jan 24 12:45:13 2007 @@ -2112,16 +2112,25 @@ /// EmitFrameMoves - Emit frame instructions to describe the layout of the /// frame. void EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID, - std::vector &Moves) { + std::vector &Moves) { + int stackGrowth = + Asm->TM.getFrameInfo()->getStackGrowthDirection() == + TargetFrameInfo::StackGrowsUp ? + TAI->getAddressSize() : -TAI->getAddressSize(); + for (unsigned i = 0, N = Moves.size(); i < N; ++i) { - MachineMove *Move = Moves[i]; - unsigned LabelID = DebugInfo->MappedLabel(Move->getLabelID()); + MachineMove &Move = Moves[i]; + unsigned LabelID = Move.getLabelID(); - // Throw out move if the label is invalid. - if (!LabelID) continue; + if (LabelID) { + LabelID = DebugInfo->MappedLabel(LabelID); - const MachineLocation &Dst = Move->getDestination(); - const MachineLocation &Src = Move->getSource(); + // Throw out move if the label is invalid. + if (!LabelID) continue; + } + + const MachineLocation &Dst = Move.getDestination(); + const MachineLocation &Src = Move.getSource(); // Advance row if new location. if (BaseLabel && LabelID && BaseLabelID != LabelID) { @@ -2134,11 +2143,6 @@ BaseLabel = "loc"; } - int stackGrowth = - Asm->TM.getFrameInfo()->getStackGrowthDirection() == - TargetFrameInfo::StackGrowsUp ? - TAI->getAddressSize() : -TAI->getAddressSize(); - // If advancing cfa. if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) { if (!Src.isRegister()) { @@ -2159,6 +2163,16 @@ } else { assert(0 && "Machine move no supported yet."); } + } else if (Src.isRegister() && + Src.getRegister() == MachineLocation::VirtualFP) { + if (Dst.isRegister()) { + EmitInt8(DW_CFA_def_cfa_register); + EOL("DW_CFA_def_cfa_register"); + EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister())); + EOL("Register"); + } else { + assert(0 && "Machine move no supported yet."); + } } else { unsigned Reg = RI->getDwarfRegNum(Src.getRegister()); int Offset = Dst.getOffset() / stackGrowth; @@ -2433,10 +2447,9 @@ EmitSLEB128Bytes(stackGrowth); EOL("CIE Data Alignment Factor"); EmitInt8(RI->getDwarfRegNum(RI->getRARegister())); EOL("CIE RA Column"); - std::vector Moves; + std::vector Moves; RI->getInitialFrameState(Moves); EmitFrameMoves(NULL, 0, Moves); - for (unsigned i = 0, N = Moves.size(); i < N; ++i) delete Moves[i]; Asm->EmitAlignment(2); EmitLabel("frame_common_end", 0); @@ -2467,7 +2480,7 @@ "func_begin", SubprogramCount); EOL("FDE address range"); - std::vector &Moves = DebugInfo->getFrameMoves(); + std::vector &Moves = DebugInfo->getFrameMoves(); EmitFrameMoves("func_begin", SubprogramCount, Moves); Index: llvm/lib/CodeGen/MachineDebugInfo.cpp diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.69 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.70 --- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.69 Thu Jan 11 22:24:45 2007 +++ llvm/lib/CodeGen/MachineDebugInfo.cpp Wed Jan 24 12:45:13 2007 @@ -1505,7 +1505,6 @@ } // Clean up frame info. - for (unsigned i = 0, N = FrameMoves.size(); i < N; ++i) delete FrameMoves[i]; FrameMoves.clear(); } From jlaskey at apple.com Wed Jan 24 12:45:38 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 12:45:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h Message-ID: <200701241845.l0OIjcuT020924@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.96 -> 1.97 PPCRegisterInfo.h updated: 1.22 -> 1.23 --- Log message: Repair debug frames as a prelude to eh_frames. Switched to using MachineMoves by value so that clean up is less confusing (these vectors tend to be small.) --- Diffs of the changes: (+44 -16) PPCRegisterInfo.cpp | 58 ++++++++++++++++++++++++++++++++++++++-------------- PPCRegisterInfo.h | 2 - 2 files changed, 44 insertions(+), 16 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.96 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.96 Mon Jan 22 18:55:21 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Wed Jan 24 12:45:13 2007 @@ -762,6 +762,10 @@ MachineFrameInfo *MFI = MF.getFrameInfo(); MachineDebugInfo *DebugInfo = MFI->getMachineDebugInfo(); + // Prepare for debug frame info. + bool hasInfo = DebugInfo && DebugInfo->hasInfo(); + unsigned FrameLabelId = 0; + // Scan the prolog, looking for an UPDATE_VRSAVE instruction. If we find it, // process it. for (unsigned i = 0; MBBI != MBB.end(); ++i, ++MBBI) { @@ -821,6 +825,12 @@ unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment(); unsigned MaxAlign = MFI->getMaxAlignment(); + if (hasInfo) { + // Mark effective beginning of when frame pointer becomes valid. + FrameLabelId = DebugInfo->NextLabelID(); + BuildMI(MBB, MBBI, TII.get(PPC::DWARF_LABEL)).addImm(FrameLabelId); + } + // Adjust stack pointer: r1 += NegFrameSize. // If there is a preferred stack alignment, align R1 now if (!IsPPC64) { @@ -866,26 +876,44 @@ } } - if (DebugInfo && DebugInfo->hasInfo()) { - std::vector &Moves = DebugInfo->getFrameMoves(); - unsigned LabelID = DebugInfo->NextLabelID(); + if (hasInfo) { + std::vector &Moves = DebugInfo->getFrameMoves(); - // Mark effective beginning of when frame pointer becomes valid. - BuildMI(MBB, MBBI, TII.get(PPC::DWARF_LABEL)).addImm(LabelID); + if (NegFrameSize) { + // Show update of SP. + MachineLocation SPDst(MachineLocation::VirtualFP); + MachineLocation SPSrc(MachineLocation::VirtualFP, NegFrameSize); + Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + } else { + MachineLocation SP(IsPPC64 ? PPC::X31 : PPC::R31); + Moves.push_back(MachineMove(FrameLabelId, SP, SP)); + } - // Show update of SP. - MachineLocation SPDst(MachineLocation::VirtualFP); - MachineLocation SPSrc(MachineLocation::VirtualFP, NegFrameSize); - Moves.push_back(new MachineMove(LabelID, SPDst, SPSrc)); + if (HasFP) { + MachineLocation FPDst(MachineLocation::VirtualFP, FPOffset); + MachineLocation FPSrc(IsPPC64 ? PPC::X31 : PPC::R31); + Moves.push_back(MachineMove(FrameLabelId, FPDst, FPSrc)); + } // Add callee saved registers to move list. const std::vector &CSI = MFI->getCalleeSavedInfo(); for (unsigned I = 0, E = CSI.size(); I != E; ++I) { - MachineLocation CSDst(MachineLocation::VirtualFP, - MFI->getObjectOffset(CSI[I].getFrameIdx())); - MachineLocation CSSrc(CSI[I].getReg()); - Moves.push_back(new MachineMove(LabelID, CSDst, CSSrc)); + int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx()); + unsigned Reg = CSI[I].getReg(); + if (Reg == PPC::LR || Reg == PPC::LR8) continue; + MachineLocation CSDst(MachineLocation::VirtualFP, Offset); + MachineLocation CSSrc(Reg); + Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc)); } + + // Mark effective beginning of when frame pointer is ready. + unsigned ReadyLabelId = DebugInfo->NextLabelID(); + BuildMI(MBB, MBBI, TII.get(PPC::DWARF_LABEL)).addImm(ReadyLabelId); + + MachineLocation FPDst(HasFP ? (IsPPC64 ? PPC::X31 : PPC::R31) : + (IsPPC64 ? PPC::X1 : PPC::R1)); + MachineLocation FPSrc(MachineLocation::VirtualFP); + Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc)); } // If there is a frame pointer, copy R1 into R31 @@ -983,12 +1011,12 @@ return hasFP(MF) ? PPC::X31 : PPC::X1; } -void PPCRegisterInfo::getInitialFrameState(std::vector &Moves) +void PPCRegisterInfo::getInitialFrameState(std::vector &Moves) const { // Initial state of the frame pointer is R1. MachineLocation Dst(MachineLocation::VirtualFP); MachineLocation Src(PPC::R1, 0); - Moves.push_back(new MachineMove(0, Dst, Src)); + Moves.push_back(MachineMove(0, Dst, Src)); } #include "PPCGenRegisterInfo.inc" Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.22 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.23 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.22 Mon Jan 22 18:55:21 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h Wed Jan 24 12:45:13 2007 @@ -81,7 +81,7 @@ // Debug information queries. unsigned getRARegister() const; unsigned getFrameRegister(MachineFunction &MF) const; - void getInitialFrameState(std::vector &Moves) const; + void getInitialFrameState(std::vector &Moves) const; }; } // end namespace llvm From jlaskey at apple.com Wed Jan 24 12:51:13 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 12:51:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200701241851.l0OIpDaj021035@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.194 -> 1.195 --- Log message: 80 columns --- Diffs of the changes: (+8 -4) X86RegisterInfo.cpp | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.194 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.195 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.194 Tue Jan 23 03:38:11 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Wed Jan 24 12:50:57 2007 @@ -926,7 +926,8 @@ unsigned Opc = (Amount < 128) ? (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) : (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri); - New = BuildMI(TII.get(Opc), StackPtr).addReg(StackPtr).addImm(Amount); + New = BuildMI(TII.get(Opc), StackPtr) + .addReg(StackPtr).addImm(Amount); } } @@ -1044,7 +1045,8 @@ // If it's main() on Cygwin\Mingw32 we should align stack as well if (Fn->hasExternalLinkage() && Fn->getName() == "main" && Subtarget->isTargetCygMing()) { - MI= BuildMI(TII.get(X86::AND32ri), X86::ESP).addReg(X86::ESP).addImm(-Align); + MI= BuildMI(TII.get(X86::AND32ri), X86::ESP) + .addReg(X86::ESP).addImm(-Align); MBB.insert(MBBI, MI); // Probe the stack @@ -1104,12 +1106,14 @@ unsigned Opc = (NumBytes < 128) ? (Is64Bit ? X86::ADD64ri8 : X86::ADD32ri8) : (Is64Bit ? X86::ADD64ri32 : X86::ADD32ri); - BuildMI(MBB, MBBI, TII.get(Opc), StackPtr).addReg(StackPtr).addImm(NumBytes); + BuildMI(MBB, MBBI, TII.get(Opc), StackPtr) + .addReg(StackPtr).addImm(NumBytes); } else if ((int)NumBytes < 0) { unsigned Opc = (-NumBytes < 128) ? (Is64Bit ? X86::SUB64ri8 : X86::SUB32ri8) : (Is64Bit ? X86::SUB64ri32 : X86::SUB32ri); - BuildMI(MBB, MBBI, TII.get(Opc), StackPtr).addReg(StackPtr).addImm(-NumBytes); + BuildMI(MBB, MBBI, TII.get(Opc), StackPtr) + .addReg(StackPtr).addImm(-NumBytes); } } } From jlaskey at apple.com Wed Jan 24 13:15:40 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 13:15:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.h X86RegisterInfo.cpp Message-ID: <200701241915.l0OJFeEK021676@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.h updated: 1.44 -> 1.45 X86RegisterInfo.cpp updated: 1.195 -> 1.196 --- Log message: Call frames for intel. --- Diffs of the changes: (+52 -0) X86RegisterInfo.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ X86RegisterInfo.h | 1 + 2 files changed, 52 insertions(+) Index: llvm/lib/Target/X86/X86RegisterInfo.h diff -u llvm/lib/Target/X86/X86RegisterInfo.h:1.44 llvm/lib/Target/X86/X86RegisterInfo.h:1.45 --- llvm/lib/Target/X86/X86RegisterInfo.h:1.44 Mon Jan 22 18:57:47 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.h Wed Jan 24 13:15:24 2007 @@ -94,6 +94,7 @@ // Debug information queries. unsigned getRARegister() const; unsigned getFrameRegister(MachineFunction &MF) const; + void getInitialFrameState(std::vector &Moves) const; }; // getX86SubSuperRegister - X86 utility function. It returns the sub or super Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.195 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.196 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.195 Wed Jan 24 12:50:57 2007 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Wed Jan 24 13:15:24 2007 @@ -995,6 +995,11 @@ const Function* Fn = MF.getFunction(); const X86Subtarget* Subtarget = &MF.getTarget().getSubtarget(); MachineInstr *MI; + MachineDebugInfo *DebugInfo = MFI->getMachineDebugInfo(); + + // Prepare for debug frame info. + bool hasInfo = DebugInfo && DebugInfo->hasInfo(); + unsigned FrameLabelId = 0; // Get the number of bytes to allocate from the FrameInfo unsigned NumBytes = MFI->getStackSize(); @@ -1018,6 +1023,12 @@ } } + if (hasInfo) { + // Mark effective beginning of when frame pointer becomes valid. + FrameLabelId = DebugInfo->NextLabelID(); + BuildMI(MBB, MBBI, TII.get(X86::DWARF_LABEL)).addImm(FrameLabelId); + } + if (hasFP(MF)) { // Get the offset of the stack slot for the EBP register... which is // guaranteed to be the last slot by processFunctionBeforeFrameFinalized. @@ -1042,6 +1053,38 @@ MBB.insert(MBBI, MI); } + if (hasInfo) { + std::vector &Moves = DebugInfo->getFrameMoves(); + + if (NumBytes) { + // Show update of SP. + MachineLocation SPDst(MachineLocation::VirtualFP); + MachineLocation SPSrc(MachineLocation::VirtualFP, -NumBytes); + Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); + } else { + MachineLocation SP(StackPtr); + Moves.push_back(MachineMove(FrameLabelId, SP, SP)); + } + + // Add callee saved registers to move list. + const std::vector &CSI = MFI->getCalleeSavedInfo(); + for (unsigned I = 0, E = CSI.size(); I != E; ++I) { + int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx()); + unsigned Reg = CSI[I].getReg(); + MachineLocation CSDst(MachineLocation::VirtualFP, Offset); + MachineLocation CSSrc(Reg); + Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc)); + } + + // Mark effective beginning of when frame pointer is ready. + unsigned ReadyLabelId = DebugInfo->NextLabelID(); + BuildMI(MBB, MBBI, TII.get(X86::DWARF_LABEL)).addImm(ReadyLabelId); + + MachineLocation FPDst(hasFP(MF) ? FramePtr : StackPtr); + MachineLocation FPSrc(MachineLocation::VirtualFP); + Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc)); + } + // If it's main() on Cygwin\Mingw32 we should align stack as well if (Fn->hasExternalLinkage() && Fn->getName() == "main" && Subtarget->isTargetCygMing()) { @@ -1127,6 +1170,14 @@ return hasFP(MF) ? FramePtr : StackPtr; } +void X86RegisterInfo::getInitialFrameState(std::vector &Moves) + const { + // Initial state of the frame pointer is esp. + MachineLocation Dst(MachineLocation::VirtualFP); + MachineLocation Src(StackPtr, 0); + Moves.push_back(MachineMove(0, Dst, Src)); +} + namespace llvm { unsigned getX86SubSuperRegister(unsigned Reg, MVT::ValueType VT, bool High) { switch (VT) { From jlaskey at apple.com Wed Jan 24 13:16:48 2007 From: jlaskey at apple.com (Jim Laskey) Date: Wed, 24 Jan 2007 15:16:48 -0400 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.h X86RegisterInfo.cpp In-Reply-To: <200701241915.l0OJFeEK021676@zion.cs.uiuc.edu> References: <200701241915.l0OJFeEK021676@zion.cs.uiuc.edu> Message-ID: <4A25A2A2-C87E-4D56-8F51-27E07A1C8A4B@apple.com> Evan and Reid - feel free to tweak this. It shouldn't introduce problems. On 24-Jan-07, at 03:15 PM, Jim Laskey wrote: > > > Changes in directory llvm/lib/Target/X86: > > X86RegisterInfo.h updated: 1.44 -> 1.45 > X86RegisterInfo.cpp updated: 1.195 -> 1.196 > --- > Log message: > > Call frames for intel. > > --- > Diffs of the changes: (+52 -0) > > X86RegisterInfo.cpp | 51 ++++++++++++++++++++++++++++++++++++++++ > +++++++++++ > X86RegisterInfo.h | 1 + > 2 files changed, 52 insertions(+) > > > Index: llvm/lib/Target/X86/X86RegisterInfo.h > diff -u llvm/lib/Target/X86/X86RegisterInfo.h:1.44 llvm/lib/Target/ > X86/X86RegisterInfo.h:1.45 > --- llvm/lib/Target/X86/X86RegisterInfo.h:1.44 Mon Jan 22 18:57:47 > 2007 > +++ llvm/lib/Target/X86/X86RegisterInfo.h Wed Jan 24 13:15:24 2007 > @@ -94,6 +94,7 @@ > // Debug information queries. > unsigned getRARegister() const; > unsigned getFrameRegister(MachineFunction &MF) const; > + void getInitialFrameState(std::vector &Moves) const; > }; > > // getX86SubSuperRegister - X86 utility function. It returns the > sub or super > > > Index: llvm/lib/Target/X86/X86RegisterInfo.cpp > diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.195 llvm/lib/ > Target/X86/X86RegisterInfo.cpp:1.196 > --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.195 Wed Jan 24 > 12:50:57 2007 > +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Wed Jan 24 13:15:24 2007 > @@ -995,6 +995,11 @@ > const Function* Fn = MF.getFunction(); > const X86Subtarget* Subtarget = &MF.getTarget > ().getSubtarget(); > MachineInstr *MI; > + MachineDebugInfo *DebugInfo = MFI->getMachineDebugInfo(); > + > + // Prepare for debug frame info. > + bool hasInfo = DebugInfo && DebugInfo->hasInfo(); > + unsigned FrameLabelId = 0; > > // Get the number of bytes to allocate from the FrameInfo > unsigned NumBytes = MFI->getStackSize(); > @@ -1018,6 +1023,12 @@ > } > } > > + if (hasInfo) { > + // Mark effective beginning of when frame pointer becomes valid. > + FrameLabelId = DebugInfo->NextLabelID(); > + BuildMI(MBB, MBBI, TII.get(X86::DWARF_LABEL)).addImm > (FrameLabelId); > + } > + > if (hasFP(MF)) { > // Get the offset of the stack slot for the EBP register... > which is > // guaranteed to be the last slot by > processFunctionBeforeFrameFinalized. > @@ -1042,6 +1053,38 @@ > MBB.insert(MBBI, MI); > } > > + if (hasInfo) { > + std::vector &Moves = DebugInfo->getFrameMoves(); > + > + if (NumBytes) { > + // Show update of SP. > + MachineLocation SPDst(MachineLocation::VirtualFP); > + MachineLocation SPSrc(MachineLocation::VirtualFP, -NumBytes); > + Moves.push_back(MachineMove(FrameLabelId, SPDst, SPSrc)); > + } else { > + MachineLocation SP(StackPtr); > + Moves.push_back(MachineMove(FrameLabelId, SP, SP)); > + } > + > + // Add callee saved registers to move list. > + const std::vector &CSI = MFI- > >getCalleeSavedInfo(); > + for (unsigned I = 0, E = CSI.size(); I != E; ++I) { > + int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx()); > + unsigned Reg = CSI[I].getReg(); > + MachineLocation CSDst(MachineLocation::VirtualFP, Offset); > + MachineLocation CSSrc(Reg); > + Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc)); > + } > + > + // Mark effective beginning of when frame pointer is ready. > + unsigned ReadyLabelId = DebugInfo->NextLabelID(); > + BuildMI(MBB, MBBI, TII.get(X86::DWARF_LABEL)).addImm > (ReadyLabelId); > + > + MachineLocation FPDst(hasFP(MF) ? FramePtr : StackPtr); > + MachineLocation FPSrc(MachineLocation::VirtualFP); > + Moves.push_back(MachineMove(ReadyLabelId, FPDst, FPSrc)); > + } > + > // If it's main() on Cygwin\Mingw32 we should align stack as well > if (Fn->hasExternalLinkage() && Fn->getName() == "main" && > Subtarget->isTargetCygMing()) { > @@ -1127,6 +1170,14 @@ > return hasFP(MF) ? FramePtr : StackPtr; > } > > +void X86RegisterInfo::getInitialFrameState > (std::vector &Moves) > + > const { > + // Initial state of the frame pointer is esp. > + MachineLocation Dst(MachineLocation::VirtualFP); > + MachineLocation Src(StackPtr, 0); > + Moves.push_back(MachineMove(0, Dst, Src)); > +} > + > namespace llvm { > unsigned getX86SubSuperRegister(unsigned Reg, MVT::ValueType VT, > bool High) { > switch (VT) { > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070124/d610df08/attachment.bin From han at autoesl.com Wed Jan 24 14:39:59 2007 From: han at autoesl.com (Guoling Han) Date: Wed, 24 Jan 2007 14:39:59 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/arith.c field.c offset.reference_output union-struct.c union2.c union2.reference_output Message-ID: <200701242039.l0OKdxfe023562@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: arith.c updated: 1.6 -> 1.7 field.c updated: 1.5 -> 1.6 offset.reference_output updated: 1.1 -> 1.2 union-struct.c updated: 1.6 -> 1.7 union2.c updated: 1.5 -> 1.6 union2.reference_output updated: 1.1 -> 1.2 --- Log message: We changed the outputs and reference outputs for these programs. This is mainly because the memory layout for bit-accurate types. For a n bit int type, it will occupy m bits where m is the nearest large number of power of 2. --- Diffs of the changes: (+39 -19) arith.c | 2 +- field.c | 28 ++++++++++++++++++---------- offset.reference_output | 2 +- union-struct.c | 2 +- union2.c | 21 +++++++++++++++------ union2.reference_output | 3 +++ 6 files changed, 39 insertions(+), 19 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/arith.c diff -u llvm-test/SingleSource/UnitTests/Integer/arith.c:1.6 llvm-test/SingleSource/UnitTests/Integer/arith.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/arith.c:1.6 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/arith.c Wed Jan 24 14:39:44 2007 @@ -43,7 +43,7 @@ l = j / k; temp = l; printf( "temp = %hd\n", temp); - j *= (-176); + j *= (-176); // after truncation, the value should be -384 l = j / k; temp = l; printf( "temp = %hd\n", temp); Index: llvm-test/SingleSource/UnitTests/Integer/field.c diff -u llvm-test/SingleSource/UnitTests/Integer/field.c:1.5 llvm-test/SingleSource/UnitTests/Integer/field.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/field.c:1.5 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/field.c Wed Jan 24 14:39:44 2007 @@ -9,6 +9,8 @@ // data layout of the field should be the same as the corresponding // struct using bit accurate types. // +// Note: we assume that sizeof(x-bit int) = round up x to the most +// nearest 2^n. //===----------------------------------------------------------------------===// @@ -24,9 +26,9 @@ typedef char __attribute__ ((bitwidth(7))) char7; typedef short __attribute__ ((bitwidth(17))) short17; -typedef struct myStruct{int i; unsigned char c:7; int s:17; char c2;} myStruct; +typedef struct myStruct{int i; char c:7; int s:17; char c2;} myStruct; -typedef struct myStruct2{int32 i; int7 c; int17 s; int8 c2;} myStruct2; +typedef struct myStruct2{int32 i; int17 s; int7 c; int8 c2;} myStruct2; int main() { @@ -36,20 +38,26 @@ void* ptr, *ptr1, *ptr2, *ptr3; unsigned int offset, offset1; - ptr = &(x.i); - ptr1 = &(x.c2); + // ptr = &(x.i); + // ptr1 = &(x.c2); ptr2 = &(y.i); ptr3 = &(y.c2); - offset = ptr1 - ptr; + //offset = ptr1 - ptr; offset1 = ptr3 - ptr2; - if(offset != offset1) - printf("error: offset=%x, offset1=%x\n", offset, offset1); - if(sizeof(myStruct) != sizeof(myStruct2)) - printf("error2: sizeof myStruct = %d, sizeof myStruct2 = %d\n", - sizeof(myStruct), sizeof(myStruct2)); + if(offset1 != 2*sizeof(int) + sizeof(char)) + printf("error: offset1=%x\n", offset1); + + x.c = -1; + y.c = -1; + if(x.c != y.c) + printf("error: x.c = %x, y.c = %x\n", x.c, y.c); + + //if(sizeof(myStruct) != sizeof(myStruct2)) + // printf("error2: sizeof myStruct = %d, sizeof myStruct2 = %d\n", + // sizeof(myStruct), sizeof(myStruct2)); return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/offset.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/offset.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/offset.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/offset.reference_output:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/offset.reference_output Wed Jan 24 14:39:44 2007 @@ -1,2 +1,2 @@ -5 +8 exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/union-struct.c diff -u llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.6 llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/union-struct.c:1.6 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union-struct.c Wed Jan 24 14:39:44 2007 @@ -27,7 +27,7 @@ int main() { - if( sizeof(struct Blend_Map_Entry) == 5 * sizeof(int) ) + if( sizeof(struct Blend_Map_Entry) != 5 * sizeof(int) ) printf("error: %d\n", sizeof(struct Blend_Map_Entry)); return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/union2.c diff -u llvm-test/SingleSource/UnitTests/Integer/union2.c:1.5 llvm-test/SingleSource/UnitTests/Integer/union2.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/union2.c:1.5 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union2.c Wed Jan 24 14:39:44 2007 @@ -8,6 +8,10 @@ // This is a test for union type. By assigning values to different // fields, we can check whether the assignment is correctly performed. // +// Note: In the current implementation, a 9-bit data will also occupy +// 2 bytes. So for this example, storing value to the 9-bit field will +// change the two bytes of the memory. +// //===----------------------------------------------------------------------===// @@ -21,12 +25,17 @@ myStruct test(myUnion u) { myStruct x; - - u.i31 = 0; - u.i = 0xffff; - int9* ptr = &(u.i9); - *ptr= 0x00; - + int9* ptr; + + u.i31 = -1; + u.i = 0x0; + ptr = &(u.i9); + *ptr= -1; + + printf("u.i = %hd\n", u.i); + printf("u.i9 = %hd\n", u.i9); + printf("u.i31 = %d\n", u.i31); + x.ptr = ptr; x.i = u.i; Index: llvm-test/SingleSource/UnitTests/Integer/union2.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union2.reference_output Wed Jan 24 14:39:44 2007 @@ -1 +1,4 @@ +u.i = 511 +u.i9 = -1 +u.i31 = -65025 exit 0 From alenhar2 at cs.uiuc.edu Wed Jan 24 15:09:31 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Wed, 24 Jan 2007 15:09:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/Alpha.td AlphaAsmPrinter.cpp AlphaISelDAGToDAG.cpp AlphaISelLowering.cpp AlphaISelLowering.h AlphaInstrInfo.td AlphaSubtarget.cpp AlphaSubtarget.h Message-ID: <200701242109.l0OL9Vcr024156@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: Alpha.td updated: 1.11 -> 1.12 AlphaAsmPrinter.cpp updated: 1.61 -> 1.62 AlphaISelDAGToDAG.cpp updated: 1.67 -> 1.68 AlphaISelLowering.cpp updated: 1.76 -> 1.77 AlphaISelLowering.h updated: 1.23 -> 1.24 AlphaInstrInfo.td updated: 1.136 -> 1.137 AlphaSubtarget.cpp updated: 1.7 -> 1.8 AlphaSubtarget.h updated: 1.5 -> 1.6 --- Log message: FTOIT and ITOFT are bit converts, and if we drop 21264s, are always available --- Diffs of the changes: (+17 -73) Alpha.td | 8 ++------ AlphaAsmPrinter.cpp | 7 +++---- AlphaISelDAGToDAG.cpp | 35 ++++------------------------------- AlphaISelLowering.cpp | 27 ++++----------------------- AlphaISelLowering.h | 2 +- AlphaInstrInfo.td | 6 ++---- AlphaSubtarget.cpp | 2 +- AlphaSubtarget.h | 3 --- 8 files changed, 17 insertions(+), 73 deletions(-) Index: llvm/lib/Target/Alpha/Alpha.td diff -u llvm/lib/Target/Alpha/Alpha.td:1.11 llvm/lib/Target/Alpha/Alpha.td:1.12 --- llvm/lib/Target/Alpha/Alpha.td:1.11 Wed May 17 19:11:53 2006 +++ llvm/lib/Target/Alpha/Alpha.td Wed Jan 24 15:09:16 2007 @@ -22,8 +22,6 @@ def FeatureCIX : SubtargetFeature<"CIX", "HasCT", "true", "Enable CIX extentions">; -def FeatureFIX : SubtargetFeature<"FIX", "HasF2I", "true", - "Enable FIX extentions">; //===----------------------------------------------------------------------===// // Register File Description @@ -54,10 +52,8 @@ //===----------------------------------------------------------------------===// def : Processor<"generic", Alpha21264Itineraries, []>; -def : Processor<"pca56" , Alpha21264Itineraries, []>; -def : Processor<"ev56" , Alpha21264Itineraries, []>; -def : Processor<"ev6" , Alpha21264Itineraries, [FeatureFIX]>; -def : Processor<"ev67" , Alpha21264Itineraries, [FeatureFIX, FeatureCIX]>; +def : Processor<"ev6" , Alpha21264Itineraries, []>; +def : Processor<"ev67" , Alpha21264Itineraries, [FeatureCIX]>; //===----------------------------------------------------------------------===// // The Alpha Target Index: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp diff -u llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.61 llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.62 --- llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.61 Wed Jan 24 01:03:39 2007 +++ llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp Wed Jan 24 15:09:16 2007 @@ -190,11 +190,10 @@ bool AlphaAsmPrinter::doInitialization(Module &M) { AsmPrinter::doInitialization(M); - if(TM.getSubtarget().hasF2I() - || TM.getSubtarget().hasCT()) - O << "\t.arch ev6\n"; + if(TM.getSubtarget().hasCT()) + O << "\t.arch ev6\n"; //This might need to be ev67, so leave this test here else - O << "\t.arch ev56\n"; + O << "\t.arch ev6\n"; O << "\t.set noat\n"; return false; } Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.67 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.68 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.67 Wed Jan 24 12:43:14 2007 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Wed Jan 24 15:09:16 2007 @@ -394,24 +394,10 @@ default: break; } - SDOperand LD; - if (AlphaLowering.hasITOF()) { - LD = CurDAG->getNode(AlphaISD::FTOIT_, MVT::i64, SDOperand(cmp, 0)); - } else { - int FrameIdx = - CurDAG->getMachineFunction().getFrameInfo()->CreateStackObject(8, 8); - SDOperand FI = CurDAG->getFrameIndex(FrameIdx, MVT::i64); - SDOperand ST = - SDOperand(CurDAG->getTargetNode(Alpha::STT, MVT::Other, - SDOperand(cmp, 0), FI, - CurDAG->getRegister(Alpha::R31, MVT::i64)), 0); - LD = SDOperand(CurDAG->getTargetNode(Alpha::LDQ, MVT::i64, FI, - CurDAG->getRegister(Alpha::R31, MVT::i64), - ST), 0); - } + SDNode* LD = CurDAG->getTargetNode(Alpha::FTOIT, MVT::i64, SDOperand(cmp, 0)); return CurDAG->getTargetNode(Alpha::CMPULT, MVT::i64, CurDAG->getRegister(Alpha::R31, MVT::i64), - LD); + SDOperand(LD,0)); } break; @@ -424,7 +410,6 @@ // so that things like this can be caught in fall though code //move int to fp bool isDouble = N->getValueType(0) == MVT::f64; - SDOperand LD; SDOperand cond = N->getOperand(0); SDOperand TV = N->getOperand(1); SDOperand FV = N->getOperand(2); @@ -432,21 +417,9 @@ AddToISelQueue(TV); AddToISelQueue(FV); - if (AlphaLowering.hasITOF()) { - LD = CurDAG->getNode(AlphaISD::ITOFT_, MVT::f64, cond); - } else { - int FrameIdx = - CurDAG->getMachineFunction().getFrameInfo()->CreateStackObject(8, 8); - SDOperand FI = CurDAG->getFrameIndex(FrameIdx, MVT::i64); - SDOperand ST = - SDOperand(CurDAG->getTargetNode(Alpha::STQ, MVT::Other, - cond, FI, CurDAG->getRegister(Alpha::R31, MVT::i64)), 0); - LD = SDOperand(CurDAG->getTargetNode(Alpha::LDT, MVT::f64, FI, - CurDAG->getRegister(Alpha::R31, MVT::i64), - ST), 0); - } + SDNode* LD = CurDAG->getTargetNode(Alpha::ITOFT, MVT::f64, cond); return CurDAG->getTargetNode(isDouble?Alpha::FCMOVNET:Alpha::FCMOVNES, - MVT::f64, FV, TV, LD); + MVT::f64, FV, TV, SDOperand(LD,0)); } break; Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.76 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.77 --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.76 Sat Dec 30 23:55:36 2006 +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Wed Jan 24 15:09:16 2007 @@ -104,6 +104,8 @@ setOperationAction(ISD::SETCC, MVT::f32, Promote); + setOperationAction(ISD::BIT_CONVERT, MVT::f32, Promote); + // We don't have line number support yet. setOperationAction(ISD::LOCATION, MVT::Other, Expand); setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); @@ -143,15 +145,11 @@ setJumpBufAlignment(16); computeRegisterProperties(); - - useITOF = TM.getSubtarget().hasF2I(); } const char *AlphaTargetLowering::getTargetNodeName(unsigned Opcode) const { switch (Opcode) { default: return 0; - case AlphaISD::ITOFT_: return "Alpha::ITOFT_"; - case AlphaISD::FTOIT_: return "Alpha::FTOIT_"; case AlphaISD::CVTQT_: return "Alpha::CVTQT_"; case AlphaISD::CVTQS_: return "Alpha::CVTQS_"; case AlphaISD::CVTTQ_: return "Alpha::CVTTQ_"; @@ -398,16 +396,7 @@ "Unhandled SINT_TO_FP type in custom expander!"); SDOperand LD; bool isDouble = MVT::f64 == Op.getValueType(); - if (useITOF) { - LD = DAG.getNode(AlphaISD::ITOFT_, MVT::f64, Op.getOperand(0)); - } else { - int FrameIdx = - DAG.getMachineFunction().getFrameInfo()->CreateStackObject(8, 8); - SDOperand FI = DAG.getFrameIndex(FrameIdx, MVT::i64); - SDOperand ST = DAG.getStore(DAG.getEntryNode(), - Op.getOperand(0), FI, NULL, 0); - LD = DAG.getLoad(MVT::f64, ST, FI, NULL, 0); - } + LD = DAG.getNode(ISD::BIT_CONVERT, MVT::f64, Op.getOperand(0)); SDOperand FP = DAG.getNode(isDouble?AlphaISD::CVTQT_:AlphaISD::CVTQS_, isDouble?MVT::f64:MVT::f32, LD); return FP; @@ -421,15 +410,7 @@ src = DAG.getNode(AlphaISD::CVTTQ_, MVT::f64, src); - if (useITOF) { - return DAG.getNode(AlphaISD::FTOIT_, MVT::i64, src); - } else { - int FrameIdx = - DAG.getMachineFunction().getFrameInfo()->CreateStackObject(8, 8); - SDOperand FI = DAG.getFrameIndex(FrameIdx, MVT::i64); - SDOperand ST = DAG.getStore(DAG.getEntryNode(), src, FI, NULL, 0); - return DAG.getLoad(MVT::i64, ST, FI, NULL, 0); - } + return DAG.getNode(ISD::BIT_CONVERT, MVT::i64, src); } case ISD::ConstantPool: { ConstantPoolSDNode *CP = cast(Op); Index: llvm/lib/Target/Alpha/AlphaISelLowering.h diff -u llvm/lib/Target/Alpha/AlphaISelLowering.h:1.23 llvm/lib/Target/Alpha/AlphaISelLowering.h:1.24 --- llvm/lib/Target/Alpha/AlphaISelLowering.h:1.23 Sat Dec 30 23:55:36 2006 +++ llvm/lib/Target/Alpha/AlphaISelLowering.h Wed Jan 24 15:09:16 2007 @@ -27,7 +27,7 @@ // Start the numbering where the builting ops and target ops leave off. FIRST_NUMBER = ISD::BUILTIN_OP_END+Alpha::INSTRUCTION_LIST_END, //These corrospond to the identical Instruction - ITOFT_, FTOIT_, CVTQT_, CVTQS_, CVTTQ_, + CVTQT_, CVTQS_, CVTTQ_, /// GPRelHi/GPRelLo - These represent the high and low 16-bit /// parts of a global address respectively. Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.136 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.137 --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.136 Thu Dec 7 11:39:14 2006 +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Wed Jan 24 15:09:16 2007 @@ -19,8 +19,6 @@ def SDTFPUnaryOpUnC : SDTypeProfile<1, 1, [ SDTCisFP<1>, SDTCisFP<0> ]>; -def Alpha_itoft : SDNode<"AlphaISD::ITOFT_", SDTIntToFPOp, []>; -def Alpha_ftoit : SDNode<"AlphaISD::FTOIT_", SDTFPToIntOp, []>; def Alpha_cvtqt : SDNode<"AlphaISD::CVTQT_", SDTFPUnaryOpUnC, []>; def Alpha_cvtqs : SDNode<"AlphaISD::CVTQS_", SDTFPUnaryOpUnC, []>; def Alpha_cvttq : SDNode<"AlphaISD::CVTTQ_" , SDTFPUnaryOp, []>; @@ -745,12 +743,12 @@ def FTOIS : FPForm<0x1C, 0x078, "ftois $RA,$RC",[], s_ftoi>; //Floating to integer move, S_floating let OperandList = (ops GPRC:$RC, F8RC:$RA), Fb = 31 in def FTOIT : FPForm<0x1C, 0x070, "ftoit $RA,$RC", - [(set GPRC:$RC, (Alpha_ftoit F8RC:$RA))], s_ftoi>; //Floating to integer move + [(set GPRC:$RC, (bitconvert F8RC:$RA))], s_ftoi>; //Floating to integer move let OperandList = (ops F4RC:$RC, GPRC:$RA), Fb = 31 in def ITOFS : FPForm<0x14, 0x004, "itofs $RA,$RC",[], s_itof>; //Integer to floating move, S_floating let OperandList = (ops F8RC:$RC, GPRC:$RA), Fb = 31 in def ITOFT : FPForm<0x14, 0x024, "itoft $RA,$RC", - [(set F8RC:$RC, (Alpha_itoft GPRC:$RA))], s_itof>; //Integer to floating move + [(set F8RC:$RC, (bitconvert GPRC:$RA))], s_itof>; //Integer to floating move let OperandList = (ops F4RC:$RC, F8RC:$RB), Fa = 31 in Index: llvm/lib/Target/Alpha/AlphaSubtarget.cpp diff -u llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.7 llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.8 --- llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.7 Wed Oct 26 12:30:34 2005 +++ llvm/lib/Target/Alpha/AlphaSubtarget.cpp Wed Jan 24 15:09:16 2007 @@ -17,7 +17,7 @@ using namespace llvm; AlphaSubtarget::AlphaSubtarget(const Module &M, const std::string &FS) - : HasF2I(false), HasCT(false) { + : HasCT(false) { std::string CPU = "generic"; // Parse features string. Index: llvm/lib/Target/Alpha/AlphaSubtarget.h diff -u llvm/lib/Target/Alpha/AlphaSubtarget.h:1.5 llvm/lib/Target/Alpha/AlphaSubtarget.h:1.6 --- llvm/lib/Target/Alpha/AlphaSubtarget.h:1.5 Thu Mar 9 11:16:45 2006 +++ llvm/lib/Target/Alpha/AlphaSubtarget.h Wed Jan 24 15:09:16 2007 @@ -25,8 +25,6 @@ class AlphaSubtarget : public TargetSubtarget { protected: - /// Used by the ISel to turn in optimizations for POWER4-derived architectures - bool HasF2I; bool HasCT; InstrItineraryData InstrItins; @@ -41,7 +39,6 @@ /// subtarget options. Definition of function is auto generated by tblgen. void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU); - bool hasF2I() const { return HasF2I; } bool hasCT() const { return HasCT; } }; } // End llvm namespace From andrewl at lenharth.org Wed Jan 24 15:19:26 2007 From: andrewl at lenharth.org (Andrew Lenharth) Date: Wed, 24 Jan 2007 15:19:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/Alpha.td AlphaAsmPrinter.cpp AlphaISelDAGToDAG.cpp AlphaISelLowering.cpp AlphaISelLowering.h AlphaInstrInfo.td AlphaSubtarget.cpp AlphaSubtarget.h In-Reply-To: <200701242109.l0OL9Vcr024156@zion.cs.uiuc.edu> References: <200701242109.l0OL9Vcr024156@zion.cs.uiuc.edu> Message-ID: <85dfcd7f0701241319s4fa0099es4d072da385dfb1c@mail.gmail.com> Err, um, I meant 21164. dropping 21264 would be bad... On 1/24/07, Andrew Lenharth wrote: > > > Changes in directory llvm/lib/Target/Alpha: > > Alpha.td updated: 1.11 -> 1.12 > AlphaAsmPrinter.cpp updated: 1.61 -> 1.62 > AlphaISelDAGToDAG.cpp updated: 1.67 -> 1.68 > AlphaISelLowering.cpp updated: 1.76 -> 1.77 > AlphaISelLowering.h updated: 1.23 -> 1.24 > AlphaInstrInfo.td updated: 1.136 -> 1.137 > AlphaSubtarget.cpp updated: 1.7 -> 1.8 > AlphaSubtarget.h updated: 1.5 -> 1.6 > --- > Log message: > > FTOIT and ITOFT are bit converts, and if we drop 21264s, are always available > > --- > Diffs of the changes: (+17 -73) > > Alpha.td | 8 ++------ > AlphaAsmPrinter.cpp | 7 +++---- > AlphaISelDAGToDAG.cpp | 35 ++++------------------------------- > AlphaISelLowering.cpp | 27 ++++----------------------- > AlphaISelLowering.h | 2 +- > AlphaInstrInfo.td | 6 ++---- > AlphaSubtarget.cpp | 2 +- > AlphaSubtarget.h | 3 --- > 8 files changed, 17 insertions(+), 73 deletions(-) > > > Index: llvm/lib/Target/Alpha/Alpha.td > diff -u llvm/lib/Target/Alpha/Alpha.td:1.11 llvm/lib/Target/Alpha/Alpha.td:1.12 > --- llvm/lib/Target/Alpha/Alpha.td:1.11 Wed May 17 19:11:53 2006 > +++ llvm/lib/Target/Alpha/Alpha.td Wed Jan 24 15:09:16 2007 > @@ -22,8 +22,6 @@ > > def FeatureCIX : SubtargetFeature<"CIX", "HasCT", "true", > "Enable CIX extentions">; > -def FeatureFIX : SubtargetFeature<"FIX", "HasF2I", "true", > - "Enable FIX extentions">; > > //===----------------------------------------------------------------------===// > // Register File Description > @@ -54,10 +52,8 @@ > //===----------------------------------------------------------------------===// > > def : Processor<"generic", Alpha21264Itineraries, []>; > -def : Processor<"pca56" , Alpha21264Itineraries, []>; > -def : Processor<"ev56" , Alpha21264Itineraries, []>; > -def : Processor<"ev6" , Alpha21264Itineraries, [FeatureFIX]>; > -def : Processor<"ev67" , Alpha21264Itineraries, [FeatureFIX, FeatureCIX]>; > +def : Processor<"ev6" , Alpha21264Itineraries, []>; > +def : Processor<"ev67" , Alpha21264Itineraries, [FeatureCIX]>; > > //===----------------------------------------------------------------------===// > // The Alpha Target > > > Index: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp > diff -u llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.61 llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.62 > --- llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.61 Wed Jan 24 01:03:39 2007 > +++ llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp Wed Jan 24 15:09:16 2007 > @@ -190,11 +190,10 @@ > bool AlphaAsmPrinter::doInitialization(Module &M) > { > AsmPrinter::doInitialization(M); > - if(TM.getSubtarget().hasF2I() > - || TM.getSubtarget().hasCT()) > - O << "\t.arch ev6\n"; > + if(TM.getSubtarget().hasCT()) > + O << "\t.arch ev6\n"; //This might need to be ev67, so leave this test here > else > - O << "\t.arch ev56\n"; > + O << "\t.arch ev6\n"; > O << "\t.set noat\n"; > return false; > } > > > Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp > diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.67 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.68 > --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.67 Wed Jan 24 12:43:14 2007 > +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Wed Jan 24 15:09:16 2007 > @@ -394,24 +394,10 @@ > default: break; > } > > - SDOperand LD; > - if (AlphaLowering.hasITOF()) { > - LD = CurDAG->getNode(AlphaISD::FTOIT_, MVT::i64, SDOperand(cmp, 0)); > - } else { > - int FrameIdx = > - CurDAG->getMachineFunction().getFrameInfo()->CreateStackObject(8, 8); > - SDOperand FI = CurDAG->getFrameIndex(FrameIdx, MVT::i64); > - SDOperand ST = > - SDOperand(CurDAG->getTargetNode(Alpha::STT, MVT::Other, > - SDOperand(cmp, 0), FI, > - CurDAG->getRegister(Alpha::R31, MVT::i64)), 0); > - LD = SDOperand(CurDAG->getTargetNode(Alpha::LDQ, MVT::i64, FI, > - CurDAG->getRegister(Alpha::R31, MVT::i64), > - ST), 0); > - } > + SDNode* LD = CurDAG->getTargetNode(Alpha::FTOIT, MVT::i64, SDOperand(cmp, 0)); > return CurDAG->getTargetNode(Alpha::CMPULT, MVT::i64, > CurDAG->getRegister(Alpha::R31, MVT::i64), > - LD); > + SDOperand(LD,0)); > } > break; > > @@ -424,7 +410,6 @@ > // so that things like this can be caught in fall though code > //move int to fp > bool isDouble = N->getValueType(0) == MVT::f64; > - SDOperand LD; > SDOperand cond = N->getOperand(0); > SDOperand TV = N->getOperand(1); > SDOperand FV = N->getOperand(2); > @@ -432,21 +417,9 @@ > AddToISelQueue(TV); > AddToISelQueue(FV); > > - if (AlphaLowering.hasITOF()) { > - LD = CurDAG->getNode(AlphaISD::ITOFT_, MVT::f64, cond); > - } else { > - int FrameIdx = > - CurDAG->getMachineFunction().getFrameInfo()->CreateStackObject(8, 8); > - SDOperand FI = CurDAG->getFrameIndex(FrameIdx, MVT::i64); > - SDOperand ST = > - SDOperand(CurDAG->getTargetNode(Alpha::STQ, MVT::Other, > - cond, FI, CurDAG->getRegister(Alpha::R31, MVT::i64)), 0); > - LD = SDOperand(CurDAG->getTargetNode(Alpha::LDT, MVT::f64, FI, > - CurDAG->getRegister(Alpha::R31, MVT::i64), > - ST), 0); > - } > + SDNode* LD = CurDAG->getTargetNode(Alpha::ITOFT, MVT::f64, cond); > return CurDAG->getTargetNode(isDouble?Alpha::FCMOVNET:Alpha::FCMOVNES, > - MVT::f64, FV, TV, LD); > + MVT::f64, FV, TV, SDOperand(LD,0)); > } > break; > > > > Index: llvm/lib/Target/Alpha/AlphaISelLowering.cpp > diff -u llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.76 llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.77 > --- llvm/lib/Target/Alpha/AlphaISelLowering.cpp:1.76 Sat Dec 30 23:55:36 2006 > +++ llvm/lib/Target/Alpha/AlphaISelLowering.cpp Wed Jan 24 15:09:16 2007 > @@ -104,6 +104,8 @@ > > setOperationAction(ISD::SETCC, MVT::f32, Promote); > > + setOperationAction(ISD::BIT_CONVERT, MVT::f32, Promote); > + > // We don't have line number support yet. > setOperationAction(ISD::LOCATION, MVT::Other, Expand); > setOperationAction(ISD::DEBUG_LOC, MVT::Other, Expand); > @@ -143,15 +145,11 @@ > setJumpBufAlignment(16); > > computeRegisterProperties(); > - > - useITOF = TM.getSubtarget().hasF2I(); > } > > const char *AlphaTargetLowering::getTargetNodeName(unsigned Opcode) const { > switch (Opcode) { > default: return 0; > - case AlphaISD::ITOFT_: return "Alpha::ITOFT_"; > - case AlphaISD::FTOIT_: return "Alpha::FTOIT_"; > case AlphaISD::CVTQT_: return "Alpha::CVTQT_"; > case AlphaISD::CVTQS_: return "Alpha::CVTQS_"; > case AlphaISD::CVTTQ_: return "Alpha::CVTTQ_"; > @@ -398,16 +396,7 @@ > "Unhandled SINT_TO_FP type in custom expander!"); > SDOperand LD; > bool isDouble = MVT::f64 == Op.getValueType(); > - if (useITOF) { > - LD = DAG.getNode(AlphaISD::ITOFT_, MVT::f64, Op.getOperand(0)); > - } else { > - int FrameIdx = > - DAG.getMachineFunction().getFrameInfo()->CreateStackObject(8, 8); > - SDOperand FI = DAG.getFrameIndex(FrameIdx, MVT::i64); > - SDOperand ST = DAG.getStore(DAG.getEntryNode(), > - Op.getOperand(0), FI, NULL, 0); > - LD = DAG.getLoad(MVT::f64, ST, FI, NULL, 0); > - } > + LD = DAG.getNode(ISD::BIT_CONVERT, MVT::f64, Op.getOperand(0)); > SDOperand FP = DAG.getNode(isDouble?AlphaISD::CVTQT_:AlphaISD::CVTQS_, > isDouble?MVT::f64:MVT::f32, LD); > return FP; > @@ -421,15 +410,7 @@ > > src = DAG.getNode(AlphaISD::CVTTQ_, MVT::f64, src); > > - if (useITOF) { > - return DAG.getNode(AlphaISD::FTOIT_, MVT::i64, src); > - } else { > - int FrameIdx = > - DAG.getMachineFunction().getFrameInfo()->CreateStackObject(8, 8); > - SDOperand FI = DAG.getFrameIndex(FrameIdx, MVT::i64); > - SDOperand ST = DAG.getStore(DAG.getEntryNode(), src, FI, NULL, 0); > - return DAG.getLoad(MVT::i64, ST, FI, NULL, 0); > - } > + return DAG.getNode(ISD::BIT_CONVERT, MVT::i64, src); > } > case ISD::ConstantPool: { > ConstantPoolSDNode *CP = cast(Op); > > > Index: llvm/lib/Target/Alpha/AlphaISelLowering.h > diff -u llvm/lib/Target/Alpha/AlphaISelLowering.h:1.23 llvm/lib/Target/Alpha/AlphaISelLowering.h:1.24 > --- llvm/lib/Target/Alpha/AlphaISelLowering.h:1.23 Sat Dec 30 23:55:36 2006 > +++ llvm/lib/Target/Alpha/AlphaISelLowering.h Wed Jan 24 15:09:16 2007 > @@ -27,7 +27,7 @@ > // Start the numbering where the builting ops and target ops leave off. > FIRST_NUMBER = ISD::BUILTIN_OP_END+Alpha::INSTRUCTION_LIST_END, > //These corrospond to the identical Instruction > - ITOFT_, FTOIT_, CVTQT_, CVTQS_, CVTTQ_, > + CVTQT_, CVTQS_, CVTTQ_, > > /// GPRelHi/GPRelLo - These represent the high and low 16-bit > /// parts of a global address respectively. > > > Index: llvm/lib/Target/Alpha/AlphaInstrInfo.td > diff -u llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.136 llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.137 > --- llvm/lib/Target/Alpha/AlphaInstrInfo.td:1.136 Thu Dec 7 11:39:14 2006 > +++ llvm/lib/Target/Alpha/AlphaInstrInfo.td Wed Jan 24 15:09:16 2007 > @@ -19,8 +19,6 @@ > def SDTFPUnaryOpUnC : SDTypeProfile<1, 1, [ > SDTCisFP<1>, SDTCisFP<0> > ]>; > -def Alpha_itoft : SDNode<"AlphaISD::ITOFT_", SDTIntToFPOp, []>; > -def Alpha_ftoit : SDNode<"AlphaISD::FTOIT_", SDTFPToIntOp, []>; > def Alpha_cvtqt : SDNode<"AlphaISD::CVTQT_", SDTFPUnaryOpUnC, []>; > def Alpha_cvtqs : SDNode<"AlphaISD::CVTQS_", SDTFPUnaryOpUnC, []>; > def Alpha_cvttq : SDNode<"AlphaISD::CVTTQ_" , SDTFPUnaryOp, []>; > @@ -745,12 +743,12 @@ > def FTOIS : FPForm<0x1C, 0x078, "ftois $RA,$RC",[], s_ftoi>; //Floating to integer move, S_floating > let OperandList = (ops GPRC:$RC, F8RC:$RA), Fb = 31 in > def FTOIT : FPForm<0x1C, 0x070, "ftoit $RA,$RC", > - [(set GPRC:$RC, (Alpha_ftoit F8RC:$RA))], s_ftoi>; //Floating to integer move > + [(set GPRC:$RC, (bitconvert F8RC:$RA))], s_ftoi>; //Floating to integer move > let OperandList = (ops F4RC:$RC, GPRC:$RA), Fb = 31 in > def ITOFS : FPForm<0x14, 0x004, "itofs $RA,$RC",[], s_itof>; //Integer to floating move, S_floating > let OperandList = (ops F8RC:$RC, GPRC:$RA), Fb = 31 in > def ITOFT : FPForm<0x14, 0x024, "itoft $RA,$RC", > - [(set F8RC:$RC, (Alpha_itoft GPRC:$RA))], s_itof>; //Integer to floating move > + [(set F8RC:$RC, (bitconvert GPRC:$RA))], s_itof>; //Integer to floating move > > > let OperandList = (ops F4RC:$RC, F8RC:$RB), Fa = 31 in > > > Index: llvm/lib/Target/Alpha/AlphaSubtarget.cpp > diff -u llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.7 llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.8 > --- llvm/lib/Target/Alpha/AlphaSubtarget.cpp:1.7 Wed Oct 26 12:30:34 2005 > +++ llvm/lib/Target/Alpha/AlphaSubtarget.cpp Wed Jan 24 15:09:16 2007 > @@ -17,7 +17,7 @@ > using namespace llvm; > > AlphaSubtarget::AlphaSubtarget(const Module &M, const std::string &FS) > - : HasF2I(false), HasCT(false) { > + : HasCT(false) { > std::string CPU = "generic"; > > // Parse features string. > > > Index: llvm/lib/Target/Alpha/AlphaSubtarget.h > diff -u llvm/lib/Target/Alpha/AlphaSubtarget.h:1.5 llvm/lib/Target/Alpha/AlphaSubtarget.h:1.6 > --- llvm/lib/Target/Alpha/AlphaSubtarget.h:1.5 Thu Mar 9 11:16:45 2006 > +++ llvm/lib/Target/Alpha/AlphaSubtarget.h Wed Jan 24 15:09:16 2007 > @@ -25,8 +25,6 @@ > class AlphaSubtarget : public TargetSubtarget { > protected: > > - /// Used by the ISel to turn in optimizations for POWER4-derived architectures > - bool HasF2I; > bool HasCT; > > InstrItineraryData InstrItins; > @@ -41,7 +39,6 @@ > /// subtarget options. Definition of function is auto generated by tblgen. > void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU); > > - bool hasF2I() const { return HasF2I; } > bool hasCT() const { return HasCT; } > }; > } // End llvm namespace > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > From sabre at nondot.org Wed Jan 24 20:52:49 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 24 Jan 2007 20:52:49 -0600 Subject: [llvm-commits] CVS: llvm/test/CFrontend/2007-01-24-InlineAsmCModifier.c Message-ID: <200701250252.l0P2qnqF031202@zion.cs.uiuc.edu> Changes in directory llvm/test/CFrontend: 2007-01-24-InlineAsmCModifier.c added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+9 -0) 2007-01-24-InlineAsmCModifier.c | 9 +++++++++ 1 files changed, 9 insertions(+) Index: llvm/test/CFrontend/2007-01-24-InlineAsmCModifier.c diff -c /dev/null llvm/test/CFrontend/2007-01-24-InlineAsmCModifier.c:1.1 *** /dev/null Wed Jan 24 20:52:43 2007 --- llvm/test/CFrontend/2007-01-24-InlineAsmCModifier.c Wed Jan 24 20:52:33 2007 *************** *** 0 **** --- 1,9 ---- + // Verify that the %c modifier works and strips off any prefixes from immediates. + // RUN: %llvmgcc -S %s -o - | llvm-as | llc | grep 'pickANumber: 789514' + + void foo() { + __asm__ volatile("/* " "pickANumber" ": %c0 */"::"i"(0xC0C0A)); + + // Check that non-c modifiers work also (not greped for above). + __asm__ volatile("/* " "pickANumber2 " ": %0 */"::"i"(123)); + } From sabre at nondot.org Wed Jan 24 20:53:06 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 24 Jan 2007 20:53:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Message-ID: <200701250253.l0P2r6lr031255@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.228 -> 1.229 --- Log message: Fix test/CFrontend/2007-01-24-InlineAsmCModifier.c on PPC --- Diffs of the changes: (+4 -0) PPCAsmPrinter.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.228 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.229 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.228 Sun Jan 14 00:37:54 2007 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Wed Jan 24 20:52:50 2007 @@ -412,6 +412,10 @@ switch (ExtraCode[0]) { default: return true; // Unknown modifier. + case 'c': // Don't print "$" before a global var name or constant. + // PPC never has a prefix. + printOperand(MI, OpNo); + return false; case 'L': // Write second word of DImode reference. // Verify that this operand has two consecutive registers. if (!MI->getOperand(OpNo).isRegister() || From sabre at nondot.org Wed Jan 24 20:53:40 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 24 Jan 2007 20:53:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Message-ID: <200701250253.l0P2resM031273@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.93 -> 1.94 --- Log message: Fix test/CFrontend/2007-01-24-InlineAsmCModifier.c on X86. The %c modifier says that no $ prefix should be emitted on X86. --- Diffs of the changes: (+3 -2) X86ATTAsmPrinter.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.93 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.94 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.93 Thu Jan 18 16:27:12 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Wed Jan 24 20:53:24 2007 @@ -219,7 +219,8 @@ } case MachineOperand::MO_Immediate: - if (!Modifier || strcmp(Modifier, "debug") != 0) + if (!Modifier || + (strcmp(Modifier, "debug") && strcmp(Modifier, "mem"))) O << '$'; O << MO.getImmedValue(); return; @@ -491,7 +492,7 @@ switch (ExtraCode[0]) { default: return true; // Unknown modifier. - case 'c': // Don't print "$" before a global var name. + case 'c': // Don't print "$" before a global var name or constant. printOperand(MI, OpNo, "mem"); return false; case 'b': // Print QImode register From evan.cheng at apple.com Wed Jan 24 21:07:42 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 24 Jan 2007 21:07:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMMachineFunctionInfo.h ARMRegisterInfo.h Message-ID: <200701250307.l0P37gKT031593@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.46 -> 1.47 ARMMachineFunctionInfo.h updated: 1.2 -> 1.3 ARMRegisterInfo.h updated: 1.6 -> 1.7 --- Log message: Getting rid uses of evil std::set<> --- Diffs of the changes: (+39 -23) ARMAsmPrinter.cpp | 1 ARMMachineFunctionInfo.h | 60 ++++++++++++++++++++++++++++++----------------- ARMRegisterInfo.h | 1 3 files changed, 39 insertions(+), 23 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.46 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.47 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.46 Tue Jan 23 16:59:13 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Wed Jan 24 21:07:27 2007 @@ -37,7 +37,6 @@ #include "llvm/Support/MathExtras.h" #include #include -#include using namespace llvm; STATISTIC(EmittedInsts, "Number of machine instrs printed"); Index: llvm/lib/Target/ARM/ARMMachineFunctionInfo.h diff -u llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.2 llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.3 --- llvm/lib/Target/ARM/ARMMachineFunctionInfo.h:1.2 Fri Jan 19 20:09:25 2007 +++ llvm/lib/Target/ARM/ARMMachineFunctionInfo.h Wed Jan 24 21:07:27 2007 @@ -60,9 +60,9 @@ /// GPRCS1Frames, GPRCS2Frames, DPRCSFrames - Keeps track of frame indices /// which belong to these spill areas. - std::set GPRCS1Frames; - std::set GPRCS2Frames; - std::set DPRCSFrames; + std::vector GPRCS1Frames; + std::vector GPRCS2Frames; + std::vector DPRCSFrames; /// JumpTableUId - Unique id for jumptables. /// @@ -107,24 +107,42 @@ void setGPRCalleeSavedArea2Size(unsigned s) { GPRCS2Size = s; } void setDPRCalleeSavedAreaSize(unsigned s) { DPRCSSize = s; } - bool isGPRCalleeSavedArea1Frame(unsigned fi) const { - return GPRCS1Frames.count(fi); - } - bool isGPRCalleeSavedArea2Frame(unsigned fi) const { - return GPRCS2Frames.count(fi); - } - bool isDPRCalleeSavedAreaFrame(unsigned fi) const { - return DPRCSFrames.count(fi); - } - - void addGPRCalleeSavedArea1Frame(unsigned fi) { - GPRCS1Frames.insert(fi); - } - void addGPRCalleeSavedArea2Frame(unsigned fi) { - GPRCS2Frames.insert(fi); - } - void addDPRCalleeSavedAreaFrame(unsigned fi) { - DPRCSFrames.insert(fi); + bool isGPRCalleeSavedArea1Frame(int fi) const { + if (fi < 0 || fi >= (int)GPRCS1Frames.size()) + return false; + return GPRCS1Frames[fi]; + } + bool isGPRCalleeSavedArea2Frame(int fi) const { + if (fi < 0 || fi >= (int)GPRCS2Frames.size()) + return false; + return GPRCS2Frames[fi]; + } + bool isDPRCalleeSavedAreaFrame(int fi) const { + if (fi < 0 || fi >= (int)DPRCSFrames.size()) + return false; + return DPRCSFrames[fi]; + } + + void addGPRCalleeSavedArea1Frame(int fi) { + if (fi >= 0) { + if (fi >= (int)GPRCS1Frames.size()) + GPRCS1Frames.resize(fi+1); + GPRCS1Frames[fi] = true; + } + } + void addGPRCalleeSavedArea2Frame(int fi) { + if (fi >= 0) { + if (fi >= (int)GPRCS2Frames.size()) + GPRCS2Frames.resize(fi+1); + GPRCS2Frames[fi] = true; + } + } + void addDPRCalleeSavedAreaFrame(int fi) { + if (fi >= 0) { + if (fi >= (int)DPRCSFrames.size()) + DPRCSFrames.resize(fi+1); + DPRCSFrames[fi] = true; + } } unsigned createJumpTableUId() { Index: llvm/lib/Target/ARM/ARMRegisterInfo.h diff -u llvm/lib/Target/ARM/ARMRegisterInfo.h:1.6 llvm/lib/Target/ARM/ARMRegisterInfo.h:1.7 --- llvm/lib/Target/ARM/ARMRegisterInfo.h:1.6 Mon Jan 22 18:52:44 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.h Wed Jan 24 21:07:27 2007 @@ -17,7 +17,6 @@ #include "llvm/Target/MRegisterInfo.h" #include "ARMGenRegisterInfo.h.inc" -#include namespace llvm { class TargetInstrInfo; From evan.cheng at apple.com Wed Jan 24 21:13:02 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 24 Jan 2007 21:13:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701250313.l0P3D2Jc031697@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.2 -> 1.3 --- Log message: Added (preliminary) branch shortening capability to constantpool island pass. --- Diffs of the changes: (+130 -7) ARMConstantIslandPass.cpp | 137 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 130 insertions(+), 7 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.2 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.3 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.2 Wed Jan 24 02:53:17 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jan 24 21:12:46 2007 @@ -15,6 +15,7 @@ #define DEBUG_TYPE "arm-cp-islands" #include "ARM.h" +#include "ARMMachineFunctionInfo.h" #include "ARMInstrInfo.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunctionPass.h" @@ -72,13 +73,30 @@ /// constant pools and their max displacement. std::vector CPUsers; + /// ImmBranch - One per immediate branch, keeping the machine instruction + /// pointer, conditional or unconditional, the max displacement, + /// and (if isCond is true) the corresponding unconditional branch + /// opcode. + struct ImmBranch { + MachineInstr *MI; + bool isCond; + int UncondBr; + unsigned MaxDisp; + ImmBranch(MachineInstr *mi, bool cond, int ubr, unsigned maxdisp) + : MI(mi), isCond(cond), UncondBr(ubr), MaxDisp(maxdisp) {} + }; + + /// Branches - Keep track of all the immediate branche instructions. + /// + std::vector ImmBranches; + const TargetInstrInfo *TII; const TargetAsmInfo *TAI; public: virtual bool runOnMachineFunction(MachineFunction &Fn); virtual const char *getPassName() const { - return "ARM constant island placement pass"; + return "ARM constant island placement and branch shortening pass"; } private: @@ -87,16 +105,18 @@ void InitialFunctionScan(MachineFunction &Fn, const std::vector &CPEMIs); void SplitBlockBeforeInstr(MachineInstr *MI); - bool HandleConstantPoolUser(MachineFunction &Fn, CPUser &U); void UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB); + bool HandleConstantPoolUser(MachineFunction &Fn, CPUser &U); + bool ShortenImmediateBranch(MachineFunction &Fn, ImmBranch &Br); unsigned GetInstSize(MachineInstr *MI) const; unsigned GetOffsetOf(MachineInstr *MI) const; + unsigned GetOffsetOf(MachineBasicBlock *MBB) const; }; } -/// createARMLoadStoreOptimizationPass - returns an instance of the load / store -/// optimization pass. +/// createARMConstantIslandPass - returns an instance of the constpool +/// island pass. FunctionPass *llvm::createARMConstantIslandPass() { return new ARMConstantIslands(); } @@ -133,11 +153,14 @@ MadeChange = false; for (unsigned i = 0, e = CPUsers.size(); i != e; ++i) MadeChange |= HandleConstantPoolUser(Fn, CPUsers[i]); + for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i) + MadeChange |= ShortenImmediateBranch(Fn, ImmBranches[i]); } while (MadeChange); BBSizes.clear(); WaterList.clear(); CPUsers.clear(); + ImmBranches.clear(); return true; } @@ -208,6 +231,37 @@ // Add instruction size to MBBSize. MBBSize += GetInstSize(I); + int Opc = I->getOpcode(); + if (TII->isBranch(Opc)) { + bool isCond = false; + unsigned Bits = 0; + unsigned Scale = 1; + int UOpc = Opc; + switch (Opc) { + default: break; // Ignore JT branches + case ARM::Bcc: + isCond = true; + UOpc = ARM::B; + // Fallthrough + case ARM::B: + Bits = 24; + Scale = 4; + break; + case ARM::tBcc: + isCond = true; + UOpc = ARM::tB; + Bits = 8; + Scale = 2; + break; + case ARM::tB: + Bits = 11; + Scale = 2; + break; + } + unsigned MaxDisp = (1 << (Bits-1)) * Scale; + ImmBranches.push_back(ImmBranch(I, isCond, UOpc, MaxDisp)); + } + // Scan the instructions for constant pool operands. for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) if (I->getOperand(op).isConstantPoolIndex()) { @@ -336,6 +390,18 @@ } } +/// GetOffsetOf - Return the current offset of the specified machine BB +/// from the start of the function. This offset changes as stuff is moved +/// around inside the function. +unsigned ARMConstantIslands::GetOffsetOf(MachineBasicBlock *MBB) const { + // Sum block sizes before MBB. + unsigned Offset = 0; + for (unsigned BB = 0, e = MBB->getNumber(); BB != e; ++BB) + Offset += BBSizes[BB]; + + return Offset; +} + /// CompareMBBNumbers - Little predicate function to sort the WaterList by MBB /// ID. static bool CompareMBBNumbers(const MachineBasicBlock *LHS, @@ -368,6 +434,8 @@ /// account for this change. void ARMConstantIslands::SplitBlockBeforeInstr(MachineInstr *MI) { MachineBasicBlock *OrigBB = MI->getParent(); + const ARMFunctionInfo *AFI = OrigBB->getParent()->getInfo(); + bool isThumb = AFI->isThumbFunction(); // Create a new MBB for the code after the OrigBB. MachineBasicBlock *NewBB = new MachineBasicBlock(OrigBB->getBasicBlock()); @@ -378,7 +446,7 @@ NewBB->splice(NewBB->end(), OrigBB, MI, OrigBB->end()); // Add an unconditional branch from OrigBB to NewBB. - BuildMI(OrigBB, TII->get(ARM::B)).addMBB(NewBB); + BuildMI(OrigBB, TII->get(isThumb ? ARM::tB : ARM::B)).addMBB(NewBB); NumSplit++; // Update the CFG. All succs of OrigBB are now succs of NewBB. @@ -409,8 +477,8 @@ BBSizes[NewBB->getNumber()] = NewBBSize; // We removed instructions from UserMBB, subtract that off from its size. - // Add 4 to the block to count the unconditional branch we added to it. - BBSizes[OrigBB->getNumber()] -= NewBBSize-4; + // Add 2 or 4 to the block to count the unconditional branch we added to it. + BBSizes[OrigBB->getNumber()] -= NewBBSize - (isThumb ? 2 : 4); } /// HandleConstantPoolUser - Analyze the specified user, checking to see if it @@ -491,3 +559,58 @@ return true; } +bool +ARMConstantIslands::ShortenImmediateBranch(MachineFunction &Fn, ImmBranch &Br) { + MachineInstr *MI = Br.MI; + MachineBasicBlock *DestBB = MI->getOperand(0).getMachineBasicBlock(); + + unsigned BrOffset = GetOffsetOf(MI); + unsigned DestOffset = GetOffsetOf(DestBB); + + // Check to see if the destination BB is in range. + if (BrOffset < DestOffset) { + if (DestOffset - BrOffset < Br.MaxDisp) + return false; + } else { + if (BrOffset - DestOffset <= Br.MaxDisp) + return false; + } + + if (!Br.isCond) { + // Unconditional branch. We have to insert a branch somewhere to perform + // a two level branch (branch to branch). FIXME: not yet implemented. + assert(false && "Can't handle unconditional branch yet!"); + return false; + } + + // Otherwise, add a unconditional branch to the destination and + // invert the branch condition to jump over it: + // blt L1 + // => + // bge L2 + // b L1 + // L2: + ARMCC::CondCodes CC = (ARMCC::CondCodes)MI->getOperand(1).getImmedValue(); + CC = ARMCC::getOppositeCondition(CC); + + // If the branch is at the end of its MBB and that has a fall-through block, + // direct the updated conditional branch to the fall-through block. Otherwise, + // split the MBB before the next instruction. + MachineBasicBlock *MBB = MI->getParent(); + if (&MBB->back() != MI || !BBHasFallthrough(MBB)) + SplitBlockBeforeInstr(MI); + MachineBasicBlock *NextBB = next(MachineFunction::iterator(MBB)); + + // Insert a unconditional branch and replace the conditional branch. + // Also update the ImmBranch as well as adding a new entry for the new branch. + BuildMI(MBB, TII->get(MI->getOpcode())).addMBB(NextBB).addImm((unsigned)CC); + Br.MI = &MBB->back(); + BuildMI(MBB, TII->get(Br.UncondBr)).addMBB(DestBB); + unsigned MaxDisp = (Br.UncondBr == ARM::tB) ? (1<<10)*2 : (1<<23)*4; + ImmBranches.push_back(ImmBranch(&MBB->back(), false, Br.UncondBr, MaxDisp)); + MI->eraseFromParent(); + + // Increase the size of MBB to account for the new unconditional branch. + BBSizes[MBB->getNumber()] += GetInstSize(&MBB->back()); + return true; +} From jlaskey at apple.com Thu Jan 25 09:12:21 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 25 Jan 2007 09:12:21 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h Message-ID: <200701251512.l0PFCLpZ020804@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: AsmPrinter.h updated: 1.59 -> 1.60 --- Log message: Migrate print routines to asm to be shared by exception handling. --- Diffs of the changes: (+62 -0) AsmPrinter.h | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 62 insertions(+) Index: llvm/include/llvm/CodeGen/AsmPrinter.h diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.59 llvm/include/llvm/CodeGen/AsmPrinter.h:1.60 --- llvm/include/llvm/CodeGen/AsmPrinter.h:1.59 Wed Jan 24 07:12:32 2007 +++ llvm/include/llvm/CodeGen/AsmPrinter.h Thu Jan 25 09:12:02 2007 @@ -175,6 +175,68 @@ bool EmitSpecialLLVMGlobal(const GlobalVariable *GV); public: + //===------------------------------------------------------------------===// + /// LEB 128 number encoding. + + /// PrintULEB128 - Print a series of hexidecimal values(separated by commas) + /// representing an unsigned leb128 value. + void PrintULEB128(unsigned Value) const; + + /// SizeULEB128 - Compute the number of bytes required for an unsigned + /// leb128 value. + static unsigned SizeULEB128(unsigned Value); + + /// PrintSLEB128 - Print a series of hexidecimal values(separated by commas) + /// representing a signed leb128 value. + void PrintSLEB128(int Value) const; + + /// SizeSLEB128 - Compute the number of bytes required for a signed leb128 + /// value. + static unsigned SizeSLEB128(int Value); + + //===------------------------------------------------------------------===// + // Emission and print routines + // + + /// PrintHex - Print a value as a hexidecimal value. + /// + void PrintHex(int Value) const; + + /// EOL - Print a newline character to asm stream. If a comment is present + /// then it will be printed first. Comments should not contain '\n'. + void EOL(const std::string &Comment) const; + + /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an + /// unsigned leb128 value. + void EmitULEB128Bytes(unsigned Value) const; + + /// EmitSLEB128Bytes - print an assembler byte data directive to compose a + /// signed leb128 value. + void EmitSLEB128Bytes(int Value) const; + + /// EmitInt8 - Emit a byte directive and value. + /// + void EmitInt8(int Value) const; + + /// EmitInt16 - Emit a short directive and value. + /// + void EmitInt16(int Value) const; + + /// EmitInt32 - Emit a long directive and value. + /// + void EmitInt32(int Value) const; + + /// EmitInt64 - Emit a long long directive and value. + /// + void EmitInt64(uint64_t Value) const; + + /// EmitString - Emit a string with quotes and a null terminator. + /// Special characters are emitted properly. + /// \literal (Eg. '\t') \endliteral + void EmitString(const std::string &String) const; + + //===------------------------------------------------------------------===// + /// EmitAlignment - Emit an alignment directive to the specified power of /// two boundary. For example, if you pass in 3 here, you will get an 8 /// byte alignment. If a global value is specified, and if that global has From jlaskey at apple.com Thu Jan 25 09:12:21 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 25 Jan 2007 09:12:21 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp DwarfWriter.cpp Message-ID: <200701251512.l0PFCLW7020811@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.138 -> 1.139 DwarfWriter.cpp updated: 1.113 -> 1.114 --- Log message: Migrate print routines to asm to be shared by exception handling. --- Diffs of the changes: (+382 -369) AsmPrinter.cpp | 223 ++++++++++++++++++++--- DwarfWriter.cpp | 528 +++++++++++++++++++------------------------------------- 2 files changed, 382 insertions(+), 369 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.138 llvm/lib/CodeGen/AsmPrinter.cpp:1.139 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.138 Mon Jan 22 18:36:17 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Jan 25 09:12:02 2007 @@ -18,6 +18,7 @@ #include "llvm/Module.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Mangler.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Streams.h" @@ -28,6 +29,9 @@ #include using namespace llvm; +static cl::opt +AsmVerbose("asm-verbose", cl::Hidden, cl::desc("Add comments to directives.")); + AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm, const TargetAsmInfo *T) : FunctionNumber(0), O(o), TM(tm), TAI(T) @@ -366,6 +370,196 @@ return LinkName; } +//===----------------------------------------------------------------------===// +/// LEB 128 number encoding. + +/// PrintULEB128 - Print a series of hexidecimal values (separated by commas) +/// representing an unsigned leb128 value. +void AsmPrinter::PrintULEB128(unsigned Value) const { + do { + unsigned Byte = Value & 0x7f; + Value >>= 7; + if (Value) Byte |= 0x80; + O << "0x" << std::hex << Byte << std::dec; + if (Value) O << ", "; + } while (Value); +} + +/// SizeULEB128 - Compute the number of bytes required for an unsigned leb128 +/// value. +unsigned AsmPrinter::SizeULEB128(unsigned Value) { + unsigned Size = 0; + do { + Value >>= 7; + Size += sizeof(int8_t); + } while (Value); + return Size; +} + +/// PrintSLEB128 - Print a series of hexidecimal values (separated by commas) +/// representing a signed leb128 value. +void AsmPrinter::PrintSLEB128(int Value) const { + int Sign = Value >> (8 * sizeof(Value) - 1); + bool IsMore; + + do { + unsigned Byte = Value & 0x7f; + Value >>= 7; + IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0; + if (IsMore) Byte |= 0x80; + O << "0x" << std::hex << Byte << std::dec; + if (IsMore) O << ", "; + } while (IsMore); +} + +/// SizeSLEB128 - Compute the number of bytes required for a signed leb128 +/// value. +unsigned AsmPrinter::SizeSLEB128(int Value) { + unsigned Size = 0; + int Sign = Value >> (8 * sizeof(Value) - 1); + bool IsMore; + + do { + unsigned Byte = Value & 0x7f; + Value >>= 7; + IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0; + Size += sizeof(int8_t); + } while (IsMore); + return Size; +} + +//===--------------------------------------------------------------------===// +// Emission and print routines +// + +/// PrintHex - Print a value as a hexidecimal value. +/// +void AsmPrinter::PrintHex(int Value) const { + O << "0x" << std::hex << Value << std::dec; +} + +/// EOL - Print a newline character to asm stream. If a comment is present +/// then it will be printed first. Comments should not contain '\n'. +void AsmPrinter::EOL(const std::string &Comment) const { + if (AsmVerbose && !Comment.empty()) { + O << "\t" + << TAI->getCommentString() + << " " + << Comment; + } + O << "\n"; +} + +/// EmitULEB128Bytes - Emit an assembler byte data directive to compose an +/// unsigned leb128 value. +void AsmPrinter::EmitULEB128Bytes(unsigned Value) const { + if (TAI->hasLEB128()) { + O << "\t.uleb128\t" + << Value; + } else { + O << TAI->getData8bitsDirective(); + PrintULEB128(Value); + } +} + +/// EmitSLEB128Bytes - print an assembler byte data directive to compose a +/// signed leb128 value. +void AsmPrinter::EmitSLEB128Bytes(int Value) const { + if (TAI->hasLEB128()) { + O << "\t.sleb128\t" + << Value; + } else { + O << TAI->getData8bitsDirective(); + PrintSLEB128(Value); + } +} + +/// EmitInt8 - Emit a byte directive and value. +/// +void AsmPrinter::EmitInt8(int Value) const { + O << TAI->getData8bitsDirective(); + PrintHex(Value & 0xFF); +} + +/// EmitInt16 - Emit a short directive and value. +/// +void AsmPrinter::EmitInt16(int Value) const { + O << TAI->getData16bitsDirective(); + PrintHex(Value & 0xFFFF); +} + +/// EmitInt32 - Emit a long directive and value. +/// +void AsmPrinter::EmitInt32(int Value) const { + O << TAI->getData32bitsDirective(); + PrintHex(Value); +} + +/// EmitInt64 - Emit a long long directive and value. +/// +void AsmPrinter::EmitInt64(uint64_t Value) const { + if (TAI->getData64bitsDirective()) { + O << TAI->getData64bitsDirective(); + PrintHex(Value); + } else { + if (TM.getTargetData()->isBigEndian()) { + EmitInt32(unsigned(Value >> 32)); O << "\n"; + EmitInt32(unsigned(Value)); + } else { + EmitInt32(unsigned(Value)); O << "\n"; + EmitInt32(unsigned(Value >> 32)); + } + } +} + +/// toOctal - Convert the low order bits of X into an octal digit. +/// +static inline char toOctal(int X) { + return (X&7)+'0'; +} + +/// printStringChar - Print a char, escaped if necessary. +/// +static void printStringChar(std::ostream &O, unsigned char C) { + if (C == '"') { + O << "\\\""; + } else if (C == '\\') { + O << "\\\\"; + } else if (isprint(C)) { + O << C; + } else { + switch(C) { + case '\b': O << "\\b"; break; + case '\f': O << "\\f"; break; + case '\n': O << "\\n"; break; + case '\r': O << "\\r"; break; + case '\t': O << "\\t"; break; + default: + O << '\\'; + O << toOctal(C >> 6); + O << toOctal(C >> 3); + O << toOctal(C >> 0); + break; + } + } +} + +/// EmitString - Emit a string with quotes and a null terminator. +/// Special characters are emitted properly. +/// \literal (Eg. '\t') \endliteral +void AsmPrinter::EmitString(const std::string &String) const { + O << TAI->getAsciiDirective() + << "\""; + for (unsigned i = 0, N = String.size(); i < N; ++i) { + unsigned char C = String[i]; + printStringChar(O, C); + } + O << "\\0\""; +} + + +//===----------------------------------------------------------------------===// + // EmitAlignment - Emit an alignment directive to the specified power of two. void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV) const { if (GV && GV->getAlignment()) @@ -486,12 +680,6 @@ } } -/// toOctal - Convert the low order bits of X into an octal digit. -/// -static inline char toOctal(int X) { - return (X&7)+'0'; -} - /// printAsCString - Print the specified array as a C compatible string, only if /// the predicate isString is true. /// @@ -503,28 +691,7 @@ for (unsigned i = 0; i != LastElt; ++i) { unsigned char C = (unsigned char)cast(CVA->getOperand(i))->getZExtValue(); - - if (C == '"') { - O << "\\\""; - } else if (C == '\\') { - O << "\\\\"; - } else if (isprint(C)) { - O << C; - } else { - switch(C) { - case '\b': O << "\\b"; break; - case '\f': O << "\\f"; break; - case '\n': O << "\\n"; break; - case '\r': O << "\\r"; break; - case '\t': O << "\\t"; break; - default: - O << '\\'; - O << toOctal(C >> 6); - O << toOctal(C >> 3); - O << toOctal(C >> 0); - break; - } - } + printStringChar(O, C); } O << "\""; } Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.113 llvm/lib/CodeGen/DwarfWriter.cpp:1.114 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.113 Wed Jan 24 12:45:13 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Thu Jan 25 09:12:02 2007 @@ -57,64 +57,6 @@ class DIEValue; //===----------------------------------------------------------------------===// -/// LEB 128 number encoding. - -/// PrintULEB128 - Print a series of hexidecimal values (separated by commas) -/// representing an unsigned leb128 value. -static void PrintULEB128(std::ostream &O, unsigned Value) { - do { - unsigned Byte = Value & 0x7f; - Value >>= 7; - if (Value) Byte |= 0x80; - O << "0x" << std::hex << Byte << std::dec; - if (Value) O << ", "; - } while (Value); -} - -/// SizeULEB128 - Compute the number of bytes required for an unsigned leb128 -/// value. -static unsigned SizeULEB128(unsigned Value) { - unsigned Size = 0; - do { - Value >>= 7; - Size += sizeof(int8_t); - } while (Value); - return Size; -} - -/// PrintSLEB128 - Print a series of hexidecimal values (separated by commas) -/// representing a signed leb128 value. -static void PrintSLEB128(std::ostream &O, int Value) { - int Sign = Value >> (8 * sizeof(Value) - 1); - bool IsMore; - - do { - unsigned Byte = Value & 0x7f; - Value >>= 7; - IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0; - if (IsMore) Byte |= 0x80; - O << "0x" << std::hex << Byte << std::dec; - if (IsMore) O << ", "; - } while (IsMore); -} - -/// SizeSLEB128 - Compute the number of bytes required for a signed leb128 -/// value. -static unsigned SizeSLEB128(int Value) { - unsigned Size = 0; - int Sign = Value >> (8 * sizeof(Value) - 1); - bool IsMore; - - do { - unsigned Byte = Value & 0x7f; - Value >>= 7; - IsMore = Value != Sign || ((Byte ^ Sign) & 0x40) != 0; - Size += sizeof(int8_t); - } while (IsMore); - return Size; -} - -//===----------------------------------------------------------------------===// /// DWLabel - Labels are used to track locations in the assembler file. /// Labels appear in the form debug_, where the tag is a /// category of label (Ex. location) and number is a value unique in that @@ -429,23 +371,7 @@ /// SizeOf - Determine size of integer value in bytes. /// - virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const { - switch (Form) { - case DW_FORM_flag: // Fall thru - case DW_FORM_ref1: // Fall thru - case DW_FORM_data1: return sizeof(int8_t); - case DW_FORM_ref2: // Fall thru - case DW_FORM_data2: return sizeof(int16_t); - case DW_FORM_ref4: // Fall thru - case DW_FORM_data4: return sizeof(int32_t); - case DW_FORM_ref8: // Fall thru - case DW_FORM_data8: return sizeof(int64_t); - case DW_FORM_udata: return SizeULEB128(Integer); - case DW_FORM_sdata: return SizeSLEB128(Integer); - default: assert(0 && "DIE Value form not supported yet"); break; - } - return 0; - } + virtual unsigned SizeOf(const Dwarf &DW, unsigned Form) const; /// Profile - Used to gather unique data for the value folding set. /// @@ -924,122 +850,9 @@ public: //===--------------------------------------------------------------------===// - // Emission and print routines + // Accessors. // - - /// PrintHex - Print a value as a hexidecimal value. - /// - void PrintHex(int Value) const { - O << "0x" << std::hex << Value << std::dec; - } - - /// EOL - Print a newline character to asm stream. If a comment is present - /// then it will be printed first. Comments should not contain '\n'. - void EOL(const std::string &Comment) const { - if (DwarfVerbose && !Comment.empty()) { - O << "\t" - << TAI->getCommentString() - << " " - << Comment; - } - O << "\n"; - } - - /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an - /// unsigned leb128 value. - void EmitULEB128Bytes(unsigned Value) const { - if (TAI->hasLEB128()) { - O << "\t.uleb128\t" - << Value; - } else { - O << TAI->getData8bitsDirective(); - PrintULEB128(O, Value); - } - } - - /// EmitSLEB128Bytes - print an assembler byte data directive to compose a - /// signed leb128 value. - void EmitSLEB128Bytes(int Value) const { - if (TAI->hasLEB128()) { - O << "\t.sleb128\t" - << Value; - } else { - O << TAI->getData8bitsDirective(); - PrintSLEB128(O, Value); - } - } - - /// EmitInt8 - Emit a byte directive and value. - /// - void EmitInt8(int Value) const { - O << TAI->getData8bitsDirective(); - PrintHex(Value & 0xFF); - } - - /// EmitInt16 - Emit a short directive and value. - /// - void EmitInt16(int Value) const { - O << TAI->getData16bitsDirective(); - PrintHex(Value & 0xFFFF); - } - - /// EmitInt32 - Emit a long directive and value. - /// - void EmitInt32(int Value) const { - O << TAI->getData32bitsDirective(); - PrintHex(Value); - } - - /// EmitInt64 - Emit a long long directive and value. - /// - void EmitInt64(uint64_t Value) const { - if (TAI->getData64bitsDirective()) { - O << TAI->getData64bitsDirective(); - PrintHex(Value); - } else { - if (TD->isBigEndian()) { - EmitInt32(unsigned(Value >> 32)); O << "\n"; - EmitInt32(unsigned(Value)); - } else { - EmitInt32(unsigned(Value)); O << "\n"; - EmitInt32(unsigned(Value >> 32)); - } - } - } - - /// EmitString - Emit a string with quotes and a null terminator. - /// Special characters are emitted properly. - /// \literal (Eg. '\t') \endliteral - void EmitString(const std::string &String) const { - O << TAI->getAsciiDirective() - << "\""; - for (unsigned i = 0, N = String.size(); i < N; ++i) { - unsigned char C = String[i]; - - if (!isascii(C) || iscntrl(C)) { - switch(C) { - case '\b': O << "\\b"; break; - case '\f': O << "\\f"; break; - case '\n': O << "\\n"; break; - case '\r': O << "\\r"; break; - case '\t': O << "\\t"; break; - default: - O << '\\'; - O << char('0' + ((C >> 6) & 7)); - O << char('0' + ((C >> 3) & 7)); - O << char('0' + ((C >> 0) & 7)); - break; - } - } else if (C == '\"') { - O << "\\\""; - } else if (C == '\'') { - O << "\\\'"; - } else { - O << C; - } - } - O << "\\0\""; - } + AsmPrinter *getAsm() const { return Asm; } /// PrintLabelName - Print label name in form used by Dwarf writer. /// @@ -2005,12 +1818,12 @@ O << "\n"; // Emit the code (index) for the abbreviation. - EmitULEB128Bytes(AbbrevNumber); - EOL(std::string("Abbrev [" + - utostr(AbbrevNumber) + - "] 0x" + utohexstr(Die->getOffset()) + - ":0x" + utohexstr(Die->getSize()) + " " + - TagString(Abbrev->getTag()))); + Asm->EmitULEB128Bytes(AbbrevNumber); + Asm->EOL(std::string("Abbrev [" + + utostr(AbbrevNumber) + + "] 0x" + utohexstr(Die->getOffset()) + + ":0x" + utohexstr(Die->getSize()) + " " + + TagString(Abbrev->getTag()))); const std::vector &Values = Die->getValues(); const std::vector &AbbrevData = Abbrev->getData(); @@ -2023,7 +1836,7 @@ switch (Attr) { case DW_AT_sibling: { - EmitInt32(Die->SiblingOffset()); + Asm->EmitInt32(Die->SiblingOffset()); break; } default: { @@ -2033,7 +1846,7 @@ } } - EOL(AttributeString(Attr)); + Asm->EOL(AttributeString(Attr)); } // Emit the DIE children if any. @@ -2044,7 +1857,7 @@ EmitDIE(Children[j]); } - EmitInt8(0); EOL("End Of Children Mark"); + Asm->EmitInt8(0); Asm->EOL("End Of Children Mark"); } } @@ -2068,7 +1881,7 @@ Die->setOffset(Offset); // Start the size with the size of abbreviation code. - Offset += SizeULEB128(AbbrevNumber); + Offset += Asm->SizeULEB128(AbbrevNumber); const std::vector &Values = Die->getValues(); const std::vector &AbbrevData = Abbrev->getData(); @@ -2134,10 +1947,10 @@ // Advance row if new location. if (BaseLabel && LabelID && BaseLabelID != LabelID) { - EmitInt8(DW_CFA_advance_loc4); - EOL("DW_CFA_advance_loc4"); + Asm->EmitInt8(DW_CFA_advance_loc4); + Asm->EOL("DW_CFA_advance_loc4"); EmitDifference("loc", LabelID, BaseLabel, BaseLabelID, true); - EOL(""); + Asm->EOL(""); BaseLabelID = LabelID; BaseLabel = "loc"; @@ -2147,29 +1960,29 @@ if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) { if (!Src.isRegister()) { if (Src.getRegister() == MachineLocation::VirtualFP) { - EmitInt8(DW_CFA_def_cfa_offset); - EOL("DW_CFA_def_cfa_offset"); + Asm->EmitInt8(DW_CFA_def_cfa_offset); + Asm->EOL("DW_CFA_def_cfa_offset"); } else { - EmitInt8(DW_CFA_def_cfa); - EOL("DW_CFA_def_cfa"); - EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister())); - EOL("Register"); + Asm->EmitInt8(DW_CFA_def_cfa); + Asm->EOL("DW_CFA_def_cfa"); + Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister())); + Asm->EOL("Register"); } int Offset = Src.getOffset() / stackGrowth; - EmitULEB128Bytes(Offset); - EOL("Offset"); + Asm->EmitULEB128Bytes(Offset); + Asm->EOL("Offset"); } else { assert(0 && "Machine move no supported yet."); } } else if (Src.isRegister() && Src.getRegister() == MachineLocation::VirtualFP) { if (Dst.isRegister()) { - EmitInt8(DW_CFA_def_cfa_register); - EOL("DW_CFA_def_cfa_register"); - EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister())); - EOL("Register"); + Asm->EmitInt8(DW_CFA_def_cfa_register); + Asm->EOL("DW_CFA_def_cfa_register"); + Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getRegister())); + Asm->EOL("Register"); } else { assert(0 && "Machine move no supported yet."); } @@ -2178,24 +1991,24 @@ int Offset = Dst.getOffset() / stackGrowth; if (Offset < 0) { - EmitInt8(DW_CFA_offset_extended_sf); - EOL("DW_CFA_offset_extended_sf"); - EmitULEB128Bytes(Reg); - EOL("Reg"); - EmitSLEB128Bytes(Offset); - EOL("Offset"); + Asm->EmitInt8(DW_CFA_offset_extended_sf); + Asm->EOL("DW_CFA_offset_extended_sf"); + Asm->EmitULEB128Bytes(Reg); + Asm->EOL("Reg"); + Asm->EmitSLEB128Bytes(Offset); + Asm->EOL("Offset"); } else if (Reg < 64) { - EmitInt8(DW_CFA_offset + Reg); - EOL("DW_CFA_offset + Reg"); - EmitULEB128Bytes(Offset); - EOL("Offset"); + Asm->EmitInt8(DW_CFA_offset + Reg); + Asm->EOL("DW_CFA_offset + Reg"); + Asm->EmitULEB128Bytes(Offset); + Asm->EOL("Offset"); } else { - EmitInt8(DW_CFA_offset_extended); - EOL("DW_CFA_offset_extended"); - EmitULEB128Bytes(Reg); - EOL("Reg"); - EmitULEB128Bytes(Offset); - EOL("Offset"); + Asm->EmitInt8(DW_CFA_offset_extended); + Asm->EOL("DW_CFA_offset_extended"); + Asm->EmitULEB128Bytes(Reg); + Asm->EOL("Reg"); + Asm->EmitULEB128Bytes(Offset); + Asm->EOL("Offset"); } } } @@ -2218,17 +2031,18 @@ sizeof(int8_t) + // Pointer Size (in bytes) sizeof(int32_t); // FIXME - extra pad for gdb bug. - EmitInt32(ContentSize); EOL("Length of Compilation Unit Info"); - EmitInt16(DWARF_VERSION); EOL("DWARF version number"); + Asm->EmitInt32(ContentSize); Asm->EOL("Length of Compilation Unit Info"); + Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF version number"); EmitDifference("abbrev_begin", 0, "section_abbrev", 0, true); - EOL("Offset Into Abbrev. Section"); - EmitInt8(TAI->getAddressSize()); EOL("Address Size (in bytes)"); + Asm->EOL("Offset Into Abbrev. Section"); + Asm->EmitInt8(TAI->getAddressSize()); Asm->EOL("Address Size (in bytes)"); EmitDIE(Die); - EmitInt8(0); EOL("Extra Pad For GDB"); // FIXME - extra pad for gdb bug. - EmitInt8(0); EOL("Extra Pad For GDB"); // FIXME - extra pad for gdb bug. - EmitInt8(0); EOL("Extra Pad For GDB"); // FIXME - extra pad for gdb bug. - EmitInt8(0); EOL("Extra Pad For GDB"); // FIXME - extra pad for gdb bug. + // FIXME - extra padding for gdb bug. + Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); + Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); + Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); + Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); EmitLabel("info_end", Unit->getID()); O << "\n"; @@ -2250,7 +2064,8 @@ const DIEAbbrev *Abbrev = Abbreviations[i]; // Emit the abbrevations code (base 1 index.) - EmitULEB128Bytes(Abbrev->getNumber()); EOL("Abbreviation Code"); + Asm->EmitULEB128Bytes(Abbrev->getNumber()); + Asm->EOL("Abbreviation Code"); // Emit the abbreviations data. Abbrev->Emit(*this); @@ -2278,35 +2093,35 @@ // Construct the section header. EmitDifference("line_end", 0, "line_begin", 0, true); - EOL("Length of Source Line Info"); + Asm->EOL("Length of Source Line Info"); EmitLabel("line_begin", 0); - EmitInt16(DWARF_VERSION); EOL("DWARF version number"); + Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF version number"); EmitDifference("line_prolog_end", 0, "line_prolog_begin", 0, true); - EOL("Prolog Length"); + Asm->EOL("Prolog Length"); EmitLabel("line_prolog_begin", 0); - EmitInt8(1); EOL("Minimum Instruction Length"); + Asm->EmitInt8(1); Asm->EOL("Minimum Instruction Length"); - EmitInt8(1); EOL("Default is_stmt_start flag"); + Asm->EmitInt8(1); Asm->EOL("Default is_stmt_start flag"); - EmitInt8(MinLineDelta); EOL("Line Base Value (Special Opcodes)"); + Asm->EmitInt8(MinLineDelta); Asm->EOL("Line Base Value (Special Opcodes)"); - EmitInt8(MaxLineDelta); EOL("Line Range Value (Special Opcodes)"); + Asm->EmitInt8(MaxLineDelta); Asm->EOL("Line Range Value (Special Opcodes)"); - EmitInt8(-MinLineDelta); EOL("Special Opcode Base"); + Asm->EmitInt8(-MinLineDelta); Asm->EOL("Special Opcode Base"); // Line number standard opcode encodings argument count - EmitInt8(0); EOL("DW_LNS_copy arg count"); - EmitInt8(1); EOL("DW_LNS_advance_pc arg count"); - EmitInt8(1); EOL("DW_LNS_advance_line arg count"); - EmitInt8(1); EOL("DW_LNS_set_file arg count"); - EmitInt8(1); EOL("DW_LNS_set_column arg count"); - EmitInt8(0); EOL("DW_LNS_negate_stmt arg count"); - EmitInt8(0); EOL("DW_LNS_set_basic_block arg count"); - EmitInt8(0); EOL("DW_LNS_const_add_pc arg count"); - EmitInt8(1); EOL("DW_LNS_fixed_advance_pc arg count"); + Asm->EmitInt8(0); Asm->EOL("DW_LNS_copy arg count"); + Asm->EmitInt8(1); Asm->EOL("DW_LNS_advance_pc arg count"); + Asm->EmitInt8(1); Asm->EOL("DW_LNS_advance_line arg count"); + Asm->EmitInt8(1); Asm->EOL("DW_LNS_set_file arg count"); + Asm->EmitInt8(1); Asm->EOL("DW_LNS_set_column arg count"); + Asm->EmitInt8(0); Asm->EOL("DW_LNS_negate_stmt arg count"); + Asm->EmitInt8(0); Asm->EOL("DW_LNS_set_basic_block arg count"); + Asm->EmitInt8(0); Asm->EOL("DW_LNS_const_add_pc arg count"); + Asm->EmitInt8(1); Asm->EOL("DW_LNS_fixed_advance_pc arg count"); const UniqueVector &Directories = DebugInfo->getDirectories(); const UniqueVector @@ -2315,20 +2130,24 @@ // Emit directories. for (unsigned DirectoryID = 1, NDID = Directories.size(); DirectoryID <= NDID; ++DirectoryID) { - EmitString(Directories[DirectoryID]); EOL("Directory"); + Asm->EmitString(Directories[DirectoryID]); Asm->EOL("Directory"); } - EmitInt8(0); EOL("End of directories"); + Asm->EmitInt8(0); Asm->EOL("End of directories"); // Emit files. for (unsigned SourceID = 1, NSID = SourceFiles.size(); SourceID <= NSID; ++SourceID) { const SourceFileInfo &SourceFile = SourceFiles[SourceID]; - EmitString(SourceFile.getName()); EOL("Source"); - EmitULEB128Bytes(SourceFile.getDirectoryID()); EOL("Directory #"); - EmitULEB128Bytes(0); EOL("Mod date"); - EmitULEB128Bytes(0); EOL("File size"); + Asm->EmitString(SourceFile.getName()); + Asm->EOL("Source"); + Asm->EmitULEB128Bytes(SourceFile.getDirectoryID()); + Asm->EOL("Directory #"); + Asm->EmitULEB128Bytes(0); + Asm->EOL("Mod date"); + Asm->EmitULEB128Bytes(0); + Asm->EOL("File size"); } - EmitInt8(0); EOL("End of files"); + Asm->EmitInt8(0); Asm->EOL("End of files"); EmitLabel("line_prolog_end", 0); @@ -2366,16 +2185,16 @@ } // Define the line address. - EmitInt8(0); EOL("Extended Op"); - EmitInt8(TAI->getAddressSize() + 1); EOL("Op size"); - EmitInt8(DW_LNE_set_address); EOL("DW_LNE_set_address"); - EmitReference("loc", LabelID); EOL("Location label"); + Asm->EmitInt8(0); Asm->EOL("Extended Op"); + Asm->EmitInt8(TAI->getAddressSize() + 1); Asm->EOL("Op size"); + Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address"); + EmitReference("loc", LabelID); Asm->EOL("Location label"); // If change of source, then switch to the new source. if (Source != LineInfo.getSourceID()) { Source = LineInfo.getSourceID(); - EmitInt8(DW_LNS_set_file); EOL("DW_LNS_set_file"); - EmitULEB128Bytes(Source); EOL("New Source"); + Asm->EmitInt8(DW_LNS_set_file); Asm->EOL("DW_LNS_set_file"); + Asm->EmitULEB128Bytes(Source); Asm->EOL("New Source"); } // If change of line. @@ -2390,29 +2209,29 @@ // If delta is small enough and in range... if (Delta >= 0 && Delta < (MaxLineDelta - 1)) { // ... then use fast opcode. - EmitInt8(Delta - MinLineDelta); EOL("Line Delta"); + Asm->EmitInt8(Delta - MinLineDelta); Asm->EOL("Line Delta"); } else { // ... otherwise use long hand. - EmitInt8(DW_LNS_advance_line); EOL("DW_LNS_advance_line"); - EmitSLEB128Bytes(Offset); EOL("Line Offset"); - EmitInt8(DW_LNS_copy); EOL("DW_LNS_copy"); + Asm->EmitInt8(DW_LNS_advance_line); Asm->EOL("DW_LNS_advance_line"); + Asm->EmitSLEB128Bytes(Offset); Asm->EOL("Line Offset"); + Asm->EmitInt8(DW_LNS_copy); Asm->EOL("DW_LNS_copy"); } } else { // Copy the previous row (different address or source) - EmitInt8(DW_LNS_copy); EOL("DW_LNS_copy"); + Asm->EmitInt8(DW_LNS_copy); Asm->EOL("DW_LNS_copy"); } } // Define last address of section. - EmitInt8(0); EOL("Extended Op"); - EmitInt8(TAI->getAddressSize() + 1); EOL("Op size"); - EmitInt8(DW_LNE_set_address); EOL("DW_LNE_set_address"); - EmitReference("section_end", j + 1); EOL("Section end label"); + Asm->EmitInt8(0); Asm->EOL("Extended Op"); + Asm->EmitInt8(TAI->getAddressSize() + 1); Asm->EOL("Op size"); + Asm->EmitInt8(DW_LNE_set_address); Asm->EOL("DW_LNE_set_address"); + EmitReference("section_end", j + 1); Asm->EOL("Section end label"); // Mark end of matrix. - EmitInt8(0); EOL("DW_LNE_end_sequence"); - EmitULEB128Bytes(1); O << "\n"; - EmitInt8(1); O << "\n"; + Asm->EmitInt8(0); Asm->EOL("DW_LNE_end_sequence"); + Asm->EmitULEB128Bytes(1); O << "\n"; + Asm->EmitInt8(1); O << "\n"; } EmitLabel("line_end", 0); @@ -2437,15 +2256,21 @@ EmitLabel("frame_common", 0); EmitDifference("frame_common_end", 0, "frame_common_begin", 0, true); - EOL("Length of Common Information Entry"); + Asm->EOL("Length of Common Information Entry"); EmitLabel("frame_common_begin", 0); - EmitInt32((int)DW_CIE_ID); EOL("CIE Identifier Tag"); - EmitInt8(DW_CIE_VERSION); EOL("CIE Version"); - EmitString(""); EOL("CIE Augmentation"); - EmitULEB128Bytes(1); EOL("CIE Code Alignment Factor"); - EmitSLEB128Bytes(stackGrowth); EOL("CIE Data Alignment Factor"); - EmitInt8(RI->getDwarfRegNum(RI->getRARegister())); EOL("CIE RA Column"); + Asm->EmitInt32((int)DW_CIE_ID); + Asm->EOL("CIE Identifier Tag"); + Asm->EmitInt8(DW_CIE_VERSION); + Asm->EOL("CIE Version"); + Asm->EmitString(""); + Asm->EOL("CIE Augmentation"); + Asm->EmitULEB128Bytes(1); + Asm->EOL("CIE Code Alignment Factor"); + Asm->EmitSLEB128Bytes(stackGrowth); + Asm->EOL("CIE Data Alignment Factor"); + Asm->EmitInt8(RI->getDwarfRegNum(RI->getRARegister())); + Asm->EOL("CIE RA Column"); std::vector Moves; RI->getInitialFrameState(Moves); @@ -2468,17 +2293,18 @@ EmitDifference("frame_end", SubprogramCount, "frame_begin", SubprogramCount, true); - EOL("Length of Frame Information Entry"); + Asm->EOL("Length of Frame Information Entry"); EmitLabel("frame_begin", SubprogramCount); EmitDifference("frame_common", 0, "section_frame", 0, true); - EOL("FDE CIE offset"); + Asm->EOL("FDE CIE offset"); - EmitReference("func_begin", SubprogramCount); EOL("FDE initial location"); + EmitReference("func_begin", SubprogramCount); + Asm->EOL("FDE initial location"); EmitDifference("func_end", SubprogramCount, "func_begin", SubprogramCount); - EOL("FDE address range"); + Asm->EOL("FDE address range"); std::vector &Moves = DebugInfo->getFrameMoves(); @@ -2500,17 +2326,17 @@ EmitDifference("pubnames_end", Unit->getID(), "pubnames_begin", Unit->getID(), true); - EOL("Length of Public Names Info"); + Asm->EOL("Length of Public Names Info"); EmitLabel("pubnames_begin", Unit->getID()); - EmitInt16(DWARF_VERSION); EOL("DWARF Version"); + Asm->EmitInt16(DWARF_VERSION); Asm->EOL("DWARF Version"); EmitDifference("info_begin", Unit->getID(), "section_info", 0, true); - EOL("Offset of Compilation Unit Info"); + Asm->EOL("Offset of Compilation Unit Info"); EmitDifference("info_end", Unit->getID(), "info_begin", Unit->getID(),true); - EOL("Compilation Unit Length"); + Asm->EOL("Compilation Unit Length"); std::map &Globals = Unit->getGlobals(); @@ -2520,11 +2346,11 @@ const std::string &Name = GI->first; DIE * Entity = GI->second; - EmitInt32(Entity->getOffset()); EOL("DIE offset"); - EmitString(Name); EOL("External Name"); + Asm->EmitInt32(Entity->getOffset()); Asm->EOL("DIE offset"); + Asm->EmitString(Name); Asm->EOL("External Name"); } - EmitInt32(0); EOL("End Mark"); + Asm->EmitInt32(0); Asm->EOL("End Mark"); EmitLabel("pubnames_end", Unit->getID()); O << "\n"; @@ -2545,7 +2371,7 @@ EmitLabel("string", StringID); // Emit the string itself. const std::string &String = StringPool[StringID]; - EmitString(String); O << "\n"; + Asm->EmitString(String); O << "\n"; } O << "\n"; @@ -2572,26 +2398,26 @@ CompileUnit *Unit = GetBaseCompileUnit(); // Don't include size of length - EmitInt32(0x1c); EOL("Length of Address Ranges Info"); + Asm->EmitInt32(0x1c); Asm->EOL("Length of Address Ranges Info"); - EmitInt16(DWARF_VERSION); EOL("Dwarf Version"); + Asm->EmitInt16(DWARF_VERSION); Asm->EOL("Dwarf Version"); EmitReference("info_begin", Unit->getID()); - EOL("Offset of Compilation Unit Info"); + Asm->EOL("Offset of Compilation Unit Info"); - EmitInt8(TAI->getAddressSize()); EOL("Size of Address"); + Asm->EmitInt8(TAI->getAddressSize()); Asm->EOL("Size of Address"); - EmitInt8(0); EOL("Size of Segment Descriptor"); + Asm->EmitInt8(0); Asm->EOL("Size of Segment Descriptor"); - EmitInt16(0); EOL("Pad (1)"); - EmitInt16(0); EOL("Pad (2)"); + Asm->EmitInt16(0); Asm->EOL("Pad (1)"); + Asm->EmitInt16(0); Asm->EOL("Pad (2)"); // Range 1 - EmitReference("text_begin", 0); EOL("Address"); - EmitDifference("text_end", 0, "text_begin", 0, true); EOL("Length"); + EmitReference("text_begin", 0); Asm->EOL("Address"); + EmitDifference("text_end", 0, "text_begin", 0, true); Asm->EOL("Length"); - EmitInt32(0); EOL("EOM (1)"); - EmitInt32(0); EOL("EOM (2)"); + Asm->EmitInt32(0); Asm->EOL("EOM (1)"); + Asm->EmitInt32(0); Asm->EOL("EOM (2)"); O << "\n"; #endif @@ -2724,14 +2550,14 @@ this->M = M; if (!ShouldEmitDwarf()) return; - EOL("Dwarf Begin Module"); + Asm->EOL("Dwarf Begin Module"); } /// EndModule - Emit all Dwarf sections that should come after the content. /// void EndModule() { if (!ShouldEmitDwarf()) return; - EOL("Dwarf End Module"); + Asm->EOL("Dwarf End Module"); // Standard sections final addresses. Asm->SwitchToTextSection(TAI->getTextSection()); @@ -2782,7 +2608,7 @@ this->MF = MF; if (!ShouldEmitDwarf()) return; - EOL("Dwarf Begin Function"); + Asm->EOL("Dwarf Begin Function"); // Begin accumulating function debug information. DebugInfo->BeginFunction(MF); @@ -2795,7 +2621,7 @@ /// void EndFunction() { if (!ShouldEmitDwarf()) return; - EOL("Dwarf End Function"); + Asm->EOL("Dwarf End Function"); // Define end label for subprogram. EmitLabel("func_end", SubprogramCount); @@ -2835,29 +2661,29 @@ /// void DIEAbbrev::Emit(const Dwarf &DW) const { // Emit its Dwarf tag type. - DW.EmitULEB128Bytes(Tag); - DW.EOL(TagString(Tag)); + DW.getAsm()->EmitULEB128Bytes(Tag); + DW.getAsm()->EOL(TagString(Tag)); // Emit whether it has children DIEs. - DW.EmitULEB128Bytes(ChildrenFlag); - DW.EOL(ChildrenString(ChildrenFlag)); + DW.getAsm()->EmitULEB128Bytes(ChildrenFlag); + DW.getAsm()->EOL(ChildrenString(ChildrenFlag)); // For each attribute description. for (unsigned i = 0, N = Data.size(); i < N; ++i) { const DIEAbbrevData &AttrData = Data[i]; // Emit attribute type. - DW.EmitULEB128Bytes(AttrData.getAttribute()); - DW.EOL(AttributeString(AttrData.getAttribute())); + DW.getAsm()->EmitULEB128Bytes(AttrData.getAttribute()); + DW.getAsm()->EOL(AttributeString(AttrData.getAttribute())); // Emit form type. - DW.EmitULEB128Bytes(AttrData.getForm()); - DW.EOL(FormEncodingString(AttrData.getForm())); + DW.getAsm()->EmitULEB128Bytes(AttrData.getForm()); + DW.getAsm()->EOL(FormEncodingString(AttrData.getForm())); } // Mark end of abbreviation. - DW.EmitULEB128Bytes(0); DW.EOL("EOM(1)"); - DW.EmitULEB128Bytes(0); DW.EOL("EOM(2)"); + DW.getAsm()->EmitULEB128Bytes(0); DW.getAsm()->EOL("EOM(1)"); + DW.getAsm()->EmitULEB128Bytes(0); DW.getAsm()->EOL("EOM(2)"); } #ifndef NDEBUG @@ -2897,17 +2723,37 @@ switch (Form) { case DW_FORM_flag: // Fall thru case DW_FORM_ref1: // Fall thru - case DW_FORM_data1: DW.EmitInt8(Integer); break; + case DW_FORM_data1: DW.getAsm()->EmitInt8(Integer); break; case DW_FORM_ref2: // Fall thru - case DW_FORM_data2: DW.EmitInt16(Integer); break; + case DW_FORM_data2: DW.getAsm()->EmitInt16(Integer); break; case DW_FORM_ref4: // Fall thru - case DW_FORM_data4: DW.EmitInt32(Integer); break; + case DW_FORM_data4: DW.getAsm()->EmitInt32(Integer); break; case DW_FORM_ref8: // Fall thru - case DW_FORM_data8: DW.EmitInt64(Integer); break; - case DW_FORM_udata: DW.EmitULEB128Bytes(Integer); break; - case DW_FORM_sdata: DW.EmitSLEB128Bytes(Integer); break; + case DW_FORM_data8: DW.getAsm()->EmitInt64(Integer); break; + case DW_FORM_udata: DW.getAsm()->EmitULEB128Bytes(Integer); break; + case DW_FORM_sdata: DW.getAsm()->EmitSLEB128Bytes(Integer); break; + default: assert(0 && "DIE Value form not supported yet"); break; + } +} + +/// SizeOf - Determine size of integer value in bytes. +/// +unsigned DIEInteger::SizeOf(const Dwarf &DW, unsigned Form) const { + switch (Form) { + case DW_FORM_flag: // Fall thru + case DW_FORM_ref1: // Fall thru + case DW_FORM_data1: return sizeof(int8_t); + case DW_FORM_ref2: // Fall thru + case DW_FORM_data2: return sizeof(int16_t); + case DW_FORM_ref4: // Fall thru + case DW_FORM_data4: return sizeof(int32_t); + case DW_FORM_ref8: // Fall thru + case DW_FORM_data8: return sizeof(int64_t); + case DW_FORM_udata: return DW.getAsm()->SizeULEB128(Integer); + case DW_FORM_sdata: return DW.getAsm()->SizeSLEB128(Integer); default: assert(0 && "DIE Value form not supported yet"); break; } + return 0; } //===----------------------------------------------------------------------===// @@ -2915,7 +2761,7 @@ /// EmitValue - Emit string value. /// void DIEString::EmitValue(const Dwarf &DW, unsigned Form) const { - DW.EmitString(String); + DW.getAsm()->EmitString(String); } //===----------------------------------------------------------------------===// @@ -2967,7 +2813,7 @@ /// EmitValue - Emit debug information entry offset. /// void DIEntry::EmitValue(const Dwarf &DW, unsigned Form) const { - DW.EmitInt32(Entry->getOffset()); + DW.getAsm()->EmitInt32(Entry->getOffset()); } //===----------------------------------------------------------------------===// @@ -2989,17 +2835,17 @@ /// void DIEBlock::EmitValue(const Dwarf &DW, unsigned Form) const { switch (Form) { - case DW_FORM_block1: DW.EmitInt8(Size); break; - case DW_FORM_block2: DW.EmitInt16(Size); break; - case DW_FORM_block4: DW.EmitInt32(Size); break; - case DW_FORM_block: DW.EmitULEB128Bytes(Size); break; - default: assert(0 && "Improper form for block"); break; + case DW_FORM_block1: DW.getAsm()->EmitInt8(Size); break; + case DW_FORM_block2: DW.getAsm()->EmitInt16(Size); break; + case DW_FORM_block4: DW.getAsm()->EmitInt32(Size); break; + case DW_FORM_block: DW.getAsm()->EmitULEB128Bytes(Size); break; + default: assert(0 && "Improper form for block"); break; } const std::vector &AbbrevData = Abbrev.getData(); for (unsigned i = 0, N = Values.size(); i < N; ++i) { - DW.EOL(""); + DW.getAsm()->EOL(""); Values[i]->EmitValue(DW, AbbrevData[i].getForm()); } } @@ -3011,7 +2857,7 @@ case DW_FORM_block1: return Size + sizeof(int8_t); case DW_FORM_block2: return Size + sizeof(int16_t); case DW_FORM_block4: return Size + sizeof(int32_t); - case DW_FORM_block: return Size + SizeULEB128(Size); + case DW_FORM_block: return Size + DW.getAsm()->SizeULEB128(Size); default: assert(0 && "Improper form for block"); break; } return 0; From jlaskey at apple.com Thu Jan 25 09:46:14 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 25 Jan 2007 09:46:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp Message-ID: <200701251546.l0PFkEqg021767@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: DwarfWriter.cpp updated: 1.114 -> 1.115 --- Log message: 1. Remove dwarf-verbose option (now asm-verbose.) 2. Clean up end of lines. --- Diffs of the changes: (+24 -36) DwarfWriter.cpp | 60 ++++++++++++++++++++++---------------------------------- 1 files changed, 24 insertions(+), 36 deletions(-) Index: llvm/lib/CodeGen/DwarfWriter.cpp diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.114 llvm/lib/CodeGen/DwarfWriter.cpp:1.115 --- llvm/lib/CodeGen/DwarfWriter.cpp:1.114 Thu Jan 25 09:12:02 2007 +++ llvm/lib/CodeGen/DwarfWriter.cpp Thu Jan 25 09:45:58 2007 @@ -36,10 +36,6 @@ using namespace llvm; using namespace llvm::dwarf; -static cl::opt -DwarfVerbose("dwarf-verbose", cl::Hidden, - cl::desc("Add comments to Dwarf directives.")); - namespace llvm { //===----------------------------------------------------------------------===// @@ -1815,7 +1811,7 @@ unsigned AbbrevNumber = Die->getAbbrevNumber(); const DIEAbbrev *Abbrev = Abbreviations[AbbrevNumber - 1]; - O << "\n"; + Asm->EOL(""); // Emit the code (index) for the abbreviation. Asm->EmitULEB128Bytes(AbbrevNumber); @@ -2045,7 +2041,7 @@ Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB"); EmitLabel("info_end", Unit->getID()); - O << "\n"; + Asm->EOL(""); } /// EmitAbbreviations - Emit the abbreviation section. @@ -2070,12 +2066,12 @@ // Emit the abbreviations data. Abbrev->Emit(*this); - O << "\n"; + Asm->EOL(""); } EmitLabel("abbrev_end", 0); - O << "\n"; + Asm->EOL(""); } } @@ -2156,12 +2152,7 @@ // Isolate current sections line info. const std::vector &LineInfos = SectionSourceLines[j]; - if (DwarfVerbose) { - O << "\t" - << TAI->getCommentString() << " " - << "Section " - << SectionMap[j + 1].c_str() << "\n"; - } + Asm->EOL(std::string("Section ") + SectionMap[j + 1]); // Dwarf assumes we start with first line of first source file. unsigned Source = 1; @@ -2173,16 +2164,13 @@ unsigned LabelID = DebugInfo->MappedLabel(LineInfo.getLabelID()); if (!LabelID) continue; - if (DwarfVerbose) { - unsigned SourceID = LineInfo.getSourceID(); - const SourceFileInfo &SourceFile = SourceFiles[SourceID]; - unsigned DirectoryID = SourceFile.getDirectoryID(); - O << "\t" - << TAI->getCommentString() << " " - << Directories[DirectoryID] - << SourceFile.getName() << ":" - << LineInfo.getLine() << "\n"; - } + unsigned SourceID = LineInfo.getSourceID(); + const SourceFileInfo &SourceFile = SourceFiles[SourceID]; + unsigned DirectoryID = SourceFile.getDirectoryID(); + Asm->EOL(Directories[DirectoryID] + + SourceFile.getName() + + ":" + + utostr_32(LineInfo.getLine())); // Define the line address. Asm->EmitInt8(0); Asm->EOL("Extended Op"); @@ -2230,13 +2218,13 @@ // Mark end of matrix. Asm->EmitInt8(0); Asm->EOL("DW_LNE_end_sequence"); - Asm->EmitULEB128Bytes(1); O << "\n"; - Asm->EmitInt8(1); O << "\n"; + Asm->EmitULEB128Bytes(1); Asm->EOL(""); + Asm->EmitInt8(1); Asm->EOL(""); } EmitLabel("line_end", 0); - O << "\n"; + Asm->EOL(""); } /// EmitInitialDebugFrame - Emit common frame info into a debug frame section. @@ -2279,7 +2267,7 @@ Asm->EmitAlignment(2); EmitLabel("frame_common_end", 0); - O << "\n"; + Asm->EOL(""); } /// EmitFunctionDebugFrame - Emit per function frame info into a debug frame @@ -2313,7 +2301,7 @@ Asm->EmitAlignment(2); EmitLabel("frame_end", SubprogramCount); - O << "\n"; + Asm->EOL(""); } /// EmitDebugPubNames - Emit visible names into a debug pubnames section. @@ -2353,7 +2341,7 @@ Asm->EmitInt32(0); Asm->EOL("End Mark"); EmitLabel("pubnames_end", Unit->getID()); - O << "\n"; + Asm->EOL(""); } /// EmitDebugStr - Emit visible names into a debug str section. @@ -2371,10 +2359,10 @@ EmitLabel("string", StringID); // Emit the string itself. const std::string &String = StringPool[StringID]; - Asm->EmitString(String); O << "\n"; + Asm->EmitString(String); Asm->EOL(""); } - O << "\n"; + Asm->EOL(""); } } @@ -2384,7 +2372,7 @@ // Start the dwarf loc section. Asm->SwitchToDataSection(TAI->getDwarfLocSection()); - O << "\n"; + Asm->EOL(""); } /// EmitDebugARanges - Emit visible names into a debug aranges section. @@ -2419,7 +2407,7 @@ Asm->EmitInt32(0); Asm->EOL("EOM (1)"); Asm->EmitInt32(0); Asm->EOL("EOM (2)"); - O << "\n"; + Asm->EOL(""); #endif } @@ -2429,7 +2417,7 @@ // Start the dwarf ranges section. Asm->SwitchToDataSection(TAI->getDwarfRangesSection()); - O << "\n"; + Asm->EOL(""); } /// EmitDebugMacInfo - Emit visible names into a debug macinfo section. @@ -2438,7 +2426,7 @@ // Start the dwarf macinfo section. Asm->SwitchToDataSection(TAI->getDwarfMacInfoSection()); - O << "\n"; + Asm->EOL(""); } /// ConstructCompileUnitDIEs - Create a compile unit DIE for each source and From sabre at nondot.org Thu Jan 25 11:38:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Thu, 25 Jan 2007 11:38:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ExtractFunction.cpp Message-ID: <200701251738.l0PHcgvL023963@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ExtractFunction.cpp updated: 1.14 -> 1.15 --- Log message: Make llvm-extract preserve the callingconv of prototypes in the extracted code. --- Diffs of the changes: (+1 -0) ExtractFunction.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Transforms/IPO/ExtractFunction.cpp diff -u llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.14 llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.15 --- llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.14 Fri Oct 20 16:35:41 2006 +++ llvm/lib/Transforms/IPO/ExtractFunction.cpp Thu Jan 25 11:38:26 2007 @@ -70,6 +70,7 @@ Function *New = new Function(I->getFunctionType(), GlobalValue::ExternalLinkage, I->getName()); + New->setCallingConv(I->getCallingConv()); I->setName(""); // Remove Old name // If it's not the named function, delete the body of the function From evan.cheng at apple.com Thu Jan 25 13:44:08 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 13:44:08 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701251944.l0PJi8eC026156@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.3 -> 1.4 --- Log message: Doh. Skip JT branches. --- Diffs of the changes: (+2 -1) ARMConstantIslandPass.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.3 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.4 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.3 Wed Jan 24 21:12:46 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Jan 25 13:43:52 2007 @@ -238,7 +238,8 @@ unsigned Scale = 1; int UOpc = Opc; switch (Opc) { - default: break; // Ignore JT branches + default: + continue; // Ignore JT branches case ARM::Bcc: isCond = true; UOpc = ARM::B; From lauro.venancio at gmail.com Thu Jan 25 14:11:20 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 25 Jan 2007 14:11:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp Message-ID: <200701252011.l0PKBKU9026675@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.47 -> 1.48 --- Log message: Fix elf object definition. --- Diffs of the changes: (+1 -1) ARMAsmPrinter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.47 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.48 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.47 Wed Jan 24 21:07:27 2007 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu Jan 25 14:11:04 2007 @@ -725,7 +725,7 @@ if (const char *Directive = TAI->getHiddenDirective()) O << Directive << name << "\n"; if (Subtarget->isTargetELF()) - O << "\t.type " << name << ", at object\n"; + O << "\t.type " << name << ",%object\n"; if (C->isNullValue()) { if (I->hasExternalLinkage()) { From lauro.venancio at gmail.com Thu Jan 25 15:54:38 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 25 Jan 2007 18:54:38 -0300 Subject: [llvm-commits] [patch] Intruction Constraint DestReg!=SrcReg (for review) Message-ID: <9c10c9f0701251354h301eb289ia694c8c13ab8f8ff@mail.gmail.com> This patch implements the instruction constraint DestReg!=SrcReg. It is needed by ARM backend. A sample of use of this constraint is following: class RegConstraint { string Constraints = C; } // AI_orr - Defines a (op r, r) pattern. class AI_orr : AI<(ops GPR:$dst, GPR:$a, GPR:$b), !strconcat(opc, " $dst, $a, $b"), [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>, RegConstraint<"$dst != $a">; Lauro -------------- next part -------------- A non-text attachment was scrubbed... Name: constraint.patch Type: text/x-patch Size: 13126 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070125/395f45d9/attachment.bin From lauro.venancio at gmail.com Thu Jan 25 16:11:23 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Thu, 25 Jan 2007 16:11:23 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/fcopysign.ll Message-ID: <200701252211.l0PMBNB9004615@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: fcopysign.ll updated: 1.4 -> 1.5 --- Log message: fix fcopysign test --- Diffs of the changes: (+4 -4) fcopysign.ll | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/test/CodeGen/ARM/fcopysign.ll diff -u llvm/test/CodeGen/ARM/fcopysign.ll:1.4 llvm/test/CodeGen/ARM/fcopysign.ll:1.5 --- llvm/test/CodeGen/ARM/fcopysign.ll:1.4 Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/fcopysign.ll Thu Jan 25 16:11:02 2007 @@ -1,7 +1,7 @@ -; RUN: llvm-as < fcopysign.ll | llc -march=arm && -; RUN: llvm-as < fcopysign.ll | llc -march=arm | grep bic | wc -l | grep 2 && -; RUN: llvm-as < fcopysign.ll | llc -march=arm -mattr=+v6,+vfp2 && -; RUN: llvm-as < fcopysign.ll | llc -march=arm -mattr=+v6,+vfp2 | grep fneg | wc -l | grep 2 +; RUN: llvm-as < %s | llc -march=arm && +; RUN: llvm-as < %s | llc -march=arm | grep bic | wc -l | grep 2 && +; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 && +; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fneg | wc -l | grep 2 define float %test1(float %x, double %y) { %tmp = fpext float %x to double From evan.cheng at apple.com Thu Jan 25 16:13:00 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 16:13:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/PrologEpilogInserter.cpp Message-ID: <200701252213.l0PMD0so005059@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: PrologEpilogInserter.cpp updated: 1.66 -> 1.67 --- Log message: Added a MRegisterInfo hook that tells PEI the target is responsible for rounding the stack frame to a multiple of stack alignment. --- Diffs of the changes: (+3 -2) PrologEpilogInserter.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp diff -u llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.66 llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.67 --- llvm/lib/CodeGen/PrologEpilogInserter.cpp:1.66 Tue Jan 23 03:36:03 2007 +++ llvm/lib/CodeGen/PrologEpilogInserter.cpp Thu Jan 25 16:12:41 2007 @@ -389,11 +389,12 @@ // Round up the size to a multiple of the alignment, but only if there are // calls or alloca's in the function. This ensures that any calls to // subroutines have their stack frames suitable aligned. - if (FFI->hasCalls() || FFI->hasVarSizedObjects()) { + const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo(); + if (!RegInfo->targetHandlesStackFrameRounding() && + (FFI->hasCalls() || FFI->hasVarSizedObjects())) { // When we have no frame pointer, we reserve argument space for call sites // in the function immediately on entry to the current function. This // eliminates the need for add/sub sp brackets around call sites. - const MRegisterInfo *RegInfo = Fn.getTarget().getRegisterInfo(); if (!RegInfo->hasFP(Fn)) Offset += FFI->getMaxCallFrameSize(); From evan.cheng at apple.com Thu Jan 25 16:13:00 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 16:13:00 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200701252213.l0PMD0uh005064@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.88 -> 1.89 --- Log message: Added a MRegisterInfo hook that tells PEI the target is responsible for rounding the stack frame to a multiple of stack alignment. --- Diffs of the changes: (+6 -0) MRegisterInfo.h | 6 ++++++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.88 llvm/include/llvm/Target/MRegisterInfo.h:1.89 --- llvm/include/llvm/Target/MRegisterInfo.h:1.88 Wed Jan 24 12:45:12 2007 +++ llvm/include/llvm/Target/MRegisterInfo.h Thu Jan 25 16:12:41 2007 @@ -367,6 +367,12 @@ return 0; } + /// targetHandlesStackFrameRounding - Returns true if the target is responsible + /// for rounding up the stack frame (probably at emitPrologue time). + virtual bool targetHandlesStackFrameRounding() const { + return false; + } + /// hasFP - Return true if the specified function should have a dedicated frame /// pointer register. For most targets this is true only if the function has /// variable sized allocas or if frame pointer elimination is disabled. From evan.cheng at apple.com Thu Jan 25 16:25:20 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 16:25:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h Message-ID: <200701252225.l0PMPKG9005685@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.97 -> 1.98 PPCRegisterInfo.h updated: 1.23 -> 1.24 --- Log message: - Tell PEI that PPC will handle stack frame rounding itself. - Do not round up to max. alignment of stack object if it is > stack alignment. It will have to be handled with dynamic aligning code. --- Diffs of the changes: (+7 -7) PPCRegisterInfo.cpp | 9 ++------- PPCRegisterInfo.h | 5 +++++ 2 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.98 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97 Wed Jan 24 12:45:13 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Thu Jan 25 16:25:04 2007 @@ -451,9 +451,6 @@ // Determine the maximum call stack size. maxCallFrameSize may be // less than the minimum. unsigned maxCallFrameSize = MFI->getMaxCallFrameSize(); - unsigned getMinCallFrameSize = - PPCFrameInfo::getMinCallFrameSize(LP64); - maxCallFrameSize = std::max(maxCallFrameSize, getMinCallFrameSize); // Get the total frame size. unsigned FrameSize = MFI->getStackSize(); @@ -712,11 +709,9 @@ // Get the alignments provided by the target, and the maximum alignment // (if any) of the fixed frame objects. - unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment(); unsigned MaxAlign = MFI->getMaxAlignment(); - unsigned Align = std::max(TargetAlign, MaxAlign); - assert(isPowerOf2_32(Align) && "Alignment is not power of 2"); - unsigned AlignMask = Align - 1; // + unsigned TargetAlign = MF.getTarget().getFrameInfo()->getStackAlignment(); + unsigned AlignMask = TargetAlign - 1; // // If we are a leaf function, and use up to 224 bytes of stack space, // don't have a frame pointer, calls, or dynamic alloca then we do not need Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.23 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.24 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.23 Wed Jan 24 12:45:13 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h Thu Jan 25 16:25:04 2007 @@ -58,6 +58,11 @@ const TargetRegisterClass* const* getCalleeSavedRegClasses() const; + /// targetHandlesStackFrameRounding - Returns true if the target is + /// responsible for rounding up the stack frame (probably at emitPrologue + /// time). + bool targetHandlesStackFrameRounding() const { return true; } + bool hasFP(const MachineFunction &MF) const; void eliminateCallFramePseudoInstr(MachineFunction &MF, From dpatel at apple.com Thu Jan 25 16:27:23 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 16:27:23 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h Message-ID: <200701252227.l0PMRNKc006914@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.76 -> 1.77 --- Log message: Remove dead code. --- Diffs of the changes: (+0 -7) Pass.h | 7 ------- 1 files changed, 7 deletions(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.76 llvm/include/llvm/Pass.h:1.77 --- llvm/include/llvm/Pass.h:1.76 Wed Jan 17 14:30:17 2007 +++ llvm/include/llvm/Pass.h Thu Jan 25 16:27:00 2007 @@ -46,9 +46,7 @@ class AnalysisUsage; class PassInfo; class ImmutablePass; -template class PassManagerT; class BasicBlockPassManager; -class FunctionPassManagerT; class ModulePassManager; class PMStack; class AnalysisResolver; @@ -190,11 +188,6 @@ template AnalysisType &getAnalysisID(const PassInfo *PI) const; -private: - template friend class PassManagerT; - friend class ModulePassManager; - friend class FunctionPassManagerT; - friend class BasicBlockPassManager; }; inline std::ostream &operator<<(std::ostream &OS, const Pass &P) { From evan.cheng at apple.com Thu Jan 25 16:28:53 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 16:28:53 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/PowerPC/Frames-align.ll Message-ID: <200701252228.l0PMSrK9007817@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/PowerPC: Frames-align.ll updated: 1.3 -> 1.4 --- Log message: Fix test case. --- Diffs of the changes: (+1 -1) Frames-align.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/PowerPC/Frames-align.ll diff -u llvm/test/CodeGen/PowerPC/Frames-align.ll:1.3 llvm/test/CodeGen/PowerPC/Frames-align.ll:1.4 --- llvm/test/CodeGen/PowerPC/Frames-align.ll:1.3 Wed Dec 20 18:01:42 2006 +++ llvm/test/CodeGen/PowerPC/Frames-align.ll Thu Jan 25 16:28:32 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep 'rlwinm r0, r1, 0, 22, 31' && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep 'subfic r0, r0, -17408' && +; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep 'subfic r0, r0, -16448' && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc64 -mtriple=powerpc-apple-darwin8 | grep 'rldicl r0, r1, 0, 54' From jlaskey at apple.com Thu Jan 25 16:40:29 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 25 Jan 2007 18:40:29 -0400 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h In-Reply-To: <200701252225.l0PMPKG9005685@zion.cs.uiuc.edu> References: <200701252225.l0PMPKG9005685@zion.cs.uiuc.edu> Message-ID: On 25-Jan-07, at 06:25 PM, Evan Cheng wrote: > Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp > diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97 llvm/lib/ > Target/PowerPC/PPCRegisterInfo.cpp:1.98 > --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97 Wed Jan 24 > 12:45:13 2007 > +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Thu Jan 25 16:25:04 > 2007 > @@ -451,9 +451,6 @@ > // Determine the maximum call stack size. maxCallFrameSize may be > // less than the minimum. > unsigned maxCallFrameSize = MFI->getMaxCallFrameSize(); > - unsigned getMinCallFrameSize = > - PPCFrameInfo::getMinCallFrameSize(LP64); > - maxCallFrameSize = std::max(maxCallFrameSize, getMinCallFrameSize); > // Get the total frame size. > unsigned FrameSize = MFI->getStackSize(); Why did you remove this? -- Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070125/5efb044f/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070125/5efb044f/attachment.bin From jlaskey at apple.com Thu Jan 25 16:48:16 2007 From: jlaskey at apple.com (Jim Laskey) Date: Thu, 25 Jan 2007 18:48:16 -0400 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h In-Reply-To: References: <200701252225.l0PMPKG9005685@zion.cs.uiuc.edu> Message-ID: NVM. I forgot this was redundant. -- Jim On 25-Jan-07, at 06:40 PM, Jim Laskey wrote: > > On 25-Jan-07, at 06:25 PM, Evan Cheng wrote: > >> Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp >> diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97 llvm/lib/ >> Target/PowerPC/PPCRegisterInfo.cpp:1.98 >> --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.97 Wed Jan 24 >> 12:45:13 2007 >> +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Thu Jan 25 >> 16:25:04 2007 >> @@ -451,9 +451,6 @@ >> // Determine the maximum call stack size. maxCallFrameSize may be >> // less than the minimum. >> unsigned maxCallFrameSize = MFI->getMaxCallFrameSize(); >> - unsigned getMinCallFrameSize = >> - PPCFrameInfo::getMinCallFrameSize(LP64); >> - maxCallFrameSize = std::max(maxCallFrameSize, >> getMinCallFrameSize); >> // Get the total frame size. >> unsigned FrameSize = MFI->getStackSize(); > > > Why did you remove this? > > -- Jim > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070125/2c5f747b/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2417 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070125/2c5f747b/attachment.bin From evan.cheng at apple.com Thu Jan 25 16:48:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 16:48:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Message-ID: <200701252248.l0PMmfcv008843@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.cpp updated: 1.98 -> 1.99 --- Log message: Fix comment. --- Diffs of the changes: (+1 -2) PPCRegisterInfo.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.98 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.99 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.98 Thu Jan 25 16:25:04 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Thu Jan 25 16:48:25 2007 @@ -448,8 +448,7 @@ // Determine whether 64-bit pointers are used. bool LP64 = Subtarget.isPPC64(); - // Determine the maximum call stack size. maxCallFrameSize may be - // less than the minimum. + // Get the maximum call stack size. unsigned maxCallFrameSize = MFI->getMaxCallFrameSize(); // Get the total frame size. unsigned FrameSize = MFI->getStackSize(); From evan.cheng at apple.com Thu Jan 25 17:18:32 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 17:18:32 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp Message-ID: <200701252318.l0PNIWdT009345@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.40 -> 1.41 --- Log message: I am an idiot. --- Diffs of the changes: (+1 -1) ARMRegisterInfo.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.40 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.41 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.40 Tue Jan 23 03:37:21 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Thu Jan 25 17:18:16 2007 @@ -984,7 +984,7 @@ AFI->getGPRCalleeSavedArea2Size() + AFI->getDPRCalleeSavedAreaSize()); if (isThumb) - emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII); + emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); else { if (STI.isTargetDarwin()) { NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; From evan.cheng at apple.com Thu Jan 25 17:19:17 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 17:19:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701252319.l0PNJH0a009368@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.4 -> 1.5 --- Log message: Add comment, fix typo, reduce memory usage, etc. --- Diffs of the changes: (+14 -9) ARMConstantIslandPass.cpp | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.4 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.5 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.4 Thu Jan 25 13:43:52 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Jan 25 17:18:59 2007 @@ -79,14 +79,14 @@ /// opcode. struct ImmBranch { MachineInstr *MI; - bool isCond; + unsigned MaxDisp : 31; + bool isCond : 1; int UncondBr; - unsigned MaxDisp; - ImmBranch(MachineInstr *mi, bool cond, int ubr, unsigned maxdisp) - : MI(mi), isCond(cond), UncondBr(ubr), MaxDisp(maxdisp) {} + ImmBranch(MachineInstr *mi, unsigned maxdisp, bool cond, int ubr) + : MI(mi), MaxDisp(maxdisp), isCond(cond), UncondBr(ubr) {} }; - /// Branches - Keep track of all the immediate branche instructions. + /// Branches - Keep track of all the immediate branch instructions. /// std::vector ImmBranches; @@ -107,7 +107,7 @@ void SplitBlockBeforeInstr(MachineInstr *MI); void UpdateForInsertedWaterBlock(MachineBasicBlock *NewBB); bool HandleConstantPoolUser(MachineFunction &Fn, CPUser &U); - bool ShortenImmediateBranch(MachineFunction &Fn, ImmBranch &Br); + bool FixUpImmediateBranch(MachineFunction &Fn, ImmBranch &Br); unsigned GetInstSize(MachineInstr *MI) const; unsigned GetOffsetOf(MachineInstr *MI) const; @@ -154,7 +154,7 @@ for (unsigned i = 0, e = CPUsers.size(); i != e; ++i) MadeChange |= HandleConstantPoolUser(Fn, CPUsers[i]); for (unsigned i = 0, e = ImmBranches.size(); i != e; ++i) - MadeChange |= ShortenImmediateBranch(Fn, ImmBranches[i]); + MadeChange |= FixUpImmediateBranch(Fn, ImmBranches[i]); } while (MadeChange); BBSizes.clear(); @@ -260,7 +260,7 @@ break; } unsigned MaxDisp = (1 << (Bits-1)) * Scale; - ImmBranches.push_back(ImmBranch(I, isCond, UOpc, MaxDisp)); + ImmBranches.push_back(ImmBranch(I, MaxDisp, isCond, UOpc)); } // Scan the instructions for constant pool operands. @@ -560,8 +560,13 @@ return true; } +/// FixUpImmediateBranch - Fix up immediate branches whose destination is too +/// far away to fit in its displacement field. If it is a conditional branch, +/// then it is converted to an inverse conditional branch + an unconditional +/// branch to the destination. If it is an unconditional branch, then it is +/// converted to a branch to a branch. bool -ARMConstantIslands::ShortenImmediateBranch(MachineFunction &Fn, ImmBranch &Br) { +ARMConstantIslands::FixUpImmediateBranch(MachineFunction &Fn, ImmBranch &Br) { MachineInstr *MI = Br.MI; MachineBasicBlock *DestBB = MI->getOperand(0).getMachineBasicBlock(); From dpatel at apple.com Thu Jan 25 17:23:44 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 17:23:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/DCE.cpp Message-ID: <200701252323.l0PNNiF4009467@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: DCE.cpp updated: 1.61 -> 1.62 --- Log message: Inherit BasicBlockPass directly from Pass. --- Diffs of the changes: (+1 -1) DCE.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/DCE.cpp diff -u llvm/lib/Transforms/Scalar/DCE.cpp:1.61 llvm/lib/Transforms/Scalar/DCE.cpp:1.62 --- llvm/lib/Transforms/Scalar/DCE.cpp:1.61 Tue Dec 19 15:40:18 2006 +++ llvm/lib/Transforms/Scalar/DCE.cpp Thu Jan 25 17:23:25 2007 @@ -53,7 +53,7 @@ RegisterPass X("die", "Dead Instruction Elimination"); } -FunctionPass *llvm::createDeadInstEliminationPass() { +Pass *llvm::createDeadInstEliminationPass() { return new DeadInstElimination(); } From dpatel at apple.com Thu Jan 25 17:23:45 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 17:23:45 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Scalar.h Message-ID: <200701252323.l0PNNjGJ009473@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: Scalar.h updated: 1.69 -> 1.70 --- Log message: Inherit BasicBlockPass directly from Pass. --- Diffs of the changes: (+3 -3) Scalar.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Transforms/Scalar.h diff -u llvm/include/llvm/Transforms/Scalar.h:1.69 llvm/include/llvm/Transforms/Scalar.h:1.70 --- llvm/include/llvm/Transforms/Scalar.h:1.69 Fri Oct 13 15:53:50 2006 +++ llvm/include/llvm/Transforms/Scalar.h Thu Jan 25 17:23:25 2007 @@ -19,8 +19,8 @@ namespace llvm { -class ModulePass; class FunctionPass; +class Pass; class GetElementPtrInst; class PassInfo; class TerminatorInst; @@ -52,7 +52,7 @@ // without modifying the CFG of the function. It is a BasicBlockPass, so it // runs efficiently when queued next to other BasicBlockPass's. // -FunctionPass *createDeadInstEliminationPass(); +Pass *createDeadInstEliminationPass(); //===----------------------------------------------------------------------===// // @@ -249,7 +249,7 @@ // // AU.addRequiredID(LowerAllocationsID); // -FunctionPass *createLowerAllocationsPass(bool LowerMallocArgToInteger = false); +Pass *createLowerAllocationsPass(bool LowerMallocArgToInteger = false); extern const PassInfo *LowerAllocationsID; //===----------------------------------------------------------------------===// From dpatel at apple.com Thu Jan 25 17:23:48 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 17:23:48 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h Message-ID: <200701252323.l0PNNmPx009479@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.77 -> 1.78 --- Log message: Inherit BasicBlockPass directly from Pass. --- Diffs of the changes: (+1 -1) Pass.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.77 llvm/include/llvm/Pass.h:1.78 --- llvm/include/llvm/Pass.h:1.77 Thu Jan 25 16:27:00 2007 +++ llvm/include/llvm/Pass.h Thu Jan 25 17:23:25 2007 @@ -291,7 +291,7 @@ /// other basic block in the function. /// 3. Optimizations conform to all of the constraints of FunctionPasses. /// -class BasicBlockPass : public FunctionPass { +class BasicBlockPass : public Pass { public: /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. From dpatel at apple.com Thu Jan 25 17:23:48 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 17:23:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LowerAllocations.cpp Message-ID: <200701252323.l0PNNmdK009484@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LowerAllocations.cpp updated: 1.70 -> 1.71 --- Log message: Inherit BasicBlockPass directly from Pass. --- Diffs of the changes: (+1 -1) LowerAllocations.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/LowerAllocations.cpp diff -u llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.70 llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.71 --- llvm/lib/Transforms/Utils/LowerAllocations.cpp:1.70 Sun Jan 7 02:12:01 2007 +++ llvm/lib/Transforms/Utils/LowerAllocations.cpp Thu Jan 25 17:23:25 2007 @@ -73,7 +73,7 @@ // Publically exposed interface to pass... const PassInfo *llvm::LowerAllocationsID = X.getPassInfo(); // createLowerAllocationsPass - Interface to this file... -FunctionPass *llvm::createLowerAllocationsPass(bool LowerMallocArgToInteger) { +Pass *llvm::createLowerAllocationsPass(bool LowerMallocArgToInteger) { return new LowerAllocations(LowerMallocArgToInteger); } From evan.cheng at apple.com Thu Jan 25 17:31:20 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 17:31:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701252331.l0PNVK3h009614@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.5 -> 1.6 --- Log message: Forgot to update this. --- Diffs of the changes: (+1 -1) ARMConstantIslandPass.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.5 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.6 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.5 Thu Jan 25 17:18:59 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Jan 25 17:31:04 2007 @@ -613,7 +613,7 @@ Br.MI = &MBB->back(); BuildMI(MBB, TII->get(Br.UncondBr)).addMBB(DestBB); unsigned MaxDisp = (Br.UncondBr == ARM::tB) ? (1<<10)*2 : (1<<23)*4; - ImmBranches.push_back(ImmBranch(&MBB->back(), false, Br.UncondBr, MaxDisp)); + ImmBranches.push_back(ImmBranch(&MBB->back(), MaxDisp, false, Br.UncondBr)); MI->eraseFromParent(); // Increase the size of MBB to account for the new unconditional branch. From dpatel at apple.com Thu Jan 25 18:23:16 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 18:23:16 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Pass.h Message-ID: <200701260023.l0Q0NGkc013173@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Pass.h updated: 1.78 -> 1.79 --- Log message: Inherit FunctionPass directly from Pass. --- Diffs of the changes: (+1 -1) Pass.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Pass.h diff -u llvm/include/llvm/Pass.h:1.78 llvm/include/llvm/Pass.h:1.79 --- llvm/include/llvm/Pass.h:1.78 Thu Jan 25 17:23:25 2007 +++ llvm/include/llvm/Pass.h Thu Jan 25 18:23:00 2007 @@ -247,7 +247,7 @@ /// 2. Optimizing a function does not cause the addition or removal of any /// functions in the module /// -class FunctionPass : public ModulePass { +class FunctionPass : public Pass { public: /// doInitialization - Virtual method overridden by subclasses to do /// any necessary per-module initialization. From evan.cheng at apple.com Thu Jan 25 18:25:15 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 16:25:15 -0800 Subject: [llvm-commits] [patch] Intruction Constraint DestReg!=SrcReg (for review) In-Reply-To: <9c10c9f0701251354h301eb289ia694c8c13ab8f8ff@mail.gmail.com> References: <9c10c9f0701251354h301eb289ia694c8c13ab8f8ff@mail.gmail.com> Message-ID: <361E3BFE-3731-4265-80BC-AF188AD64221@apple.com> Hi Lauro, Thanks for taking a crack at this! Your work is much appreciated. However, I have some comments. :-) 1. I think rather than adding a constraint that says a source operand must not be assigned the same register as another. It would be better if you add a constraint that says a source operand "can be killed at issue cycle + n". The live range analysis current assumes every source operand read is completed at issue cycle + 0 and write back happens at issue cycle + 2. By changing the read latency to 2 you can force a source operand to conflict with a destination operand. 2. Please write more comments. :-) Thanks, Evan On Jan 25, 2007, at 1:54 PM, Lauro Ramos Venancio wrote: > This patch implements the instruction constraint DestReg!=SrcReg. It > is needed by ARM backend. > > A sample of use of this constraint is following: > > class RegConstraint { > string Constraints = C; > } > > // AI_orr - Defines a (op r, r) pattern. > class AI_orr > : AI<(ops GPR:$dst, GPR:$a, GPR:$b), > !strconcat(opc, " $dst, $a, $b"), > [(set GPR:$dst, (opnode GPR:$a, GPR:$b))]>, > RegConstraint<"$dst != $a">; > > > Lauro > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Thu Jan 25 18:42:25 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 16:42:25 -0800 Subject: [llvm-commits] InReg patch for review In-Reply-To: <1169557998.14117.151.camel@asl.dorms.spbu.ru> References: <1169557998.14117.151.camel@asl.dorms.spbu.ru> Message-ID: <5AF9B69F-3B35-47DD-888E-005B8B5C7EA7@apple.com> Comments: diff -r bdd0e76350e4 lib/Target/PowerPC/PPCISelLowering.cpp --- a/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jan 23 13:34:14 2007 +0300 +++ b/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jan 23 01:12:46 2007 +0300 @@ -1360,9 +1360,10 @@ static SDOperand LowerCALL(SDOperand Op, // On PPC64, promote integers to 64-bit values. if (isPPC64 && Arg.getValueType() == MVT::i32) { - unsigned ExtOp = ISD::ZERO_EXTEND; - if (cast(Op.getOperand(5+2*i+1))->getValue()) - ExtOp = ISD::SIGN_EXTEND; + unsigned Flags = + dyn_cast(Op.getOperand(5+2*i+1))->getValue(); + unsigned ExtOp = (Flags & 1) ? ISD::SIGN_EXTEND : ISD::ZERO_EXTEND; + Arg = DAG.getNode(ExtOp, MVT::i64, Arg); } Please use cast<> not dyn_cast<> here. // Add one result value for each formal argument. std::vector RetVals; + unsigned j = 0; for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) { MVT::ValueType VT = getValueType(I->getType()); + bool isInReg = FTy->paramHasAttr(++j, FunctionType::InRegAttribute); + unsigned Flags = (isInReg << 1); + // Handle regparm attribute + std::vector ArgInRegs(NumArgs, false); + if (!isVarArg) { + for (unsigned i = 0; i(Op.getOperand(3+i))- >getValue(); + if ((Flags >> 1) & 1) + ArgInRegs[i] = true; + } + } Please add getter / setter routines for these attributes. In LowerFastCCArguments(): - if (ObjectVT == MVT::i64 && ObjIntRegs) { - SDOperand ArgValue2 = DAG.getLoad(Op.Val->getValueType(i), Root, FIN, - NULL, 0); - ArgValue = DAG.getNode(ISD::BUILD_PAIR, MVT::i64, ArgValue, ArgValue2); - } else - ArgValue = DAG.getLoad(Op.Val->getValueType(i), Root, FIN, NULL, 0); + ArgValue = DAG.getLoad(Op.Val->getValueType(i), Root, FIN, NULL, 0); + I am not following. How are you passing i64 values? It has to take 2 registers, right? - Entry.isSigned = false; + Entry.isSigned = false; Entry.isInReg = false; Args.push_back(Entry); // Extend the unsigned i8 argument to be an int value for the call. Entry.Node = DAG.getNode(ISD::ZERO_EXTEND, MVT::i32, Op.getOperand(2)); Entry.Ty = IntPtrTy; - Entry.isSigned = false; + Entry.isSigned = false; Entry.isInReg = false; Please separate each statement to its own line. :-) The rest looks good! Thanks. Evan On Jan 23, 2007, at 5:13 AM, Anton Korobeynikov wrote: > Hello, Everyone. > > Attached patch will implement "inreg" function argument attribute, > which > is used to tell backend "place this argument in register, if > possible". > The needed changes in x86 backend were made as well. > > This also allowed to merge C & StdCall CCs and Fast & FastCall CCs > inside x86 backend. > > This patch is first step for supporting gcc's "regparm" function > attribute. > > -- > With best regards, Anton Korobeynikov. > > Faculty of Mathematics & Mechanics, Saint Petersburg State University. > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From dpatel at apple.com Thu Jan 25 18:47:58 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 18:47:58 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp InlineSimple.cpp PruneEH.cpp Message-ID: <200701260047.l0Q0lwRU013696@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.33 -> 1.34 InlineSimple.cpp updated: 1.76 -> 1.77 PruneEH.cpp updated: 1.26 -> 1.27 --- Log message: Inherit CallGraphSCCPass directly from Pass. --- Diffs of the changes: (+3 -3) ArgumentPromotion.cpp | 2 +- InlineSimple.cpp | 2 +- PruneEH.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.33 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.34 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.33 Sat Dec 30 23:48:39 2006 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Thu Jan 25 18:47:38 2007 @@ -72,7 +72,7 @@ "Promote 'by reference' arguments to scalars"); } -ModulePass *llvm::createArgumentPromotionPass() { +Pass *llvm::createArgumentPromotionPass() { return new ArgPromotion(); } Index: llvm/lib/Transforms/IPO/InlineSimple.cpp diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.76 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.77 --- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.76 Sun Nov 26 19:05:10 2006 +++ llvm/lib/Transforms/IPO/InlineSimple.cpp Thu Jan 25 18:47:38 2007 @@ -58,7 +58,7 @@ RegisterPass X("inline", "Function Integration/Inlining"); } -ModulePass *llvm::createFunctionInliningPass() { return new SimpleInliner(); } +Pass *llvm::createFunctionInliningPass() { return new SimpleInliner(); } // CountCodeReductionForConstant - Figure out an approximation for how many // instructions will be constant folded if the specified value is constant. Index: llvm/lib/Transforms/IPO/PruneEH.cpp diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.26 llvm/lib/Transforms/IPO/PruneEH.cpp:1.27 --- llvm/lib/Transforms/IPO/PruneEH.cpp:1.26 Tue Dec 19 16:09:18 2006 +++ llvm/lib/Transforms/IPO/PruneEH.cpp Thu Jan 25 18:47:38 2007 @@ -50,7 +50,7 @@ RegisterPass X("prune-eh", "Remove unused exception handling info"); } -ModulePass *llvm::createPruneEHPass() { return new PruneEH(); } +Pass *llvm::createPruneEHPass() { return new PruneEH(); } bool PruneEH::runOnSCC(const std::vector &SCC) { From dpatel at apple.com Thu Jan 25 18:47:59 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 18:47:59 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/IPO.h Message-ID: <200701260047.l0Q0lxPJ013701@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: IPO.h updated: 1.46 -> 1.47 --- Log message: Inherit CallGraphSCCPass directly from Pass. --- Diffs of the changes: (+4 -3) IPO.h | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Transforms/IPO.h diff -u llvm/include/llvm/Transforms/IPO.h:1.46 llvm/include/llvm/Transforms/IPO.h:1.47 --- llvm/include/llvm/Transforms/IPO.h:1.46 Thu Jul 20 12:48:05 2006 +++ llvm/include/llvm/Transforms/IPO.h Thu Jan 25 18:47:38 2007 @@ -21,6 +21,7 @@ class FunctionPass; class ModulePass; +class Pass; class Function; class BasicBlock; @@ -101,13 +102,13 @@ /// createFunctionInliningPass - Return a new pass object that uses a heuristic /// to inline direct function calls to small functions. /// -ModulePass *createFunctionInliningPass(); +Pass *createFunctionInliningPass(); //===----------------------------------------------------------------------===// /// createPruneEHPass - Return a new pass object which transforms invoke /// instructions into calls, if the callee can _not_ unwind the stack. /// -ModulePass *createPruneEHPass(); +Pass *createPruneEHPass(); //===----------------------------------------------------------------------===// /// createInternalizePass - This pass loops over all of the functions in the @@ -134,7 +135,7 @@ /// createArgumentPromotionPass - This pass promotes "by reference" arguments to /// be passed by value. /// -ModulePass *createArgumentPromotionPass(); +Pass *createArgumentPromotionPass(); //===----------------------------------------------------------------------===// /// createIPConstantPropagationPass - This pass propagates constants from call From dpatel at apple.com Thu Jan 25 18:48:00 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 18:48:00 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h Message-ID: <200701260048.l0Q0m0iD013706@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.8 -> 1.9 --- Log message: Inherit CallGraphSCCPass directly from Pass. --- Diffs of the changes: (+1 -1) CallGraphSCCPass.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.8 llvm/include/llvm/CallGraphSCCPass.h:1.9 --- llvm/include/llvm/CallGraphSCCPass.h:1.8 Tue Jan 23 15:52:35 2007 +++ llvm/include/llvm/CallGraphSCCPass.h Thu Jan 25 18:47:38 2007 @@ -29,7 +29,7 @@ class CallGraph; class PMStack; -struct CallGraphSCCPass : public ModulePass { +struct CallGraphSCCPass : public Pass { /// doInitialization - This method is called before the SCC's of the program /// has been processed, allowing the pass to do initialization as necessary. From evan.cheng at apple.com Thu Jan 25 19:05:00 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 19:05:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701260105.l0Q150eo014516@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.6 -> 1.7 --- Log message: Need to scan the function for branches even if there aren't any constants. --- Diffs of the changes: (+2 -3) ARMConstantIslandPass.cpp | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.6 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.7 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.6 Thu Jan 25 17:31:04 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Jan 25 19:04:44 2007 @@ -122,9 +122,7 @@ } bool ARMConstantIslands::runOnMachineFunction(MachineFunction &Fn) { - // If there are no constants, there is nothing to do. MachineConstantPool &MCP = *Fn.getConstantPool(); - if (MCP.isEmpty()) return false; TII = Fn.getTarget().getInstrInfo(); TAI = Fn.getTarget().getTargetAsmInfo(); @@ -136,7 +134,8 @@ // Perform the initial placement of the constant pool entries. To start with, // we put them all at the end of the function. std::vector CPEMIs; - DoInitialPlacement(Fn, CPEMIs); + if (!MCP.isEmpty()) + DoInitialPlacement(Fn, CPEMIs); /// The next UID to take is the first unused one. NextUID = CPEMIs.size(); From dpatel at apple.com Thu Jan 25 19:08:37 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 19:08:37 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h Message-ID: <200701260108.l0Q18bXU014585@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: CallGraphSCCPass.h updated: 1.9 -> 1.10 --- Log message: Remove dead code. CallGraphSCCPass does not need to implement runOnModule(). It supports runOnSCC(). --- Diffs of the changes: (+0 -5) CallGraphSCCPass.h | 5 ----- 1 files changed, 5 deletions(-) Index: llvm/include/llvm/CallGraphSCCPass.h diff -u llvm/include/llvm/CallGraphSCCPass.h:1.9 llvm/include/llvm/CallGraphSCCPass.h:1.10 --- llvm/include/llvm/CallGraphSCCPass.h:1.9 Thu Jan 25 18:47:38 2007 +++ llvm/include/llvm/CallGraphSCCPass.h Thu Jan 25 19:08:18 2007 @@ -50,11 +50,6 @@ return false; } - /// run - Run this pass, returning true if a modification was made to the - /// module argument. This is implemented in terms of the runOnSCC method. - /// - virtual bool runOnModule(Module &M); - /// Assign pass manager to manager this pass virtual void assignPassManager(PMStack &PMS, PassManagerType PMT = PMT_CallGraphPassManager); From dpatel at apple.com Thu Jan 25 19:08:37 2007 From: dpatel at apple.com (Devang Patel) Date: Thu, 25 Jan 2007 19:08:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Message-ID: <200701260108.l0Q18bdf014591@zion.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: CallGraphSCCPass.cpp updated: 1.13 -> 1.14 --- Log message: Remove dead code. CallGraphSCCPass does not need to implement runOnModule(). It supports runOnSCC(). --- Diffs of the changes: (+0 -9) CallGraphSCCPass.cpp | 9 --------- 1 files changed, 9 deletions(-) Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.13 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.14 --- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.13 Tue Jan 23 15:55:17 2007 +++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp Thu Jan 25 19:08:18 2007 @@ -189,12 +189,3 @@ AU.addRequired(); AU.addPreserved(); } - -bool CallGraphSCCPass::runOnModule(Module &M) { - CallGraph &CG = getAnalysis(); - bool Changed = doInitialization(CG); - for (scc_iterator I = scc_begin(&CG), E = scc_end(&CG); - I != E; ++I) - Changed = runOnSCC(*I); - return Changed | doFinalization(CG); -} From evan.cheng at apple.com Thu Jan 25 20:02:54 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Thu, 25 Jan 2007 20:02:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Message-ID: <200701260202.l0Q22ssN015869@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMConstantIslandPass.cpp updated: 1.7 -> 1.8 --- Log message: SplitBlockBeforeInstr() insert a unconditional branch to the next BB. This is unnecessary when we are fixing up a conditional branch since we will be adding a unconditional branch to the destination of the original branch. --- Diffs of the changes: (+6 -2) ARMConstantIslandPass.cpp | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.7 llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.8 --- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.7 Thu Jan 25 19:04:44 2007 +++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp Thu Jan 25 20:02:39 2007 @@ -602,13 +602,17 @@ // direct the updated conditional branch to the fall-through block. Otherwise, // split the MBB before the next instruction. MachineBasicBlock *MBB = MI->getParent(); - if (&MBB->back() != MI || !BBHasFallthrough(MBB)) + if (&MBB->back() != MI || !BBHasFallthrough(MBB)) { SplitBlockBeforeInstr(MI); + // No need for the branch to the next block. We're adding a unconditional + // branch to the destination. + MBB->back().eraseFromParent(); + } MachineBasicBlock *NextBB = next(MachineFunction::iterator(MBB)); // Insert a unconditional branch and replace the conditional branch. // Also update the ImmBranch as well as adding a new entry for the new branch. - BuildMI(MBB, TII->get(MI->getOpcode())).addMBB(NextBB).addImm((unsigned)CC); + BuildMI(MBB, TII->get(MI->getOpcode())).addMBB(NextBB).addImm(CC); Br.MI = &MBB->back(); BuildMI(MBB, TII->get(Br.UncondBr)).addMBB(DestBB); unsigned MaxDisp = (Br.UncondBr == ARM::tB) ? (1<<10)*2 : (1<<23)*4; From han at autoesl.com Thu Jan 25 21:10:33 2007 From: han at autoesl.com (Guoling Han) Date: Thu, 25 Jan 2007 21:10:33 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/trunc.c trunc.reference_output general-test.c matrix.c matrix.h matrix.reference_output Message-ID: <200701260310.l0Q3AXLT016896@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: trunc.c added (r1.1) trunc.reference_output added (r1.1) general-test.c updated: 1.5 -> 1.6 matrix.c updated: 1.7 -> 1.8 matrix.h updated: 1.1 -> 1.2 matrix.reference_output updated: 1.2 -> 1.3 --- Log message: Add trunc.c for cbe test. Modify matrix.c to avoid overflow problem. --- Diffs of the changes: (+71 -17) general-test.c | 2 - matrix.c | 14 ++++++------- matrix.h | 2 - matrix.reference_output | 16 +++++++-------- trunc.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ trunc.reference_output | 4 +++ 6 files changed, 71 insertions(+), 17 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/trunc.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/trunc.c:1.1 *** /dev/null Thu Jan 25 21:10:27 2007 --- llvm-test/SingleSource/UnitTests/Integer/trunc.c Thu Jan 25 21:10:17 2007 *************** *** 0 **** --- 1,50 ---- + //===--- trunc.c --- Test Cases for Bit Accurate Types --------------------===// + // + // This file was developed by Guoling Han and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is used to test trunc and sext instructions. + // + //===----------------------------------------------------------------------===// + + #include + + typedef int __attribute__ ((bitwidth(24))) int24; + + int + test(int24 v) + { + int y; + + y = v * (-1); + printf("test() y = %d\n", y); + + return 0; + } + + int + main ( int argc, char** argv) + { + int num; + int24 x; + + if (argc > 1) + num = atoi(argv[1]); + + test(num); + + num = num - 0xdf5e75; //0x10001 + + x = num; + + printf("x=%x\n", x); + + if(x != 1) + printf("error\n"); + + test(x); + + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/trunc.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/trunc.reference_output:1.1 *** /dev/null Thu Jan 25 21:10:33 2007 --- llvm-test/SingleSource/UnitTests/Integer/trunc.reference_output Thu Jan 25 21:10:17 2007 *************** *** 0 **** --- 1,4 ---- + test() y = 2138506 + x=1 + test() y = -1 + exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/general-test.c diff -u llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.5 llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.6 --- llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.5 Mon Jan 22 15:07:53 2007 +++ llvm-test/SingleSource/UnitTests/Integer/general-test.c Thu Jan 25 21:10:17 2007 @@ -41,7 +41,7 @@ *result = sizeof(My17BitInt) + sizeof(j) + sizeof(struct MyStruct); Data1.i4Field = num; Data1.i12Field = num + 1; - Data1.i17Field = num + 2; + Data1.i17Field = num + 2; Data1.i37Field = num + 3; Data1.next = 0; Data2 = Data1; Index: llvm-test/SingleSource/UnitTests/Integer/matrix.c diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.7 llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.8 --- llvm-test/SingleSource/UnitTests/Integer/matrix.c:1.7 Mon Jan 22 18:17:21 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.c Thu Jan 25 21:10:17 2007 @@ -19,10 +19,10 @@ typedef enum bool{false=0, true=1} bool; -void mysort(const int17 X[8], int17 Y[8]) +void mysort(const int24 X[8], int24 Y[8]) { unsigned int i, j; - int17 temp; + int24 temp; { j = 0; for ( ; ; ) { @@ -69,11 +69,11 @@ -int my_test(int17 A[8][8], int17 B[8][8]) +int my_test(int24 A[8][8], int24 B[8][8]) { unsigned int i, j, k, dd; - int17 C[8][8]; - int17 D[8]; + int24 C[8][8]; + int24 D[8]; int t; { i = 0; @@ -118,8 +118,8 @@ { int i, j; - int17 X[8][8]; - int17 Y[8][8]; + int24 X[8][8]; + int24 Y[8][8]; for(i=0; i<8; i++) for(j=0; j<8; j++){ Index: llvm-test/SingleSource/UnitTests/Integer/matrix.h diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.h:1.1 llvm-test/SingleSource/UnitTests/Integer/matrix.h:1.2 --- llvm-test/SingleSource/UnitTests/Integer/matrix.h:1.1 Thu Jan 18 20:22:46 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.h Thu Jan 25 21:10:17 2007 @@ -2,5 +2,5 @@ // Date: Fri Jan 12 17:32:33 CST 2007 #ifndef DATATYPE_DEFINE #define DATATYPE_DEFINE -typedef int __attribute__ ((bitwidth(17))) int17; +typedef int __attribute__ ((bitwidth(24))) int24; #endif Index: llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.2 llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.3 --- llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output:1.2 Mon Jan 22 14:47:27 2007 +++ llvm-test/SingleSource/UnitTests/Integer/matrix.reference_output Thu Jan 25 21:10:17 2007 @@ -1,9 +1,9 @@ -get_gcd(50088, 48396) = 12 -get_gcd(-30896, -34280) = -8 -get_gcd(19192, 14116) = 4 -get_gcd(62512, 55744) = 16 -get_gcd(60148, -11704) = -44 -get_gcd(38384, 28232) = 8 -get_gcd(64784, 52940) = 4 -get_gcd(57344, 43808) = 32 +get_gcd(443304, 441612) = 1692 +get_gcd(886608, 883224) = 3384 +get_gcd(1329912, 1324836) = 5076 +get_gcd(1773216, 1766448) = 6768 +get_gcd(2216520, 2208060) = 8460 +get_gcd(2659824, 2649672) = 10152 +get_gcd(3103128, 3091284) = 11844 +get_gcd(3546432, 3532896) = 13536 exit 0 From reid at x10sys.com Fri Jan 26 00:30:50 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 26 Jan 2007 00:30:50 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200701260630.l0Q6Uomk020478@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.65 -> 1.66 --- Log message: Fix an assertion message. --- Diffs of the changes: (+1 -1) Instructions.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.65 llvm/lib/VMCore/Instructions.cpp:1.66 --- llvm/lib/VMCore/Instructions.cpp:1.65 Sat Jan 20 18:29:26 2007 +++ llvm/lib/VMCore/Instructions.cpp Fri Jan 26 00:30:34 2007 @@ -518,7 +518,7 @@ assert(!isa(Amt) && "Passed basic block into allocation size parameter! Ue other ctor"); assert(Amt->getType() == Type::Int32Ty && - "Malloc/Allocation array size != UIntTy!"); + "Malloc/Allocation array size is not a 32-bit integer!"); } return Amt; } From reid at x10sys.com Fri Jan 26 01:37:50 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 26 Jan 2007 01:37:50 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200701260737.l0Q7boMw021588@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.204 -> 1.205 --- Log message: Clean up comments and assert messages that still refer to the old type names. --- Diffs of the changes: (+12 -12) Constants.cpp | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.204 llvm/lib/VMCore/Constants.cpp:1.205 --- llvm/lib/VMCore/Constants.cpp:1.204 Sat Jan 20 20:29:10 2007 +++ llvm/lib/VMCore/Constants.cpp Fri Jan 26 01:37:34 2007 @@ -1004,10 +1004,10 @@ return ConstantArray::get(ATy, ElementVals); } -/// isString - This method returns true if the array is an array of sbyte or -/// ubyte, and if the elements of the array are all ConstantInt's. +/// isString - This method returns true if the array is an array of i8, and +/// if the elements of the array are all ConstantInt's. bool ConstantArray::isString() const { - // Check the element type for sbyte or ubyte... + // Check the element type for i8... if (getType()->getElementType() != Type::Int8Ty) return false; // Check the elements to make sure they are all integers, not constant @@ -1022,7 +1022,7 @@ /// isString) and it ends in a null byte \0 and does not contains any other /// null bytes except its terminator. bool ConstantArray::isCString() const { - // Check the element type for sbyte or ubyte... + // Check the element type for i8... if (getType()->getElementType() != Type::Int8Ty) return false; Constant *Zero = Constant::getNullValue(getOperand(0)->getType()); @@ -1040,7 +1040,7 @@ } -// getAsString - If the sub-element type of this array is either sbyte or ubyte, +// getAsString - If the sub-element type of this array is i8 // then this method converts the array to an std::string and returns it. // Otherwise, it asserts out. // @@ -1536,7 +1536,7 @@ Constant *ConstantExpr::getUIToFP(Constant *C, const Type *Ty) { assert(C->getType()->isInteger() && Ty->isFloatingPoint() && - "This is an illegal uint to floating point cast!"); + "This is an illegal i32 to floating point cast!"); return getFoldedCast(Instruction::UIToFP, C, Ty); } @@ -1548,13 +1548,13 @@ Constant *ConstantExpr::getFPToUI(Constant *C, const Type *Ty) { assert(C->getType()->isFloatingPoint() && Ty->isInteger() && - "This is an illegal floating point to uint cast!"); + "This is an illegal floating point to i32 cast!"); return getFoldedCast(Instruction::FPToUI, C, Ty); } Constant *ConstantExpr::getFPToSI(Constant *C, const Type *Ty) { assert(C->getType()->isFloatingPoint() && Ty->isInteger() && - "This is an illegal floating point to sint cast!"); + "This is an illegal floating point to i32 cast!"); return getFoldedCast(Instruction::FPToSI, C, Ty); } @@ -1688,7 +1688,7 @@ case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: - assert(C2->getType() == Type::Int8Ty && "Shift should be by ubyte!"); + assert(C2->getType() == Type::Int8Ty && "Shift should be by i8!"); assert(C1->getType()->isInteger() && "Tried to create a shift operation on a non-integer type!"); break; @@ -1708,7 +1708,7 @@ Constant *ConstantExpr::getSelectTy(const Type *ReqTy, Constant *C, Constant *V1, Constant *V2) { - assert(C->getType() == Type::Int1Ty && "Select condition must be bool!"); + assert(C->getType() == Type::Int1Ty && "Select condition must be i1!"); assert(V1->getType() == V2->getType() && "Select value types must match!"); assert(V1->getType()->isFirstClassType() && "Cannot select aggregate type!"); @@ -1833,7 +1833,7 @@ assert(isa(Val->getType()) && "Tried to create extractelement operation on non-packed type!"); assert(Idx->getType() == Type::Int32Ty && - "Extractelement index must be uint type!"); + "Extractelement index must be i32 type!"); return getExtractElementTy(cast(Val->getType())->getElementType(), Val, Idx); } @@ -1857,7 +1857,7 @@ assert(Elt->getType() == cast(Val->getType())->getElementType() && "Insertelement types must match!"); assert(Idx->getType() == Type::Int32Ty && - "Insertelement index must be uint type!"); + "Insertelement index must be i32 type!"); return getInsertElementTy(cast(Val->getType())->getElementType(), Val, Elt, Idx); } From reid at x10sys.com Fri Jan 26 01:51:52 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 26 Jan 2007 01:51:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200701260751.l0Q7pq1h022091@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.165 -> 1.166 --- Log message: IntegerType is a sized DerivedType too. --- Diffs of the changes: (+3 -0) Type.cpp | 3 +++ 1 files changed, 3 insertions(+) Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.165 llvm/lib/VMCore/Type.cpp:1.166 --- llvm/lib/VMCore/Type.cpp:1.165 Fri Jan 19 15:25:12 2007 +++ llvm/lib/VMCore/Type.cpp Fri Jan 26 01:51:36 2007 @@ -139,6 +139,9 @@ /// iff all of the members of the type are sized as well. Since asking for /// their size is relatively uncommon, move this operation out of line. bool Type::isSizedDerivedType() const { + if (isa(this)) + return true; + if (const ArrayType *ATy = dyn_cast(this)) return ATy->getElementType()->isSized(); From reid at x10sys.com Fri Jan 26 02:01:48 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 26 Jan 2007 02:01:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Message-ID: <200701260801.l0Q81mg6022269@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.109 -> 1.110 --- Log message: For PR645: http://llvm.org/PR645 : Remove the Function::renameLocalSymbols function as it is no longer needed. --- Diffs of the changes: (+0 -39) Function.cpp | 39 --------------------------------------- 1 files changed, 39 deletions(-) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.109 llvm/lib/VMCore/Function.cpp:1.110 --- llvm/lib/VMCore/Function.cpp:1.109 Sat Jan 6 01:24:44 2007 +++ llvm/lib/VMCore/Function.cpp Fri Jan 26 02:01:30 2007 @@ -139,45 +139,6 @@ } -/// renameLocalSymbols - This method goes through the Function's symbol table -/// and renames any symbols that conflict with symbols at global scope. This is -/// required before printing out to a textual form, to ensure that there is no -/// ambiguity when parsing. -void Function::renameLocalSymbols() { - SymbolTable &LST = getValueSymbolTable(); // Local Symtab - SymbolTable &GST = getParent()->getValueSymbolTable(); // Global Symtab - - for (SymbolTable::plane_iterator LPI = LST.plane_begin(), E = LST.plane_end(); - LPI != E; ++LPI) - // All global symbols are of pointer type, ignore any non-pointer planes. - if (isa(LPI->first)) { - // Only check if the global plane has any symbols of this type. - SymbolTable::plane_iterator GPI = GST.find(LPI->first); - if (GPI != GST.plane_end()) { - SymbolTable::ValueMap &LVM = LPI->second; - const SymbolTable::ValueMap &GVM = GPI->second; - - // Loop over all local symbols, renaming those that are in the global - // symbol table already. - for (SymbolTable::value_iterator VI = LVM.begin(), E = LVM.end(); - VI != E;) { - Value *V = VI->second; - const std::string &Name = VI->first; - ++VI; - if (GVM.count(Name)) { - static unsigned UniqueNum = 0; - // Find a name that does not conflict! - while (GVM.count(Name + "_" + utostr(++UniqueNum)) || - LVM.count(Name + "_" + utostr(UniqueNum))) - /* scan for UniqueNum that works */; - V->setName(Name + "_" + utostr(UniqueNum)); - } - } - } - } -} - - // dropAllReferences() - This function causes all the subinstructions to "let // go" of all references that they are maintaining. This allows one to // 'delete' a whole class at a time, even though there may be circular From reid at x10sys.com Fri Jan 26 02:01:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 26 Jan 2007 02:01:49 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Function.h Message-ID: <200701260801.l0Q81nu1022276@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Function.h updated: 1.69 -> 1.70 --- Log message: For PR645: http://llvm.org/PR645 : Remove the Function::renameLocalSymbols function as it is no longer needed. --- Diffs of the changes: (+0 -7) Function.h | 7 ------- 1 files changed, 7 deletions(-) Index: llvm/include/llvm/Function.h diff -u llvm/include/llvm/Function.h:1.69 llvm/include/llvm/Function.h:1.70 --- llvm/include/llvm/Function.h:1.69 Sat Jan 6 01:24:43 2007 +++ llvm/include/llvm/Function.h Fri Jan 26 02:01:30 2007 @@ -111,13 +111,6 @@ unsigned getCallingConv() const { return CallingConvention; } void setCallingConv(unsigned CC) { CallingConvention = CC; } - /// renameLocalSymbols - This method goes through the Function's symbol table - /// and renames any symbols that conflict with symbols at global scope. This - /// is required before printing out to a textual form, to ensure that there is - /// no ambiguity when parsing. - void renameLocalSymbols(); - - /// deleteBody - This method deletes the body of the function, and converts /// the linkage to external. /// From reid at x10sys.com Fri Jan 26 02:01:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 26 Jan 2007 02:01:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp Message-ID: <200701260801.l0Q81nke022274@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.319 -> 1.320 --- Log message: For PR645: http://llvm.org/PR645 : Remove the Function::renameLocalSymbols function as it is no longer needed. --- Diffs of the changes: (+0 -3) CBackend.cpp | 3 --- 1 files changed, 3 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.319 llvm/lib/Target/CBackend/CBackend.cpp:1.320 --- llvm/lib/Target/CBackend/CBackend.cpp:1.319 Tue Jan 16 12:02:45 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Fri Jan 26 02:01:30 2007 @@ -99,9 +99,6 @@ // Output all floating point constants that cannot be printed accurately. printFloatingPointConstants(F); - // Ensure that no local symbols conflict with global symbols. - F.renameLocalSymbols(); - printFunction(F); FPConstantMap.clear(); return false; From reid at x10sys.com Fri Jan 26 02:03:07 2007 From: reid at x10sys.com (Reid Spencer) Date: Fri, 26 Jan 2007 02:03:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp Message-ID: <200701260803.l0Q837nf022310@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: AsmWriter.cpp updated: 1.254 -> 1.255 --- Log message: For PR645: http://llvm.org/PR645 : Implement new syntax for local and global symbols. Types and local symbols use the % prefix. Global variables and functions use the @ prefix. --- Diffs of the changes: (+53 -93) AsmWriter.cpp | 146 +++++++++++++++++++++------------------------------------- 1 files changed, 53 insertions(+), 93 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.254 llvm/lib/VMCore/AsmWriter.cpp:1.255 --- llvm/lib/VMCore/AsmWriter.cpp:1.254 Mon Jan 15 12:28:18 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Fri Jan 26 02:02:52 2007 @@ -179,31 +179,47 @@ return 0; } -// getLLVMName - Turn the specified string into an 'LLVM name', which is either -// prefixed with % (if the string only contains simple characters) or is -// surrounded with ""'s (if it has special chars in it). -static std::string getLLVMName(const std::string &Name, - bool prefixName = true) { - assert(!Name.empty() && "Cannot get empty name!"); - - // First character cannot start with a number... - if (Name[0] >= '0' && Name[0] <= '9') - return "\"" + Name + "\""; - +/// NameNeedsQuotes - Return true if the specified llvm name should be wrapped +/// with ""'s. +static bool NameNeedsQuotes(const std::string &Name) { + if (Name[0] >= '0' && Name[0] <= '9') return true; // Scan to see if we have any characters that are not on the "white list" for (unsigned i = 0, e = Name.size(); i != e; ++i) { char C = Name[i]; assert(C != '"' && "Illegal character in LLVM value name!"); if ((C < 'a' || C > 'z') && (C < 'A' || C > 'Z') && (C < '0' || C > '9') && C != '-' && C != '.' && C != '_') - return "\"" + Name + "\""; + return true; + } + return false; +} + +enum PrefixType { + GlobalPrefix, + LabelPrefix, + LocalPrefix +}; + +/// getLLVMName - Turn the specified string into an 'LLVM name', which is either +/// prefixed with % (if the string only contains simple characters) or is +/// surrounded with ""'s (if it has special chars in it). +static std::string getLLVMName(const std::string &Name, PrefixType Prefix) { + assert(!Name.empty() && "Cannot get empty name!"); + + // First character cannot start with a number... + if (NameNeedsQuotes(Name)) { + if (Prefix == GlobalPrefix) + return "@\"" + Name + "\""; + return "\"" + Name + "\""; } // If we get here, then the identifier is legal to use as a "VarID". - if (prefixName) - return "%"+Name; - else - return Name; + switch (Prefix) { + default: assert(0 && "Bad prefix!"); + case GlobalPrefix: return '@' + Name; + case LabelPrefix: return Name; + case LocalPrefix: return '%' + Name; + } } @@ -224,7 +240,7 @@ !cast(Ty)->getElementType()->isPrimitiveType() || !cast(Ty)->getElementType()->isInteger() || isa(cast(Ty)->getElementType())) - TypeNames.insert(std::make_pair(Ty, getLLVMName(TI->first))); + TypeNames.insert(std::make_pair(Ty, getLLVMName(TI->first, LocalPrefix))); } } @@ -587,7 +603,8 @@ SlotMachine *Machine) { Out << ' '; if (V->hasName()) - Out << getLLVMName(V->getName()); + Out << getLLVMName(V->getName(), + isa(V) ? GlobalPrefix : LocalPrefix); else { const Constant *CV = dyn_cast(V); if (CV && !isa(CV)) { @@ -602,26 +619,31 @@ PrintEscapedString(IA->getConstraintString(), Out); Out << '"'; } else { + char Prefix = '%'; int Slot; if (Machine) { - if (const GlobalValue *GV = dyn_cast(V)) + if (const GlobalValue *GV = dyn_cast(V)) { Slot = Machine->getGlobalSlot(GV); - else + Prefix = '@'; + } else { Slot = Machine->getLocalSlot(V); + } } else { Machine = createSlotMachine(V); if (Machine) { - if (const GlobalValue *GV = dyn_cast(V)) + if (const GlobalValue *GV = dyn_cast(V)) { Slot = Machine->getGlobalSlot(GV); - else + Prefix = '@'; + } else { Slot = Machine->getLocalSlot(V); + } } else { Slot = -1; } delete Machine; } if (Slot != -1) - Out << '%' << Slot; + Out << Prefix << Slot; else Out << ""; } @@ -672,7 +694,6 @@ inline void write(const Function *F) { printFunction(F); } inline void write(const BasicBlock *BB) { printBasicBlock(BB); } inline void write(const Instruction *I) { printInstruction(*I); } - inline void write(const Constant *CPV) { printConstant(CPV); } inline void write(const Type *Ty) { printType(Ty); } void writeOperand(const Value *Op, bool PrintType); @@ -682,8 +703,6 @@ private: void printModule(const Module *M); void printTypeSymbolTable(const TypeSymbolTable &ST); - void printValueSymbolTable(const SymbolTable &ST); - void printConstant(const Constant *CPV); void printGlobal(const GlobalVariable *GV); void printFunction(const Function *F); void printArgument(const Argument *FA, FunctionType::ParameterAttributes A); @@ -787,17 +806,6 @@ if (!M->getDataLayout().empty()) Out << "target datalayout = \"" << M->getDataLayout() << "\"\n"; - - switch (M->getEndianness()) { - case Module::LittleEndian: Out << "target endian = little\n"; break; - case Module::BigEndian: Out << "target endian = big\n"; break; - case Module::AnyEndianness: break; - } - switch (M->getPointerSize()) { - case Module::Pointer32: Out << "target pointersize = 32\n"; break; - case Module::Pointer64: Out << "target pointersize = 64\n"; break; - case Module::AnyPointerSize: break; - } if (!M->getTargetTriple().empty()) Out << "target triple = \"" << M->getTargetTriple() << "\"\n"; @@ -837,7 +845,6 @@ // Loop over the symbol table, emitting all named constants. printTypeSymbolTable(M->getTypeSymbolTable()); - printValueSymbolTable(M->getValueSymbolTable()); for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) @@ -851,7 +858,7 @@ } void AssemblyWriter::printGlobal(const GlobalVariable *GV) { - if (GV->hasName()) Out << getLLVMName(GV->getName()) << " = "; + if (GV->hasName()) Out << getLLVMName(GV->getName(), GlobalPrefix) << " = "; if (!GV->hasInitializer()) switch (GV->getLinkage()) { @@ -901,7 +908,7 @@ // Print the types. for (TypeSymbolTable::const_iterator TI = ST.begin(), TE = ST.end(); TI != TE; ++TI) { - Out << "\t" << getLLVMName(TI->first) << " = type "; + Out << "\t" << getLLVMName(TI->first, LocalPrefix) << " = type "; // Make sure we print out at least one level of the type structure, so // that we do not get %FILE = type %FILE @@ -910,52 +917,12 @@ } } -// printSymbolTable - Run through symbol table looking for constants -// and types. Emit their declarations. -void AssemblyWriter::printValueSymbolTable(const SymbolTable &ST) { - - // Print the constants, in type plane order. - for (SymbolTable::plane_const_iterator PI = ST.plane_begin(); - PI != ST.plane_end(); ++PI) { - SymbolTable::value_const_iterator VI = ST.value_begin(PI->first); - SymbolTable::value_const_iterator VE = ST.value_end(PI->first); - - for (; VI != VE; ++VI) { - const Value* V = VI->second; - const Constant *CPV = dyn_cast(V) ; - if (CPV && !isa(V)) { - printConstant(CPV); - } - } - } -} - - -/// printConstant - Print out a constant pool entry... -/// -void AssemblyWriter::printConstant(const Constant *CPV) { - // Don't print out unnamed constants, they will be inlined - if (!CPV->hasName()) return; - - // Print out name... - Out << "\t" << getLLVMName(CPV->getName()) << " ="; - - // Write the value out now. - writeOperand(CPV, true); - - printInfoComment(*CPV); - Out << "\n"; -} - /// printFunction - Print all aspects of a function. /// void AssemblyWriter::printFunction(const Function *F) { // Print out the return type and name... Out << "\n"; - // Ensure that no local symbols conflict with global symbols. - const_cast(F)->renameLocalSymbols(); - if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out); if (F->isExternal()) @@ -1000,9 +967,9 @@ const FunctionType *FT = F->getFunctionType(); printType(F->getReturnType()) << ' '; if (!F->getName().empty()) - Out << getLLVMName(F->getName()); + Out << getLLVMName(F->getName(), GlobalPrefix); else - Out << "\"\""; + Out << "@\"\""; Out << '('; Machine.incorporateFunction(F); @@ -1058,14 +1025,14 @@ // Output name, if available... if (Arg->hasName()) - Out << ' ' << getLLVMName(Arg->getName()); + Out << ' ' << getLLVMName(Arg->getName(), LocalPrefix); } /// printBasicBlock - This member is called for each basic block in a method. /// void AssemblyWriter::printBasicBlock(const BasicBlock *BB) { if (BB->hasName()) { // Print out the label if it exists... - Out << "\n" << getLLVMName(BB->getName(), false) << ':'; + Out << "\n" << getLLVMName(BB->getName(), LabelPrefix) << ':'; } else if (!BB->use_empty()) { // Don't print block # of no uses... Out << "\n;