[LLVMbugs] [Bug 761] NEW: TargetData needs to be parameterized better in the .bc/.ll files
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Mon May 1 21:01:56 PDT 2006
http://llvm.org/bugs/show_bug.cgi?id=761
Summary: TargetData needs to be parameterized better in the
.bc/.ll files
Product: libraries
Version: 1.0
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P2
Component: Target Description Classes
AssignedTo: unassignedbugs at nondot.org
ReportedBy: sabre at nondot.org
Currently, when 'opt' is run, it configures and adds a TargetData to the pass manager based on the
settings of the "target" flags in the Module. These flags indicate whether the target is 32/64 bit, and
whether it is big or little endian.
This has two problems:
1. If the module has no target info, we default to SparcV9 (this is Bug 760).
2. Our mapping from ptrsize/endianness to a full targetdata is a total hack.
#2 is true because a TargetData has many more fields than just ptrsize and endianness, thus the
mapping from these two fields to a full TargetData is inherently a few-to-many mapping, which is
impossible to be right in the general case (we have it carefully rigged to work for our current targets
though).
Instead of encoding ptrsize/endianness into the module, it would be far better to encode a whole target
data into it. I propose that we do this defining a "default" target data, then encoding any diffs from this
into the module as a string. For example, if the default was a 64-bit, big endian, target with 8-byte
aligned doubles, a target like X86 could be described as "p3eLd4".
As TargetData is extended in the future, more letters could be gracefully added without breaking
old .bc files.
-Chris
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the llvm-bugs
mailing list