summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMConstantPoolValue.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove trailing spaceFangrui Song2018-07-301-1/+1
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338293
* [ARM] Fix some Clang-tidy modernize-use-using and Include What You Use ↵Eugene Zelenko2017-09-201-3/+7
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 313823
* ARM: track globals promoted to coalesced const pool entriesSaleem Abdulrasool2017-09-071-5/+7
| | | | | | | | | | | | | Globals that are promoted to an ARM constant pool may alias with another existing constant pool entry. We need to keep a reference to all globals that were promoted to each constant pool value so that we can emit a distinct label for each promoted global. These labels are necessary so that debug info can refer to the promoted global without an undefined reference during linking. Patch by Stephen Crane! llvm-svn: 312692
* [ARM] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-01-271-5/+11
| | | | | | minor fixes (NFC). llvm-svn: 293348
* Use StringRef in ARMConstantPool APIs (NFC)Mehdi Amini2016-10-051-5/+5
| | | | llvm-svn: 283293
* [ARM] Promote small global constants to constant poolsJames Molloy2016-09-261-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a constant is unamed_addr and is only used within one function, we can save on the code size and runtime cost of an indirection by changing the global's storage to inside the constant pool. For example, instead of: ldr r0, .CPI0 bl printf bx lr .CPI0: &format_string format_string: .asciz "hello, world!\n" We can emit: adr r0, .CPI0 bl printf bx lr .CPI0: .asciz "hello, world!\n" This can cause significant code size savings when many small strings are used in one function (4 bytes per string). This recommit contains fixes for a nasty bug related to fast-isel fallback - because fast-isel doesn't know about this optimization, if it runs and emits references to a string that we inline (because fast-isel fell back to SDAG) we will end up with an inlined string and also an out-of-line string, and we won't emit the out-of-line string, causing backend failures. It also contains fixes for emitting .text relocations which made the sanitizer bots unhappy. llvm-svn: 282387
* Revert "[ARM] Promote small global constants to constant pools"James Molloy2016-09-231-17/+3
| | | | | | This reverts commit r282241. It caused http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/19882. llvm-svn: 282249
* [ARM] Promote small global constants to constant poolsJames Molloy2016-09-231-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a constant is unamed_addr and is only used within one function, we can save on the code size and runtime cost of an indirection by changing the global's storage to inside the constant pool. For example, instead of: ldr r0, .CPI0 bl printf bx lr .CPI0: &format_string format_string: .asciz "hello, world!\n" We can emit: adr r0, .CPI0 bl printf bx lr .CPI0: .asciz "hello, world!\n" This can cause significant code size savings when many small strings are used in one function (4 bytes per string). This recommit contains fixes for a nasty bug related to fast-isel fallback - because fast-isel doesn't know about this optimization, if it runs and emits references to a string that we inline (because fast-isel fell back to SDAG) we will end up with an inlined string and also an out-of-line string, and we won't emit the out-of-line string, causing backend failures. It also contains fixes for emitting .text relocations which made the sanitizer bots unhappy. llvm-svn: 282241
* [ARM] Add support for embedded position-independent codeOliver Stannard2016-08-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for some new relocation models to the ARM backend: * Read-only position independence (ROPI): Code and read-only data is accessed PC-relative. The offsets between all code and RO data sections are known at static link time. This does not affect read-write data. * Read-write position independence (RWPI): Read-write data is accessed relative to the static base register (r9). The offsets between all writeable data sections are known at static link time. This does not affect read-only data. These two modes are independent (they specify how different objects should be addressed), so they can be used individually or together. They are otherwise the same as the "static" relocation model, and are not compatible with SysV-style PIC using a global offset table. These modes are normally used by bare-metal systems or systems with small real-time operating systems. They are designed to avoid the need for a dynamic linker, the only initialisation required is setting r9 to an appropriate value for RWPI code. I have only added support to SelectionDAG, not FastISel, because FastISel is currently disabled for bare-metal targets where these modes would be used. Differential Revision: https://reviews.llvm.org/D23195 llvm-svn: 278015
* ARM: correct TLS access on WoASaleem Abdulrasool2016-06-071-0/+1
| | | | | | | | | | | | TLS access requires an offset from the TLS index. The index itself is the section-relative distance of the symbol. For ARM, the relevant relocation (IMAGE_REL_ARM_SECREL) is applied as a constant. This means that the value may not be an immediate and must be lowered into a constant pool. This offset will not be base relocated. We were previously emitting the actual address of the symbol which would be base relocated and would therefore be the vaue offset by the ImageBase + TLS Offset. llvm-svn: 271974
* ARM: clang-format a couple of switches, add commentsSaleem Abdulrasool2016-06-071-5/+5
| | | | | | | clang-format a couple of switches in preparation for a future change. Add some enumeration comments llvm-svn: 271973
* Drop prelink support.Rafael Espindola2015-11-171-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way prelink used to work was * The compiler decides if a given section only has relocations that are know to point to the same DSO. If so, it names it .data.rel.ro.local<something>. * The static linker puts all of these together. * The prelinker program assigns addresses to each library and resolves the local relocations. There are many problems with this: * It is incompatible with address space randomization. * The information passed by the compiler is redundant. The linker knows if a given relocation is in the same DSO or not. If could sort by that if so desired. * There are newer ways of speeding up DSO (gnu hash for example). * Even if we want to implement this again in the compiler, the previous implementation is pretty broken. It talks about relocations that are "resolved by the static linker". If they are resolved, there are none left for the prelinker. What one needs to track is if an expression will require only dynamic relocations that point to the same DSO. At this point it looks like the prelinker is an historical curiosity. For example, fedora has retired it because it failed to build for two releases (http://pkgs.fedoraproject.org/cgit/prelink.git/commit/?id=eb43100a8331d91c801ee3dcdb0a0bb9babfdc1f) This patch removes support for it. That is, it stops printing the ".local" sections. llvm-svn: 253280
* ARM/ELF: Better codegen for global variable addresses.Peter Collingbourne2015-10-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In PIC mode we were previously computing global variable addresses (or GOT entry addresses) by adding the PC, the PC-relative GOT displacement and the GOT-relative symbol/GOT entry displacement. Because the latter two displacements are fixed, we ended up performing one more addition than necessary. This change causes us to compute addresses using a single PC-relative displacement, resulting in a shorter code sequence. This reduces code size by about 4% in a recent build of Chromium for Android. As a result of this change we no longer need to compute the GOT base address in the ARM backend, which allows us to remove the Global Base Reg pass and SDAG lowering for the GOT. We also now no longer use the GOT when addressing a symbol which is known to be defined in the same linkage unit. Specifically, the symbol must have either hidden visibility or a strong definition in the current module in order to not use the the GOT. This is a change from the previous behaviour where we would use the GOT to address externally visible symbols defined in the same module. I think the only cases where this could matter are cases involving symbol interposition, but we don't really support that well anyway. Differential Revision: http://reviews.llvm.org/D13650 llvm-svn: 251322
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-2/+2
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-2/+2
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-1/+1
| | | | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-101-20/+20
| | | | | | class. llvm-svn: 203433
* ARM: Deduplicate ConstantPoolValues.Benjamin Kramer2013-09-161-0/+33
| | | | llvm-svn: 190779
* Use a std::string rather than a dynamically allocated char* buffer.Benjamin Kramer2012-12-241-4/+2
| | | | | | | | | | | | | This affords us to use std::string's allocation routines and use the destructor for the memory management. Switching to that also means that we can use operator==(const std::string&, const char *) to perform the string comparison rather than resorting to libc functionality (i.e. strcmp). Patch by Saleem Abdulrasool! Differential Revision: http://llvm-reviews.chandlerc.com/D230 llvm-svn: 171042
* Remove unnecessary classof()'sSean Silva2012-10-111-5/+0
| | | | | | | isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. llvm-svn: 165767
* Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, ↵Jia Liu2012-02-181-1/+1
| | | | | | MSP430, PPC, PTX, Sparc, X86, XCore. llvm-svn: 150878
* Add a convenience method to tell if two things are equal.Bill Wendling2011-10-011-0/+6
| | | | llvm-svn: 140946
* Use the ARMConstantPoolMBB class to handle the MBB values.Bill Wendling2011-10-011-11/+4
| | | | llvm-svn: 140943
* Add ARMConstantPoolMBB to hold an MBB value in the constant pool.Bill Wendling2011-10-011-1/+33
| | | | llvm-svn: 140942
* Remove dead code.Bill Wendling2011-10-011-5/+0
| | | | llvm-svn: 140941
* Remove now dead methods and ivar.Bill Wendling2011-10-011-6/+0
| | | | llvm-svn: 140940
* Use the new ARMConstantPoolSymbol class to handle external symbols.Bill Wendling2011-10-011-0/+3
| | | | llvm-svn: 140939
* Add an ARMConstantPool class for external symbols. This will split out the ↵Bill Wendling2011-10-011-1/+40
| | | | | | support for external symbols from the base class. llvm-svn: 140938
* Remove now dead methods and ivar from ARMConstantPoolValue.Bill Wendling2011-10-011-10/+0
| | | | llvm-svn: 140937
* Some more refactoring.Bill Wendling2011-10-011-0/+18
| | | | | | | | * Add a couple of Create methods to the ARMConstantPoolConstant class, * Add its own version of getExistingMachineCPValue, and * Modify hasSameValue to return false if the object isn't an ARMConstantPoolConstant. llvm-svn: 140935
* Add a Create method that accepts 'kind' and 'pcadj' arguments.Bill Wendling2011-10-011-0/+3
| | | | llvm-svn: 140934
* Refactoring: Separate out the ARM constant pool Constant from the ARM constantBill Wendling2011-10-011-5/+41
| | | | | | | | pool value. It's not used right now, but will be soon. llvm-svn: 140933
* Constify 'isLSDA' and move a method out-of-line.Bill Wendling2011-09-301-14/+6
| | | | llvm-svn: 140868
* Support creating a constant pool value for a machine basic block.Bill Wendling2011-09-291-2/+12
| | | | | | | This is used when we want to take the address of a machine basic block, but it's not associated with a BB in LLVM IR. llvm-svn: 140823
* Rename AddSelectionDAGCSEId() to addSelectionDAGCSEId().Jim Grosbach2011-09-271-1/+1
| | | | | | Naming conventions consistency. No functional change. llvm-svn: 140636
* Nuke a FIXME. No need to be fancier here, as ARM handles constant poolsJim Grosbach2010-11-291-5/+1
| | | | | | locations and formatting specially. rdar://7353441 llvm-svn: 120343
* Change the ARMConstantPoolValue modifier string to an enumeration. This willJim Grosbach2010-11-091-6/+31
| | | | | | help in MC'izing the references that use them. llvm-svn: 118633
* Add <cstddef> include to get ptrdiff_t, for gcc-4.6; patch by Dimitry Andric.Daniel Dunbar2010-06-151-0/+1
| | | | llvm-svn: 105994
* Add const qualifiers to CodeGen's use of LLVM IR constructs.Dan Gohman2010-04-151-5/+5
| | | | llvm-svn: 101334
* - Add TargetInstrInfo::isIdentical(). It's similar to MachineInstr::isIdenticalEvan Cheng2009-11-071-0/+4
| | | | | | | | | | except it doesn't care if the definitions' virtual registers differ. This is used by machine LICM and other MI passes to perform CSE. - Teach Thumb2InstrInfo::isIdentical() to check two t2LDRpci_pic are identical. Since pc relative constantpool entries are always different, this requires it it check if the values can actually the same. llvm-svn: 86328
* Hyphenate some comments.Bob Wilson2009-11-021-3/+2
| | | | llvm-svn: 85808
* Add support for BlockAddress values in ARM constant pools.Bob Wilson2009-11-021-7/+13
| | | | llvm-svn: 85806
* Fix compiler warningsJim Grosbach2009-09-011-1/+1
| | | | llvm-svn: 80650
* Clean up LSDA name generation and use for SJLJ exception handling. ThisJim Grosbach2009-09-011-0/+10
| | | | | | | | | | | makes an eggregious hack somewhat more palatable. Bringing the LSDA forward and making it a GV available for reference would be even better, but is beyond the scope of what I'm looking to solve at this point. Objective C++ code could generate function names that broke the previous scheme. This fixes that. llvm-svn: 80649
* Let Darwin linker auto-synthesize stubs and lazy-pointers. This deletes a ↵Evan Cheng2009-08-281-15/+1
| | | | | | bunch of nasty code in ARM asm printer. llvm-svn: 80404
* remove various std::ostream version of printing methods fromChris Lattner2009-08-231-8/+0
| | | | | | | | MachineInstr and MachineOperand. This required eliminating a bunch of stuff that was using DOUT, I hope that bill doesn't mind me stealing his fun. ;-) llvm-svn: 79813
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-1/+2
| | | | llvm-svn: 78948
* Whitespace cleanup. Remove trailing whitespace.Jim Grosbach2009-08-111-2/+2
| | | | llvm-svn: 78666
OpenPOWER on IntegriCloud