llvm.org GIT mirror llvm / 6509f50
improve some of the documentation around target data layout strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141733 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 8 years ago
2 changed file(s) with 23 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
14051405 implemented in terms of 64 <2 x double>, for example.
14061406
14071407
1408

The function of the data layout string may not be what you expect. Notably,

1409 this is not a specification from the frontend of what alignment the code
1410 generator should use.

1411
1412

Instead, if specified, the target data layout is required to match what the

1413 ultimate code generator expects. This string is used by the
1414 mid-level optimizers to
1415 improve code, and this only works if it matches what the ultimate code
1416 generator uses. If you would like to generate IR that does not embed this
1417 target-specific detail into the IR, then you don't have to specify the
1418 string. This will disable some optimizations that require precise layout
1419 information, but this also prevents those optimizations from introducing
1420 target specificity into the IR.

1421
1422
1423
14081424
14091425
14101426
4343 AGGREGATE_ALIGN = 'a', ///< Aggregate alignment
4444 STACK_ALIGN = 's' ///< Stack objects alignment
4545 };
46
4647 /// Target alignment element.
4748 ///
4849 /// Stores the alignment data associated with a given alignment type (pointer,
6364 bool operator==(const TargetAlignElem &rhs) const;
6465 };
6566
67 /// TargetData - This class holds a parsed version of the target data layout
68 /// string in a module and provides methods for querying it. The target data
69 /// layout string is specified *by the target* - a frontend generating LLVM IR
70 /// is required to generate the right target data for the target being codegen'd
71 /// to. If some measure of portability is desired, an empty string may be
72 /// specified in the module.
6673 class TargetData : public ImmutablePass {
6774 private:
6875 bool LittleEndian; ///< Defaults to false