summaryrefslogtreecommitdiff
path: root/lib/IR/DataLayout.cpp
Commit message (Collapse)AuthorAge
* Fix uninitialized warning in llvm/lib/IR/DataLayout.cpp.Cameron McInally2014-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199147 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'w' instead of 'c' to represent the win32 mangling.Rafael Espindola2014-01-10
| | | | | | | This change was requested to avoid confusion if we ever support non windows coff systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198938 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix uninitialized variable warning in DataLayout.Cameron McInally2014-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198702 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve documentation of the 'a' specifier and the '<abi>:<pref>' align pair.Rafael Espindola2014-01-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198636 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the llvm mangler depend only on DataLayout.Rafael Espindola2014-01-03
| | | | | | | | | | | | | | Before this patch any program that wanted to know the final symbol name of a GlobalValue had to link with Target. This patch implements a compromise solution where the mangler uses DataLayout. This way, any tool that already links with Target (llc, clang) gets the exact behavior as before and new IR files can be mangled without linking with Target. With this patch the mangler is constructed with just a DataLayout and DataLayout is extended to include the information the Mangler needs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198438 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the 's' DataLayout specificationRafael Espindola2014-01-01
| | | | | | | | | | | | | | | | | | | | | | | During the years there have been some attempts at figuring out how to align byval arguments. A look at the commit log suggests that they were * Use the ABI alignment. * When that was not sufficient for x86-64, I added the 's' specification to DataLayout. * When that was not sufficient Evan added the virtual getByValTypeAlignment. * When even that was not sufficient, we just got the FE to add the alignment to the byval. This patch is just a simple cleanup that removes my first attempt at fixing the problem. I also added an AArch64 implementation of getByValTypeAlignment to make sure this patch is a nop. I also left the 's' parsing for backward compatibility. I will send a short email to llvmdev about the change for anyone maintaining an out of tree target. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198287 91177308-0d34-0410-b5e6-96231b3b80d8
* Make this array const.Rafael Espindola2013-12-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197814 91177308-0d34-0410-b5e6-96231b3b80d8
* Change getStringRepresentation to skip defaults.Rafael Espindola2013-12-19
| | | | | | | | | | I have a pending change for clang to use getStringRepresentation to check that its DataLayout is in sync with llvm's. getStringRepresentation is not called from llvm itself, so far it is mostly a debugging aid, so the shorter strings are an independent improvement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197740 91177308-0d34-0410-b5e6-96231b3b80d8
* Pointer sizes are stored in Bytes. Fix variables names to say so.Rafael Espindola2013-12-13
| | | | | | Also update for the current naming style. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197283 91177308-0d34-0410-b5e6-96231b3b80d8
* DataLayout: value initialize globals to avoid static construction.Benjamin Kramer2013-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195150 91177308-0d34-0410-b5e6-96231b3b80d8
* MemCpyOptimizer: Use max legal int size instead of pointer sizeMatt Arsenault2013-09-16
| | | | | | | | | | | | If there are no legal integers, assume 1 byte. This makes more sense than using the pointer size as a guess for the maximum GPR width. It is conceivable to want to use some 64-bit pointers on a target where 64-bit integers aren't legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190817 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor code simplification suggested by DuncanMatt Arsenault2013-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187309 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-add DataLayout pointer size convenience functions.Matt Arsenault2013-07-26
| | | | | | | | These were reverted in r167222 along with the rest of the last different address space pointer size attempt. These will be used in later commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187223 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-04
| | | | | | specifying the vector size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185606 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix extra whitespace / formattingMatt Arsenault2013-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185238 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove duplicated commentMatt Arsenault2013-05-18
| | | | | | The same comment is already made in the header git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182181 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup naming: DataLayout s/TD/DL/Eli Bendersky2013-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179601 91177308-0d34-0410-b5e6-96231b3b80d8
* InstCombine: Improve the result bitvect type when folding (cmp pred (load ↵Arnaud A. de Grandmaison2013-03-22
| | | | | | | | | | | | | | | (gep GV, i)) C) to a bit test. The original code used i32, and i64 if legal. This introduced unneeded casts when they aren't legal, or when the index variable i has another type. In order of preference: try to use i's type; use the smallest fitting legal type (using an added DataLayout method); default to i32. A testcase checks that this works when the index gep operand is i16. Patch by : Ahmed Bougacha <ahmed.bougacha@gmail.com> Reviewed by : Duncan git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177712 91177308-0d34-0410-b5e6-96231b3b80d8
* Hoist the definition of getTypeSizeInBits to be inlinable and in theChandler Carruth2013-03-21
| | | | | | | | | | | | | | | | | | header. This method is called in the hot path for *many* passes, SROA is what caught my interest. A common pattern is that which branch of the switch should be taken is known in the callsite and so it is a very good candidate for inlining and simplification. Moving it into the header allows the optimizer to fold a lot of boring, repeatitive code in callers of this routine. I'm seeing pretty significant speedups in parts of SROA and I suspect other passes will see similar speedups if they end up working with type sizes frequently. I've not seen any significant growth of the binaries as a consequence, but let me know if you see anything suspicious here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177632 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a doFinalization method to the DataLayout pass.Pete Cooper2013-03-12
| | | | | | | | | | | | | | | | This pass is meant to be immutable, however it holds mutable state to cache StructLayouts. This method will allow the pass manager to clear the mutable state between runs. Note that unfortunately it is still necessary to have the destructor, even though it does the same thing as doFinalization. This is because most TargetMachines embed a DataLayout on which doFinalization isn't run as its never added to the pass manager. I also didn't think it was necessary to complication things with a deInit method for which doFinalization and ~DataLayout both call as there's only one field of mutable state. If we had more fields to finalize i'd have added this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176877 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up whitespace and indentation a bitEli Bendersky2013-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173960 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename VMCore directory to IR.Chandler Carruth2013-01-02
Aside from moving the actual files, this patch only updates the build system and the source file comments under lib/... that are relevant. I'll be updating other docs and other files in smaller subsequnet commits. While I've tried to test this, but it is entirely possible that there will still be some build system fallout. Also, note that I've not changed the library name itself: libLLVMCore.a is still the library name. I'd be interested in others' opinions about whether we should rename this as well (I think we should, just not sure what it might break) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171359 91177308-0d34-0410-b5e6-96231b3b80d8