- Jul 22, 2013
-
-
Shuxin Yang authored
There already have two "dead" functions, initialize{IPO|IPA}, defined for similar purpose. I decide not to call these two functions for two reasons: o. they don't cover all LTO passes (which will soon be separated into IPO and post-IPO passes) o. We have not yet figured out the right passes and the ordering for IPO and post-IPO stages, meaning this change is only for the time being. Since LTO passes are registered, we are now able to print IR before and after particular point. For OSX users: -------------- "...-Wl,-mllvm -Wl,-print-after=<pass-name>" will print IR after the specified pass. For Other UNIX with GNU gold linker: ------------------------------------ "-Wl,-plugin-opt=-print-after=<pass-name>" should work. (NOTE: no need for "-Wl,-mllvm") Strip "-Wl," if flags are fed directly to linker instead of clang/clang++. llvm-svn: 186853
-
- Jul 16, 2013
-
-
Rafael Espindola authored
This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). llvm-svn: 186447
-
- Jul 09, 2013
-
-
Bill Wendling authored
The problem with running internalize before we're ready to output an object file is that it may change a 'weak' symbol into an internal one, but that symbol could be needed by an external object file --- e.g. with arclite. <rdar://problem/14334895> llvm-svn: 185882
-
- Jul 05, 2013
-
-
Rafael Espindola authored
llvm-svn: 185719
-
- Jun 18, 2013
-
-
Bill Wendling authored
Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. llvm-svn: 184175
-
- Jun 17, 2013
-
-
Rafael Espindola authored
This patch also adds a simpler version of sys::fs::remove and a tool_output_file constructor for when we already have an open file. llvm-svn: 184095
-
- Jun 13, 2013
-
-
Rafael Espindola authored
llvm-svn: 183947
-
- May 29, 2013
-
-
Bill Wendling authored
Not only does this break encapsulation, it's gross. llvm-svn: 182876
-
- May 23, 2013
-
-
Bill Wendling authored
Move the processing of the command line options to right before we create the TargetMachine instead of after. <rdar://problem/13468287> llvm-svn: 182611
-
- May 04, 2013
-
-
Rafael Espindola authored
Update comments, fix * placement, fix method names that are not used in clang, add a linkInModule that takes a Mode and put it in Linker.cpp. llvm-svn: 181099
-
Rafael Espindola authored
The linker is now responsible only for actually linking the modules, it is up to the clients to create and destroy them. llvm-svn: 181098
-
Rafael Espindola authored
llvm-svn: 181096
-
- Apr 24, 2013
-
-
Rafael Espindola authored
LTO was always creating an empty llvm.compiler.used. With this patch we now first check if there is anything to be added first. Unfortunately, there is no good way to test libLTO in isolation as it needs gold or ld64, but there are bots doing LTO builds that found this problem. llvm-svn: 180202
-
- Mar 30, 2013
-
-
- Mar 13, 2013
-
-
Lang Hames authored
codegen passes. This brings it in to line with clang and llc's codegen setup, and tidies up the code. If I understand correctly, adding ModulePasses to a FunctionPassManager is bogus. It only seems to explode if an added ModulePass depends on a FunctionPass though, which might be why this code has survived so long. Fixes <rdar://problem/13386816>. llvm-svn: 176977
-
- Feb 28, 2013
-
-
Bill Wendling authored
- Consistency with opt (which supports the same option with the same meaning and description). - Debugging gold plugin-based linking without optimizations getting in the way. - Debugging programs linked with the gold plugin while preserving the original debug info. - Fine-grained control over LTO passes using the gold plugin in combination with opt (or clang/dragonegg). Patch by Cristiano Giuffrida! llvm-svn: 176257
-
- Jan 15, 2013
-
-
Nadav Rotem authored
llvm-svn: 172499
-
- Jan 07, 2013
-
-
Chandler Carruth authored
a TargetMachine to construct (and thus isn't always available), to an analysis group that supports layered implementations much like AliasAnalysis does. This is a pretty massive change, with a few parts that I was unable to easily separate (sorry), so I'll walk through it. The first step of this conversion was to make TargetTransformInfo an analysis group, and to sink the nonce implementations in ScalarTargetTransformInfo and VectorTargetTranformInfo into a NoTargetTransformInfo pass. This allows other passes to add a hard requirement on TTI, and assume they will always get at least on implementation. The TargetTransformInfo analysis group leverages the delegation chaining trick that AliasAnalysis uses, where the base class for the analysis group delegates to the previous analysis *pass*, allowing all but tho NoFoo analysis passes to only implement the parts of the interfaces they support. It also introduces a new trick where each pass in the group retains a pointer to the top-most pass that has been initialized. This allows passes to implement one API in terms of another API and benefit when some other pass above them in the stack has more precise results for the second API. The second step of this conversion is to create a pass that implements the TargetTransformInfo analysis using the target-independent abstractions in the code generator. This replaces the ScalarTargetTransformImpl and VectorTargetTransformImpl classes in lib/Target with a single pass in lib/CodeGen called BasicTargetTransformInfo. This class actually provides most of the TTI functionality, basing it upon the TargetLowering abstraction and other information in the target independent code generator. The third step of the conversion adds support to all TargetMachines to register custom analysis passes. This allows building those passes with access to TargetLowering or other target-specific classes, and it also allows each target to customize the set of analysis passes desired in the pass manager. The baseline LLVMTargetMachine implements this interface to add the BasicTTI pass to the pass manager, and all of the tools that want to support target-aware TTI passes call this routine on whatever target machine they end up with to add the appropriate passes. The fourth step of the conversion created target-specific TTI analysis passes for the X86 and ARM backends. These passes contain the custom logic that was previously in their extensions of the ScalarTargetTransformInfo and VectorTargetTransformInfo interfaces. I separated them into their own file, as now all of the interface bits are private and they just expose a function to create the pass itself. Then I extended these target machines to set up a custom set of analysis passes, first adding BasicTTI as a fallback, and then adding their customized TTI implementations. The fourth step required logic that was shared between the target independent layer and the specific targets to move to a different interface, as they no longer derive from each other. As a consequence, a helper functions were added to TargetLowering representing the common logic needed both in the target implementation and the codegen implementation of the TTI pass. While technically this is the only change that could have been committed separately, it would have been a nightmare to extract. The final step of the conversion was just to delete all the old boilerplate. This got rid of the ScalarTargetTransformInfo and VectorTargetTransformInfo classes, all of the support in all of the targets for producing instances of them, and all of the support in the tools for manually constructing a pass based around them. Now that TTI is a relatively normal analysis group, two things become straightforward. First, we can sink it into lib/Analysis which is a more natural layer for it to live. Second, clients of this interface can depend on it *always* being available which will simplify their code and behavior. These (and other) simplifications will follow in subsequent commits, this one is clearly big enough. Finally, I'm very aware that much of the comments and documentation needs to be updated. As soon as I had this working, and plausibly well commented, I wanted to get it committed and in front of the build bots. I'll be doing a few passes over documentation later if it sticks. Commits to update DragonEgg and Clang will be made presently. llvm-svn: 171681
-
- Jan 05, 2013
-
-
Chandler Carruth authored
Sorry for the noise here, 'make check' doesn't build this code. =/ llvm-svn: 171623
-
- Jan 02, 2013
-
-
Chandler Carruth authored
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
-
Chandler Carruth authored
llvm-svn: 171363
-
- Dec 11, 2012
-
-
NAKAMURA Takumi authored
llvm-svn: 169817
-
- Dec 10, 2012
-
-
Bill Wendling authored
The linker will call `lto_codegen_add_must_preserve_symbol' on all globals that should be kept around. The linker will pretend that a dylib is being created. <rdar://problem/12528059> llvm-svn: 169770
-
Bill Wendling authored
llvm-svn: 169720
-
- Dec 08, 2012
-
-
Bill Wendling authored
This function sets the `_exportDynamic' ivar. When that's set, we export all symbols (e.g. we don't run the internalize pass). This is equivalent to the `--export-dynamic' linker flag in GNU land: --export-dynamic When creating a dynamically linked executable, add all symbols to the dynamic symbol table. The dynamic symbol table is the set of symbols which are visible from dynamic objects at run time. If you do not use this option, the dynamic symbol table will normally contain only those symbols which are referenced by some dynamic object mentioned in the link. If you use dlopen to load a dynamic object which needs to refer back to the symbols defined by the program, rather than some other dynamic object, then you will probably need to use this option when linking the program itself. The Darwin linker will support this via the `-export_dynamic' flag. We should modify clang to support this via the `-rdynamic' flag. llvm-svn: 169656
-
- Dec 04, 2012
-
-
Chandler Carruth authored
Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. llvm-svn: 169252
-
- Nov 29, 2012
-
-
Pedro Artigas authored
start up and clean up module passes, now that ASAN and TSAN are fixed the tests pass llvm-svn: 168905
-
- Nov 27, 2012
-
-
Owen Anderson authored
Revert r168635 "Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model". It appears to have broken at least one buildbot. llvm-svn: 168654
-
Owen Anderson authored
Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model Patch by Pedro Artigas, with feedback from by Chandler Carruth. llvm-svn: 168635
-
- Nov 15, 2012
-
-
Owen Anderson authored
Add doInitialization and doFinalization methods to ModulePass's, to allow them to be re-initialized and reused on multiple Module's. Patch by Pedro Artigas. llvm-svn: 168008
-
- Oct 19, 2012
-
-
Nadav Rotem authored
llvm-svn: 166248
-
- Oct 18, 2012
-
-
Bob Wilson authored
The TargetTransform changes are breaking LTO bootstraps of clang. I am working with Nadav to figure out the problem, but I am reverting it for now to get our buildbots working. This reverts svn commits: 165665 165669 165670 165786 165787 165997 and I have also reverted clang svn 165741 llvm-svn: 166168
-
- Oct 16, 2012
-
-
Nadav Rotem authored
llvm-svn: 165997
-
- Oct 12, 2012
-
-
rdar://problem/12457841Bob Wilson authored
This is a temporary hack until Bill's project to record command line options in the LLVM IR is ready. Clang currently sets a default CPU but that isn't recorded anywhere and it doesn't get used in the final LTO compilation. llvm-svn: 165809
-
- Oct 08, 2012
-
-
Micah Villmow authored
llvm-svn: 165403
-
- Sep 06, 2012
-
-
- Aug 09, 2012
-
-
Bill Wendling authored
llvm-svn: 161530
-
- Aug 07, 2012
-
-
Bill Wendling authored
llvm-svn: 161356
-
- Aug 06, 2012
-
-
Bill Wendling authored
When the command line target options were removed from the LLVM libraries, LTO lost its ability to specify things like `-disable-fp-elim'. Add this back by adding the command line variables to the `lto' project. <rdar://problem/12038729> llvm-svn: 161353
-
- May 30, 2012
-
-
David Blaikie authored
This broke in r144788 when the CodeGenOpt option was moved from everywhere else (specifically, from addPassesToEmitFile) to createTargetMachine. Since LTOCodeGenerator wasn't passing the 4th argument, when the 4th parameter became the 3rd, it silently continued to compile (int->bool conversion) but meant something completely different. This change preserves the existing (accidental) and previous (default) semantics of the addPassesToEmitFile and restores the previous/intended CodeGenOpt argument by passing it appropriately to createTargetMachine. (discovered by pending changes to -Wconversion to catch constant->bool conversions) llvm-svn: 157705
-