[llvm-commits] CVS: llvm/lib/CodeGen/PrologEpilogInserter.cpp
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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp
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.56Mon 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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp
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.39Mon 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); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/IA64/IA64RegisterInfo.cpp
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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp
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().getSubtargetX86Subtarget(); 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()) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/Disassembler.cpp
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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/System/Disassembler.h
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 string + + 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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp
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 algorithm @@ -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; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/System/Disassembler.cpp
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.cppTue 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 cassert + #include iomanip + #include string + #include sstream + + #if USE_UDIS86 + #include udis86.h + #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(); + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Support/Disassembler.h
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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] llvm-gcc4: gimplifier fixes
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!' f! ailed. 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 ; i32** [#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. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] llvm-gcc4: use langhooks rather than front-end calls in i386.c
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@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits smime.p7s Description: S/MIME cryptographic signature ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/GettingStarted.html LangRef.html ReleaseNotes.html
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./dd + dti--with-udis86/i/dt + ddLLVM 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 a href=http://udis86.sourceforge.net/;udis86/a x86 (both 32 and 64 + bits) disassembler library./dd /dl pTo configure LLVM, follow these steps:/p @@ -1626,7 +1631,7 @@ a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.x10sys.com/rspencer/;Reid Spencer/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/01/04 07:08:27 $ + Last modified: $Date: 2007/01/23 12:35:46 $ /address /body /html Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.202 llvm/docs/LangRef.html:1.203 --- llvm/docs/LangRef.html:1.202Sat Jan 20 18:29:25 2007 +++ llvm/docs/LangRef.html Tue Jan 23 06:35:46 2007 @@ -580,6 +580,40 @@ !-- === -- div class=doc_subsection + a name=visibilityVisibility Styles/a +/div + +div class=doc_text + +p +All Global Variables and Functions have one of the following visibility styles: +/p + +dl + dtbttdefault/tt - Default style/b:/dt + + ddOn 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. + /dd + + dtbtthidden/tt - Hidden style/b:/dt + + ddTwo 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. + /dd + +/dl + +/div + +!-- === -- +div class=doc_subsection a name=globalvarsGlobal Variables/a /div @@ -638,14 +672,18 @@ pLLVM function definitions consist of the ttdefine/tt keyord, an optional a href=#linkagelinkage type/a, an optional +a href=#visibilityvisibility style/a, an optional a href=#callingconvcalling convention/a, a return type, an optional a href=#paramattrsparameter attribute/a for the return type, a function name, a (possibly empty) argument list (each with optional -a href=#paramattrsparameter attributes/a), 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 ttdeclare/tt keyword, an optional a - href=#callingconvcalling convention/a, a return type, an optional +a href=#paramattrsparameter attributes/a), 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 ttdeclare/tt keyword, an +optional a href=#linkagelinkage type/a, an optional +a href=#visibilityvisibility style/a, an optional +a href=#callingconvcalling convention/a, a return type, an optional a href=#paramattrsparameter attribute/a for the return type, a function name, a possibly empty list of arguments, and an optional alignment./p @@ -4481,7 +4519,7 @@ a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/01/21 00:29:25 $ + Last modified: $Date: 2007/01/23 12:35:46 $ /address /body /html 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 @@ bSupported:/b ttconstructor/tt, ttdestructor/tt, ttdeprecated/tt, ttfastcall/tt,
[llvm-commits] CVS: llvm/docs/BytecodeFormat.html
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=DllExportsup1/sup/td /tr tr - tda href=#bitbit(16-31)/a/td + tda href=#bitbit(16-18)/a/td td class=td_leftVisibility style: 0=Default, 1=Hidden./td /tr +tr + tda href=#bitbit(19-31)/a/td + td class=td_leftCurrently unassigned./td +/tr /tbody /table @@ -2213,7 +2217,7 @@ a href=mailto:[EMAIL PROTECTED]Reid Spencer/a and a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr -Last modified: $Date: 2007/01/12 19:20:46 $ +Last modified: $Date: 2007/01/23 12:43:53 $ /address /body /html ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CFrontend/cast-to-bool.c
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) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] llvm-gcc4: implement FLOOR_MOD_EXPR and ROUND_DIV_EXPR
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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] llvm-gcc4: gimplifier fixes
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___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
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.6Fri Jan 19 13:23:47 2007 +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cppTue 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; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CallGraphSCCPass.h
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.7Thu Apr 21 15:11:51 2005 +++ llvm/include/llvm/CallGraphSCCPass.hTue 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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
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_castCGPassManager *(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_castPass *(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. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/ARM/ldr_ext.ll
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.1Fri Jan 19 03:20:23 2007 +++ llvm/test/CodeGen/ARM/ldr_ext.llTue 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 } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/WritingAnLLVMPass.html
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.htmlTue Jan 23 16:56:28 2007 @@ -29,10 +29,10 @@ /ul/li lia href=#CallGraphSCCPassThe ttCallGraphSCCPass/tt class/a ul -lia href=#doInitialization_sccThe ttdoInitialization(Module +lia href=#doInitialization_sccThe ttdoInitialization(CallGraph amp;)/tt method/a/li lia href=#runOnSCCThe ttrunOnSCC/tt method/a/li -lia href=#doFinalization_sccThe ttdoFinalization(Module +lia href=#doFinalization_sccThe ttdoFinalization(CallGraph amp;)/tt method/a/li /ul/li lia href=#FunctionPassThe ttFunctionPass/tt class/a @@ -534,14 +534,14 @@ !-- ___ -- div class=doc_subsubsection - a name=doInitialization_sccThe ttdoInitialization(Module amp;)/tt + a name=doInitialization_sccThe ttdoInitialization(CallGraph amp;)/tt method/a /div div class=doc_text div class=doc_codepre - bvirtual bool/b doInitialization(Module amp;M); + bvirtual bool/b doInitialization(CallGraph amp;CG); /pre/div pThe ttdoIninitialize/tt method is allowed to do most of the things that @@ -573,14 +573,14 @@ !-- ___ -- div class=doc_subsubsection - a name=doFinalization_sccThe ttdoFinalization(Module + a name=doFinalization_sccThe ttdoFinalization(CallGraph amp;)/tt method/a /div div class=doc_text div class=doc_codepre - bvirtual bool/b doFinalization(Module amp;M); + bvirtual bool/b doFinalization(CallGraph amp;CG); /pre/div pThe ttdoFinalization/tt method is an infrequently used method that is @@ -1711,7 +1711,7 @@ a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr a href=http://llvm.org;The LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/12/07 20:04:41 $ + Last modified: $Date: 2007/01/23 22:56:28 $ /address /body ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMISelDAGToDAG.cpp ARMInstrThumb.td
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.99Fri 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,
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
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 = castFrameIndexSDNode(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_castConstantSDNode(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 = castFrameIndexSDNode(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
[llvm-commits] CVS: llvm/test/CodeGen/ARM/ldr_frame.ll
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 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
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_castConstantSDNode(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 = castFrameIndexSDNode(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_castConstantSDNode(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 = castFrameIndexSDNode(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 = castFrameIndexSDNode(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; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetMachOWriterInfo.cpp
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); + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetMachOWriterInfo.h
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.hTue 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 | 0x100) + #endif + #if !defined(CPU_TYPE_ARM) + #define CPU_TYPE_ARM12 + #endif + #if !defined(CPU_TYPE_SPARC) + #define CPU_TYPE_SPARC 14 + #endif + #if !defined(CPU_TYPE_POWERPC) + #define CPU_TYPE_POWERPC18 + #endif + #if !defined(CPU_TYPE_POWERPC64) + #define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | 0x100) + #endif + + // Constants for the cputype field + // see mach/machine.h + 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_ALL3 + #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 mach/machine.h + 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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h
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.14Wed 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 | 0x100) -#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 | 0x100) -#endif - - // Constants for the cputype field - // see mach/machine.h - 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_ALL0 -#endif -#if !defined(CPU_SUBTYPE_SPARC_ALL) -#define CPU_SUBTYPE_SPARC_ALL 0 -#endif -#if !defined(CPU_SUBTYPE_POWERPC_ALL) -#define CPU_SUBTYPE_POWERPC_ALL0 - -#endif - // Constants for the cpusubtype field - // see mach/machine.h - 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 mach-o/loader.h 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; }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetMachine.h
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.hTue 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(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.cpp
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.cppTue 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); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCMachOWriter.cpp
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 mach-o/ppc/reloc.h @@ -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); -} - ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp PPCTargetMachine.h
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.cppTue 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); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/Xcode/LLVM.xcodeproj/project.pbxproj
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 = group; }; + 84115FFF0B66D89B00E1293E /* PPCMachOWriterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PPCMachOWriterInfo.cpp; sourceTree = group; }; + 84116B66D8AC00E1293E /* PPCMachOWriterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCMachOWriterInfo.h; sourceTree = group; }; + 8443EF210B66B62D00959964 /* TargetMachOWriterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TargetMachOWriterInfo.h; sourceTree = group; }; CF1ACC9709C9DE4400D3C5EB /* IntrinsicInst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IntrinsicInst.cpp; path = ../lib/VMCore/IntrinsicInst.cpp; sourceTree = group; }; CF26835B09178F5500C5F253 /* TargetInstrItineraries.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetInstrItineraries.h; sourceTree = group; }; CF32AF5C0AEE6A4E00D24CD4 /* LLVMTargetMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LLVMTargetMachine.cpp; sourceTree = group; }; @@ -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 = ( + 84116B66D8AC00E1293E /* 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 */, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/www-index.html
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 a href=docs/CommandGuide/html/llvmgcc.htmlC amp; C++ front-end/a, 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. /p/li +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. /p/li lipLLVM does inot/i imply things that you would expect from a high-level virtual machine. It does not require garbage collection or ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/OpenProjects.html
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./li liWrite a new backend for a target -(a href=docs/CompilerWriterInfo.html#armARM/a? - a href=docs/CompilerWriterInfo.html#mipsMIPS/a? +(a href=docs/CompilerWriterInfo.html#mipsMIPS/a? a href=http://www-cs-faculty.stanford.edu/~knuth/mmix.html;MMIX/a?)/li /ol @@ -374,7 +373,7 @@ src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a a href=http://llvm.org;LLVM Compiler Infrastructure/abr - Last modified: $Date: 2006/07/19 17:53:23 $ + Last modified: $Date: 2007/01/24 05:27:16 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/OpenProjects.html
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 @@ div class=www_text ol -liRework the PassManager to be more flexible/li liSome 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!/a a href=http://llvm.org;LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/01/24 05:27:16 $ + Last modified: $Date: 2007/01/24 05:28:10 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetData.cpp
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()); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/IA64/IA64AsmPrinter.cpp
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.41Tue 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() || ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h
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. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp
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() ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
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); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/MachOWriter.cpp
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.cppWed 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); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachOWriter.h
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.15Tue 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::vectorunsigned char DataBuffer; - protected: MachOWriter(std::ostream O, TargetMachine TM); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h
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.1Tue Jan 23 21:36:05 2007 +++ llvm/lib/Target/PowerPC/PPCMachOWriterInfo.hWed 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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetMachOWriterInfo.h
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.1Tue Jan 23 21:36:05 2007 +++ llvm/include/llvm/Target/TargetMachOWriterInfo.hWed 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 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits