aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetMachine.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-01-06Revert r224935 "Refactor duplicated code. No intended functionality change."Lang Hames1-2/+1
This is affecting the behavior of some ObjC++ / AArch64 test cases on Darwin. Reverting to get the bots green while I track down the source of the changed behavior. llvm-svn: 225311
2014-12-29Refactor duplicated code.Rafael Espindola1-1/+2
No intended functionality change. llvm-svn: 224935
2014-09-26Move resetTargetOptions from taking a MachineFunction to a FunctionEric Christopher1-12/+8
since we are accessing the TargetMachine that we're a member function of. llvm-svn: 218489
2014-08-04Remove the TargetMachine forwards for TargetSubtargetInfo basedEric Christopher1-2/+3
information and update all callers. No functional change. llvm-svn: 214781
2014-05-28[pr19844] Add thread local mode to aliases.Rafael Espindola1-9/+6
This matches gcc's behavior. It also seems natural given that aliases contain other properties that govern how it is accessed (linkage, visibility, dll storage). Clang still has to be updated to expose this feature to C. llvm-svn: 209759
2014-05-23Use alias linkage and visibility to decide tls access mode.Rafael Espindola1-13/+10
This matches both what we do for the non-thread case and what gcc does. With this patch clang would match gcc's behaviour in static __thread int a = 42; extern __thread int b __attribute__((alias("a"))); int *f(void) { return &a; } int *g(void) { return &b; } if not for pr19843. Manually writing the IL does produce the same access modes. It is also a step in the direction of fixing pr19844. llvm-svn: 209543
2014-05-20Move the verbose asm option to be part of the options struct andEric Christopher1-11/+3
set appropriately. llvm-svn: 209258
2014-05-20Move the function and data section flags into the options struct andEric Christopher1-15/+6
make the functions to set them non-static. Move and rename the llvm specific backend options to avoid conflicting with the clang option. Paired with a backend commit to update. llvm-svn: 209238
2014-05-16Delete getAliasedGlobal.Rafael Espindola1-1/+1
llvm-svn: 209040
2014-05-15Remove unused llvm namespace bool variable.Eric Christopher1-1/+0
llvm-svn: 208931
2014-05-15Move the TargetMachine MC options to MCTargetOptions. No functionalEric Christopher1-4/+0
change. llvm-svn: 208832
2014-05-12Remove MCUseCFI from TargetMachine.Rafael Espindola1-1/+0
It was always true. llvm-svn: 208547
2014-04-25[C++] Use 'nullptr'. Target edition.Craig Topper1-1/+1
llvm-svn: 207197
2014-04-23Create MCTargetOptions.Evgeniy Stepanov1-0/+3
For now it contains a single flag, SanitizeAddress, which enables AddressSanitizer instrumentation of inline assembly. Patch by Yuri Gorshenin. llvm-svn: 206971
2014-03-27Prevent alias from pointing to weak aliases.Rafael Espindola1-1/+1
This adds back r204781. Original message: Aliases are just another name for a position in a file. As such, the regular symbol resolutions are not applied. For example, given define void @my_func() { ret void } @my_alias = alias weak void ()* @my_func @my_alias2 = alias void ()* @my_alias We produce without this patch: .weak my_alias my_alias = my_func .globl my_alias2 my_alias2 = my_alias That is, in the resulting ELF file my_alias, my_func and my_alias are just 3 names pointing to offset 0 of .text. That is *not* the semantics of IR linking. For example, linking in a @my_alias = alias void ()* @other_func would require the strong my_alias to override the weak one and my_alias2 would end up pointing to other_func. There is no way to represent that with aliases being just another name, so the best solution seems to be to just disallow it, converting a miscompile into an error. llvm-svn: 204934
2014-03-26Revert "Prevent alias from pointing to weak aliases."Rafael Espindola1-1/+1
This reverts commit r204781. I will follow up to with msan folks to see what is what they were trying to do with aliases to weak aliases. llvm-svn: 204784
2014-03-26Prevent alias from pointing to weak aliases.Rafael Espindola1-1/+1
Aliases are just another name for a position in a file. As such, the regular symbol resolutions are not applied. For example, given define void @my_func() { ret void } @my_alias = alias weak void ()* @my_func @my_alias2 = alias void ()* @my_alias We produce without this patch: .weak my_alias my_alias = my_func .globl my_alias2 my_alias2 = my_alias That is, in the resulting ELF file my_alias, my_func and my_alias are just 3 names pointing to offset 0 of .text. That is *not* the semantics of IR linking. For example, linking in a @my_alias = alias void ()* @other_func would require the strong my_alias to override the weak one and my_alias2 would end up pointing to other_func. There is no way to represent that with aliases being just another name, so the best solution seems to be to just disallow it, converting a miscompile into an error. llvm-svn: 204781
2014-02-19move getNameWithPrefix and getSymbol to TargetMachine.Rafael Espindola1-0/+30
TargetLoweringBase is implemented in CodeGen, so before this patch we had a dependency fom Target to CodeGen. This would show up as a link failure of llvm-stress when building with -DBUILD_SHARED_LIBS=ON. This fixes pr18900. llvm-svn: 201711
2014-02-05Remove support for not using .loc directives.Rafael Espindola1-1/+0
Clang itself was not using this. The only way to access it was via llc. llvm-svn: 200862
2014-01-28Revert r199871 and replace it with a simple check in the debug infoEric Christopher1-1/+0
code to see if we're emitting a function into a non-default text section. This is still a less-than-ideal solution, but more contained than r199871 to determine whether or not we're emitting code into an array of comdat sections. llvm-svn: 200269
2014-01-23Add a variable to track whether or not we've used a unique section,Eric Christopher1-0/+1
e.g. linkonce, to TargetMachine and set it when we've done so for ELF targets currently. This involved making TargetMachine non-const in a TLOF use and propagating that change around - I'm open to other ideas. This will be used in a future commit to handle emitting debug information with ranges. llvm-svn: 199871
2013-12-07Add a RequireStructuredCFG Field to TargetMachine.Vincent Lejeune1-0/+1
llvm-svn: 196634
2013-11-22Teach ISel not to optimize 'optnone' functions (revised).Paul Robinson1-0/+5
Improvements over r195317: - Set/restore EnableFastISel flag instead of just running FastISel within SelectAllBasicBlocks; the flag is checked in various places, and FastISel won't run properly if those places don't do the right thing. - Test looks for normal ISel versus FastISel behavior, and not something more subtle that doesn't work everywhere. Based on work by Andrea Di Biagio. llvm-svn: 195491
2013-11-21Whitespace.NAKAMURA Takumi1-1/+1
llvm-svn: 195341
2013-11-21Revert r195317 (and r195333), "Teach ISel not to optimize 'optnone' functions."NAKAMURA Takumi1-5/+0
It broke, at least, i686 target. It is reproducible with "llc -mtriple=i686-unknown". FYI, it didn't appear to add either "-O0" or "-fast-isel". llvm-svn: 195339
2013-11-21Teach ISel not to optimize 'optnone' functions.Paul Robinson1-0/+5
Based on work by Andrea Di Biagio. llvm-svn: 195317
2013-07-25Replace the "NoFramePointerElimNonLeaf" target option with a function attribute.Bill Wendling1-1/+0
There's no need to specify a flag to omit frame pointer elimination on non-leaf nodes...(Honestly, I can't parse that option out.) Use the function attribute stuff instead. llvm-svn: 187093
2013-03-13Reset some of the target options which affect code generation.Bill Wendling1-0/+26
This doesn't reset all of the target options within the TargetOptions object. This is because some of those are ABI-specific and must be determined if it's okay to change those on the fly. llvm-svn: 176986
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth1-3/+3
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. llvm-svn: 171366
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth1-1/+1
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-06-23Extend the IL for selecting TLS models (PR9788)Hans Wennborg1-7/+33
This allows the user/front-end to specify a model that is better than what LLVM would choose by default. For example, a variable might be declared as @x = thread_local(initialexec) global i32 42 if it will not be used in a shared library that is dlopen'ed. If the specified model isn't supported by the target, or if LLVM can make a better choice, a different model may be used. llvm-svn: 159077
2012-06-23Handle aliases to tls variables in all architectures, not just x86.Rafael Espindola1-3/+11
llvm-svn: 159058
2012-04-08Teach LLVM about a PIE option which, when enabled on top of PIC, makesChandler Carruth1-1/+2
optimizations which are valid for position independent code being linked into a single executable, but not for such code being linked into a shared library. I discussed the design of this with Eric Christopher, and the decision was to support an optional bit rather than a completely separate relocation model. Fundamentally, this is still PIC relocation, its just that certain optimizations are only valid under a PIC relocation model when the resulting code won't be in a shared library. The simplest path to here is to expose a single bit option in the TargetOptions. If folks have different/better designs, I'm all ears. =] I've included the first optimization based upon this: changing TLS models to the *Exec models when PIE is enabled. This is the LLVM component of PR12380 and is all of the hard work. llvm-svn: 154294
2012-04-08Move the TLSModel information into the TargetMachine rather than hidingChandler Carruth1-0/+21
in TargetLowering. There was already a FIXME about this location being odd. The interface is simplified as a consequence. This will also make it easier to change TLS models when compiling with PIE. llvm-svn: 154292
2012-03-26Prune some includes and forward declarations.Craig Topper1-1/+0
llvm-svn: 153429
2012-03-25Prune some includes and forward declarations.Craig Topper1-0/+1
llvm-svn: 153415
2012-02-10RegAlloc superpass: includes phi elimination, coalescing, and scheduling.Andrew Trick1-2/+0
Creates a configurable regalloc pipeline. Ensure specific llc options do what they say and nothing more: -reglloc=... has no effect other than selecting the allocator pass itself. This patch introduces a new umbrella flag, "-optimize-regalloc", to enable/disable the optimizing regalloc "superpass". This allows for example testing coalscing and scheduling under -O0 or vice-versa. When a CodeGen pass requires the MachineFunction to have a particular property, we need to explicitly define that property so it can be directly queried rather than naming a specific Pass. For example, to check for SSA, use MRI->isSSA, not addRequired<PHIElimination>. CodeGen transformation passes are never "required" as an analysis ProcessImplicitDefs does not require LiveVariables. We have a plan to massively simplify some of the early passes within the regalloc superpass. llvm-svn: 150226
2012-01-17Moving options declarations around.Andrew Trick1-8/+0
More short term hackery until we have a way to configure passes that work on LiveIntervals. llvm-svn: 148289
2012-01-13Added the MachineSchedulerPass skeleton.Andrew Trick1-1/+10
llvm-svn: 148105
2011-12-11Also remove unnecessary includes from this file, which was supposed to be partNick Lewycky1-2/+0
of r146334! llvm-svn: 146338
2011-12-10Refactor the implementation of the TargetOptions out of TargetMachine, takingNick Lewycky1-33/+0
the only parts of TM that depends on CodeGen headers with it. llvm-svn: 146334
2011-12-02Move global variables in TargetMachine into new TargetOptions class. As an APINick Lewycky1-181/+32
change, now you need a TargetOptions object to create a TargetMachine. Clang patch to follow. One small functionality change in PTX. PTX had commented out the machine verifier parts in their copy of printAndVerify. That now calls the version in LLVMTargetMachine. Users of PTX who need verification disabled should rely on not passing the command-line flag to enable it. llvm-svn: 145714
2011-11-16Sink codegen optimization level into MCCodeGenInfo along side relocation modelEvan Cheng1-0/+8
and code model. This eliminates the need to pass OptLevel flag all over the place and makes it possible for any codegen pass to use this information. llvm-svn: 144788
2011-10-31Switch new .file directive emission off by default, change llc's flag for it toNick Lewycky1-1/+1
-enable-dwarf-directory. llvm-svn: 143326
2011-10-17Add support for a new extension to the .file directive:Nick Lewycky1-1/+2
.file filenumber "directory" "filename" This removes one join+split of the directory+filename in MC internals. Because bitcode files have independent fields for directory and filenames in debug info, this patch may change the .o files written by existing .bc files. llvm-svn: 142300
2011-08-30Command line option to enable support for segmented stacks:Rafael Espindola1-0/+7
-segmented-stacks. Patch by Sanjoy Das! llvm-svn: 138811
2011-07-20- Move CodeModel from a TargetMachine global option to MCCodeGenInfo.Evan Cheng1-25/+4
- Introduce JITDefault code model. This tells targets to set different default code model for JIT. This eliminates the ugly hack in TargetMachine where code model is changed after construction. llvm-svn: 135580
2011-07-20Don't leak CodeGenInfos.Benjamin Kramer1-1/+3
llvm-svn: 135555
2011-07-19Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng1-23/+4
(including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. llvm-svn: 135468
2011-07-08Eliminate asm parser's dependency on TargetMachine:Evan Cheng1-2/+3
- Each target asm parser now creates its own MCSubtatgetInfo (if needed). - Changed AssemblerPredicate to take subtarget features which tablegen uses to generate asm matcher subtarget feature queries. e.g. "ModeThumb,FeatureThumb2" is translated to "(Bits & ModeThumb) != 0 && (Bits & FeatureThumb2) != 0". llvm-svn: 134678