[LLVMbugs] [Bug 4081] New: RFE: data component of initialized global variables should come last

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Apr 26 10:44:49 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4081

           Summary: RFE: data component of initialized global variables
                    should come last
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM assembly language parser
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jgarzik at pobox.com
                CC: llvmbugs at cs.uiuc.edu


In the Linux kernel, we have a few cases where a global variable in C stores
data at compile time in a _huge_ char[] array.  An example would be where a
device firmware is compiled into the device driver, rather than being shipped
as a separate file.

As such, LLVM assembly becomes inconvent with large initialized globals,
because the 'align' attribute currently follows the initialized data:

@myarray = global [6 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50, i32 69],
align 4

Large initializers can easily push the 'align 4' far, far away from the
"@myvariable" definition.  This makes life difficult for some code generators,
and also makes human review of LLVM assembly more difficult.

My suggestion is to reorder variable definitions such that initialized data
always comes last (implying movement of current 'align').


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list