- Jul 27, 2013
-
-
Nick Lewycky authored
Adds unit tests for it too. Split BasicBlockUtils into an analysis-half and a transforms-half, and put the analysis bits into a new Analysis/CFG.{h,cpp}. Promote isPotentiallyReachable into llvm::isPotentiallyReachable and move it into Analysis/CFG. llvm-svn: 187283
-
Tom Stellard authored
Merge consecutive if-regions if they contain identical statements. Both transformations reduce number of branches. The transformation is guarded by a target-hook, and is currently enabled only for +R600, but the correctness has been tested on X86 target using a variety of CPU benchmarks. Patch by: Mei Ye llvm-svn: 187278
-
- Jul 26, 2013
-
-
Chandler Carruth authored
robust. It now uses an InstVisitor and worklist to actually walk the uses of the Alloca transitively and detect the pattern which we can directly promote: loads & stores of the whole alloca and instructions we can completely ignore. Also, with this new implementation teach both the predicate for testing whether we can promote and the promotion engine itself to use the same code so we no longer have strange divergence between the two code paths. I've added some silly test cases to demonstrate that we can handle slightly more degenerate code patterns now. See the below for why this is even interesting. Performance impact: roughly 1% regression in the performance of SROA or ScalarRepl on a large C++-ish test case where most of the allocas are basically ready for promotion. The reason is because of silly redundant work that I've left FIXMEs for and which I'll address in the next commit. I wanted to separate this commit as it changes the behavior. Once the redundant work in removing the dead uses of the alloca is fixed, this code appears to be faster than the old version. =] So why is this useful? Because the previous requirement for promotion required a *specific* visit pattern of the uses of the alloca to verify: we *had* to look for no more than 1 intervening use. The end goal is to have SROA automatically detect when an alloca is already promotable and directly hand it to the mem2reg machinery rather than trying to partition and rewrite it. This is a 25% or more performance improvement for SROA, and a significant chunk of the delta between it and ScalarRepl. To get there, we need to make mem2reg actually capable of promoting allocas which *look* promotable to SROA without have SROA do tons of work to massage the code into just the right form. This is actually the tip of the iceberg. There are tremendous potential savings we can realize here by de-duplicating work between mem2reg and SROA. llvm-svn: 187191
-
- Jul 25, 2013
-
-
Rafael Espindola authored
The language reference says that: "If a symbol appears in the @llvm.used list, then the compiler, assembler, and linker are required to treat the symbol as if there is a reference to the symbol that it cannot see" Since even the linker cannot see the reference, we must assume that the reference can be using the symbol table. For example, a user can add __attribute__((used)) to a debug helper function like dump and use it from a debugger. llvm-svn: 187103
-
- Jul 24, 2013
-
-
Matt Arsenault authored
llvm-svn: 186997
-
- Jul 23, 2013
-
-
Jakub Staszak authored
llvm-svn: 186890
-
- Jul 21, 2013
-
-
Benjamin Kramer authored
llvm-svn: 186790
-
Chandler Carruth authored
to iterate over. llvm-svn: 186788
-
Chandler Carruth authored
helper function. This leaves both trivial cases handled entirely in helper functions and merely manages the list of allocas to process in the run method. The next step will be to handle all of the trivial promotion work prior to even creating the core class and the subsequent simplifications that enables. llvm-svn: 186784
-
Chandler Carruth authored
a single block into the helper routine. This takes advantage of the fact that we can directly replace uses prior to any store with undef to simplify matters and unconditionally promote allocas only used within one block. I've removed the special handling for the case of no stores existing. This has no semantic effect but might slow things down. I'll fix that in a later patch when I refactor this entire thing to be easier to manage the different cases. llvm-svn: 186783
-
Chandler Carruth authored
llvm-svn: 186782
-
Chandler Carruth authored
handles the general cases. The hope is to refactor this so that we don't end up building the entire class for the trivial cases. I also want to lift a lot of the early pre-processing in the initial segment of run() into a separate routine, and really none of it needs to happen inside the primary promotion class. These routines in particular used none of the actual state in the promotion class, so they don't really make sense as members. llvm-svn: 186781
-
Chandler Carruth authored
This struct is nicely independent of everything else, and we already needed a foward declaration here. It's simpler to just define it immediately. llvm-svn: 186780
-
Chandler Carruth authored
llvm-svn: 186779
-
Chandler Carruth authored
that ensued from that. llvm-svn: 186777
-
Chandler Carruth authored
pattern and conform to the naming conventions. llvm-svn: 186776
-
Chandler Carruth authored
subsequent changes don't introduce inconsistencies. llvm-svn: 186775
-
Chandler Carruth authored
those baked into DenseMap now. llvm-svn: 186773
-
Chandler Carruth authored
functionality changed. llvm-svn: 186772
-
- Jul 16, 2013
-
-
Peter Collingbourne authored
Differential Revision: http://llvm-reviews.chandlerc.com/D1149 llvm-svn: 186431
-
- Jul 15, 2013
-
-
Craig Topper authored
llvm-svn: 186312
-
- Jul 14, 2013
-
-
Craig Topper authored
llvm-svn: 186274
-
- Jul 11, 2013
-
-
Benjamin Kramer authored
No functionality change. llvm-svn: 186095
-
Duncan Sands authored
predecessors of the two blocks it is attempting to merge supply the same incoming values to any phi in the successor block. This change allows merging in the case where there is one or more incoming values that are undef. The undef values are rewritten to match the non-undef value that flows from the other edge. Patch by Mark Lacey. llvm-svn: 186069
-
- Jul 10, 2013
-
-
Peter Collingbourne authored
A special case list can now specify categories for specific globals, which can be used to instruct an instrumentation pass to treat certain functions or global variables in a specific way, such as by omitting certain aspects of instrumentation while keeping others, or informing the instrumentation pass that a specific uninstrumentable function has certain semantics, thus allowing the pass to instrument callers according to those semantics. For example, AddressSanitizer now uses the "init" category instead of global-init prefixes for globals whose initializers should not be instrumented, but which in all other respects should be instrumented. The motivating use case is DataFlowSanitizer, which will have a number of different categories for uninstrumentable functions, such as "functional" which specifies that a function has pure functional semantics, or "discard" which indicates that a function's return value should not be labelled. Differential Revision: http://llvm-reviews.chandlerc.com/D1092 llvm-svn: 185978
-
Peter Collingbourne authored
it more unit testable, and fix memory leak in the other ctor. Differential Revision: http://llvm-reviews.chandlerc.com/D1090 llvm-svn: 185976
-
Peter Collingbourne authored
Differential Revision: http://llvm-reviews.chandlerc.com/D1089 llvm-svn: 185975
-
- Jul 04, 2013
-
-
Benjamin Kramer authored
This allows us to create switches even if instcombine has munged two of the incombing compares into one and some bit twiddling. This was motivated by enum compares that are common in clang. llvm-svn: 185632
-
Craig Topper authored
Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. llvm-svn: 185606
-
- Jun 28, 2013
-
-
Manman Ren authored
No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. For cases where we know the type of a DI metadata, use assert. Also update testing cases to make them conform to the format of DI classes. llvm-svn: 185135
-
- Jun 27, 2013
-
-
Michael Gottesman authored
The Builtin attribute is an attribute that can be placed on function call site that signal that even though a function is declared as being a builtin, rdar://problem/13727199 llvm-svn: 185049
-
Eric Christopher authored
This reverts commit r185020 llvm-svn: 185032
-
- Jun 26, 2013
-
-
Manman Ren authored
No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. llvm-svn: 185020
-
- Jun 20, 2013
-
-
Meador Inge authored
This commit completely removes what is left of the simplify-libcalls pass. All of the functionality has now been migrated to the instcombine and functionattrs passes. The following C API functions are now NOPs: 1. LLVMAddSimplifyLibCallsPass 2. LLVMPassManagerBuilderSetDisableSimplifyLibCalls llvm-svn: 184459
-
- Jun 19, 2013
-
-
Bill Wendling authored
Access the TargetLoweringInfo from the TargetMachine object instead of caching it. The TLI may change between functions. No functionality change. llvm-svn: 184352
-
- Jun 04, 2013
-
-
Rafael Espindola authored
The problem this time seems to be a thinko. We were assuming that in the CFG A | \ | B | / C speculating the basic block B would cause only the phi value for the B->C edge to be speculated. That is not true, the phi's are semantically in the edges, so if the A->B->C path is taken, any code needed for A->C is not executed and we have to consider it too when deciding to speculate B. llvm-svn: 183226
-
Hans Wennborg authored
llvm-svn: 183219
-
- Jun 03, 2013
-
-
David Majnemer authored
PR16069 is an interesting case where an incoming value to a PHI is a trap value while also being a 'ConstantExpr'. We do not consider this case when performing the 'HoistThenElseCodeToIf' optimization. Instead, make our modifications more conservative if we detect that we cannot transform the PHI to a select. llvm-svn: 183152
-
David Majnemer authored
llvm-svn: 183151
-
- Jun 01, 2013
-
-
David Majnemer authored
llvm-svn: 183078
-