summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Non optimizable objc_retainBlock calls are not forwarding.Michael Gottesman2013-03-281-2/+2
| | | | | | | | | | | | Since we handle optimizable objc_retainBlocks through strength reduction in OptimizableIndividualCalls, we know that all code after that point will only see non-optimizable objc_retainBlock calls. IsForwarding is only called by functions after that point, so it is ok to just classify objc_retainBlock as non-forwarding. <rdar://problem/13249661>. llvm-svn: 178285
* [ObjCARC] Strength reduce objc_retainBlock -> objc_retain if the ↵Michael Gottesman2013-03-282-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | objc_retainBlock is optimizable. If an objc_retainBlock has the copy_on_escape metadata attached to it AND if the block pointer argument only escapes down the stack, we are allowed to strength reduce the objc_retainBlock to to an objc_retain and thus optimize it. Current there is logic in the ARC data flow analysis to handle this case which is complicated and involved making distinctions in between objc_retainBlock and objc_retain in certain places and considering them the same in others. This patch simplifies said code by: 1. Performing the strength reduction in the initial ARC peephole analysis (ObjCARCOpts::OptimizeIndividualCalls). 2. Changes the ARC dataflow analysis (which runs after the peephole analysis) to consider all objc_retainBlock calls to not be optimizable (since if the call was optimizable, we would have strength reduced it already). This patch leaves in the infrastructure in the ARC dataflow analysis to handle this case, which due to 2 will just be dead code. I am doing this on purpose to separate the removal of the old code from the testing of the new code. <rdar://problem/13249661>. llvm-svn: 178284
* Remove -O3.Akira Hatanaka2013-03-281-3/+3
| | | | llvm-svn: 178278
* Revert "Adding DIImportedModules to DIScopes."David Blaikie2013-03-286-47/+47
| | | | | | | | | This reverts commit 342d92c7a0adeabc9ab00f3f0d88d739fe7da4c7. Turns out we're going with a different schema design to represent DW_TAG_imported_modules so we won't need this extra field. llvm-svn: 178215
* Check if Type is a vector before calling function Type::getVectorNumElements.Akira Hatanaka2013-03-281-0/+15
| | | | llvm-svn: 178208
* Added back in the test for arc-annotations.Michael Gottesman2013-03-271-0/+307
| | | | | | | | | The test was removed since I had not turned off the test during release builds. This fails since ARC annotations support is conditionally compiled out during release builds. I added the proper requires header to assuage this issue. llvm-svn: 178101
* Adding DIImportedModules to DIScopes.David Blaikie2013-03-276-47/+47
| | | | | | | | | | | | This is just the basic groundwork for supporting DW_TAG_imported_module but I wanted to commit this before pushing support further into Clang or LLVM so that this rather churny change is isolated from the rest of the work. The major churn here is obviously adding another field (within the common DIScope prefix) to all DIScopes (files, classes, namespaces, lexical scopes, etc). This should be the last big churny change needed for DW_TAG_imported_module/using directive support/PR14606. llvm-svn: 178099
* Add test case for commit r178031.Ulrich Weigand2013-03-261-0/+50
| | | | llvm-svn: 178038
* Remove testcase. It's failing on some platforms but not others.Bill Wendling2013-03-261-306/+0
| | | | llvm-svn: 177956
* Hmm...not failing...oddBill Wendling2013-03-261-1/+0
| | | | llvm-svn: 177955
* Temporarily XFAIL this test until Michael can look at it.Bill Wendling2013-03-261-0/+1
| | | | llvm-svn: 177953
* [ObjCARC Annotations] Added support for displaying the state of pointers at ↵Michael Gottesman2013-03-261-0/+306
| | | | | | | | | | | | | | | | | | | | | | | the bottom/top of BBs of the ARC dataflow analysis for both bottomup and topdown analyses. This will allow for verification and analysis of the merge function of the data flow analyses in the ARC optimizer. The actual implementation of this feature is by introducing calls to the functions llvm.arc.annotation.{bottomup,topdown}.{bbstart,bbend} which are only declared. Each such call takes in a pointer to a global with the same name as the pointer whose provenance is being tracked and a pointer whose name is one of our Sequence states and points to a string that contains the same name. To ensure that the optimizer does not consider these annotations in any way, I made it so that the annotations are considered to be of IC_None type. A test case is included for this commit and the previous ObjCARCAnnotation commit. llvm-svn: 177952
* Add an optimizer-side test case for ARC bug <rdar://13195034>, fixedJohn McCall2013-03-251-0/+63
| | | | | | in the frontend with @clang.arc.use. llvm-svn: 177928
* Fix a bug in fast-math fadd/fsub simplification. Shuxin Yang2013-03-251-0/+10
| | | | | | | | | | | The problem is that the code mistakenly took for granted that following constructor is able to create an APFloat from a *SIGNED* integer: APFloat::APFloat(const fltSemantics &ourSemantics, integerPart value) rdar://13486998 llvm-svn: 177906
* Disable, for now, llvm/test/Transforms/GCOVProfiling on win32. I'll ↵NAKAMURA Takumi2013-03-252-0/+4
| | | | | | investigate them later. llvm-svn: 177894
* Address issues found by Duncan during post-commit review of r177856.Arnaud A. de Grandmaison2013-03-251-2/+2
| | | | llvm-svn: 177863
* InstCombine: simplify comparisons to zero of (shl %x, Cst) or (mul %x, Cst)Arnaud A. de Grandmaison2013-03-251-0/+142
| | | | | | | | This simplification happens at 2 places : - using the nsw attribute when the shl / mul is used by a sign test - when the shl / mul is compared for (in)equality to zero llvm-svn: 177856
* Kill every call to @clang.arc.use in the ARC contract phase.John McCall2013-03-221-0/+11
| | | | llvm-svn: 177769
* Update test. There may be multiple catches, but those will be cleaned up.Bill Wendling2013-03-221-0/+5
| | | | llvm-svn: 177758
* InstCombine: Improve the result bitvect type when folding (cmp pred (load ↵Arnaud A. de Grandmaison2013-03-221-0/+12
| | | | | | | | | | | | | | | (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 llvm-svn: 177712
* Move the DIFile in DISubprogram to the beginning to be a common prefix along ↵David Blaikie2013-03-211-1/+1
| | | | | | with other DIScopes llvm-svn: 177674
* Remove unused field in DISubprogramDavid Blaikie2013-03-216-9/+9
| | | | llvm-svn: 177661
* Update some EH tests that were violating the new EH model.Bill Wendling2013-03-213-6/+16
| | | | | | | The landingpad instruction needs to be the first non-PHI instruction in the unwind destination block. llvm-svn: 177650
* Move library call prototype attribute inference to functionattrsMeador Inge2013-03-215-22/+41
| | | | | | | | | | | | The simplify-libcalls pass implemented a doInitialization hook to infer function prototype attributes for well-known functions. Given that the simplify-libcalls pass is going away *and* that the functionattrs pass is already in place to deduce function attributes, I am moving this logic to the functionattrs pass. This approach was discussed during patch review: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157465.html. llvm-svn: 177619
* Remove unused field in DICompileUnitDavid Blaikie2013-03-202-2/+2
| | | | llvm-svn: 177590
* Don't assume the test directory is writable, use %T to find a writableNick Lewycky2013-03-202-8/+8
| | | | | | directory. llvm-svn: 177488
* IndVarSimplify: do not recompute an IV value outside of the loop if :Arnaud A. de Grandmaison2013-03-191-0/+69
| | | | | | | - it is trivially known to be used inside the loop in a way that can not be optimized away - there is no use outside of the loop which can take advantage of the computation hoisting llvm-svn: 177432
* Emit the linkage name instead of the function name, when available. This meansNick Lewycky2013-03-191-0/+25
| | | | | | that we'll prefer to emit the mangled C++ name (pending a clang change). llvm-svn: 177371
* Check whether a pointer is non-null (isKnownNonNull) in isKnownNonZero.Manman Ren2013-03-181-0/+11
| | | | | | | | This handles the case where we have an inbounds GEP with alloca as the pointer. This fixes the regression in PR12750 and rdar://13286434. Note that we can also fix this by handling some GEP cases in isKnownNonNull. llvm-svn: 177321
* Initially forgotten-to-svn-add test case for r177279.David Tweed2013-03-181-0/+14
| | | | llvm-svn: 177280
* Reduced dont-infinite-loop-during-block-escape-analysis.ll with bugpoint and ↵Michael Gottesman2013-03-172-87/+27
| | | | | | | | | | moved it to retain-block-escape-analysis.ll. *NOTE* I verified that the original bug behind dont-infinite-loop-during-block-escape-analysis.ll occurs when using opt on retain-block-escape-analysis.ll. llvm-svn: 177240
* Split out filename & directory from DIFile to start generalizing over DIScopesDavid Blaikie2013-03-175-7/+13
| | | | | | | | | | This is the first step to making all DIScopes have a common metadata prefix (so that things (using directives, for example) that can appear in any scope can be added to that common prefix). DIFile is itself a DIScope so the common prefix of all DIScopes cannot be a DIFile - instead it's the raw filename/directory name pair. llvm-svn: 177239
* Generalize debug info test to be resilient to changes in metadata node numberingDavid Blaikie2013-03-171-3/+4
| | | | llvm-svn: 177238
* The promised test case for r175939.Michael Gottesman2013-03-171-0/+100
| | | | | | | | This test makes sure that the ObjCARC escape analysis looks at the uses of instructions which copy the block pointer value by checking all four cases where that can occur. llvm-svn: 177232
* LoopVectorizer: Insert some white space to make test case more readableArnold Schwaighofer2013-03-141-6/+10
| | | | | | Also remove some unneeded function attributes. llvm-svn: 177114
* Add missing asserts flag to test - it uses debug flagsArnold Schwaighofer2013-03-141-1/+1
| | | | llvm-svn: 177102
* LoopVectorize: Invert case when we use a vector cmp value to query select costArnold Schwaighofer2013-03-141-0/+62
| | | | | | | We generate a select with a vectorized condition argument when the condition is NOT loop invariant. Not the other way around. llvm-svn: 177098
* Perform factorization as a last resort of unsafe fadd/fsub simplification.Shuxin Yang2013-03-141-0/+105
| | | | | | | | | | | | | | | Rules include: 1)1 x*y +/- x*z => x*(y +/- z) (the order of operands dosen't matter) 2) y/x +/- z/x => (y +/- z)/x The transformation is disabled if the new add/sub expr "y +/- z" is a denormal/naz/inifinity. rdar://12911472 llvm-svn: 177088
* PR14972: SROA vs. GVN exposed a really bad bug in SROA.Chandler Carruth2013-03-142-16/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fundamental problem is that SROA didn't allow for overly wide loads where the bits past the end of the alloca were masked away and the load was sufficiently aligned to ensure there is no risk of page fault, or other trapping behavior. With such widened loads, SROA would delete the load entirely rather than clamping it to the size of the alloca in order to allow mem2reg to fire. This was exposed by a test case that neatly arranged for GVN to run first, widening certain loads, followed by an inline step, and then SROA which miscompiles the code. However, I see no reason why this hasn't been plaguing us in other contexts. It seems deeply broken. Diagnosing all of the above took all of 10 minutes of debugging. The really annoying aspect is that fixing this completely breaks the pass. ;] There was an implicit reliance on the fact that no loads or stores extended past the alloca once we decided to rewrite them in the final stage of SROA. This was used to encode information about whether the loads and stores had been split across multiple partitions of the original alloca. That required threading explicit tracking of whether a *use* of a partition is split across multiple partitions. Once that was done, another problem arose: we allowed splitting of integer loads and stores iff they were loads and stores to the entire alloca. This is a really arbitrary limitation, and splitting at least some integer loads and stores is crucial to maximize promotion opportunities. My first attempt was to start removing the restriction entirely, but currently that does Very Bad Things by causing *many* common alloca patterns to be fully decomposed into i8 operations and lots of or-ing together to produce larger integers on demand. The code bloat is terrifying. That is still the right end-goal, but substantial work must be done to either merge partitions or ensure that small i8 values are eagerly merged in some other pass. Sadly, figuring all this out took essentially all the time and effort here. So the end result is that we allow splitting only when the load or store at least covers the alloca. That ensures widened loads and stores don't hurt SROA, and that we don't rampantly decompose operations more than we have previously. All of this was already fairly well tested, and so I've just updated the tests to cover the wide load behavior. I can add a test that crafts the pass ordering magic which caused the original PR, but that seems really brittle and to provide little benefit. The fundamental problem is that widened loads should Just Work. llvm-svn: 177055
* Remove a change to the debug info in this test, that I made while testingNick Lewycky2013-03-141-1/+1
| | | | | | something else and forgot to remove. llvm-svn: 177007
* Try using %S to find the emitted .gcno file.Nick Lewycky2013-03-141-5/+5
| | | | llvm-svn: 177006
* Refactor GCOV's six constructor arguments into a struct with a getter thatNick Lewycky2013-03-142-0/+28
| | | | | | | | | | constructs default arguments. It can now take default arguments from cl::opt'ions. Add a new -default-gcov-version=... option, and actually test it! Sink the reverse-order of the version into GCOVProfiling, hiding it from our users. llvm-svn: 177002
* Remove the unused 4th operand for DIFile debug info metadataDavid Blaikie2013-03-135-7/+9
| | | | llvm-svn: 176983
* Refactor filename/directory in DICompileUnit into a DIFileDavid Blaikie2013-03-133-5/+6
| | | | | | | This is the next step towards making the metadata for DIScopes have a common prefix rather than having to delegate based on their tag type. llvm-svn: 176913
* Remove unused "isMain" field from DICompileUnitDavid Blaikie2013-03-123-3/+3
| | | | llvm-svn: 176910
* Update debug info test cases with empty SplitDebugFilename field.David Blaikie2013-03-121-1/+1
| | | | | | | | | | | | This could be 'null' or the empty string, DIDescriptor::getStringField coalesces the two cases anyway so it's just a matter of legible/efficient representation. The change in behavior of the DICompileUnit::get* functions could be subsumed by the full verification check - but ideally that should just be an assertion if we could front-load the actual debug info metadata failure paths. llvm-svn: 176907
* Revert the test moves from 176733. Use "REQUIRES: asserts" instead.Jan Wen Voung2013-03-1228-40/+18
| | | | llvm-svn: 176873
* Upgrading debug info test cases to be (more) compatible with the current ↵David Blaikie2013-03-114-46/+47
| | | | | | | | | | | | debug info format. These cases were found by further work to remove support for debug info versioning. Common cleanups (other than changing the version info in the tag field) included adding the last parameter to compile_units (recently added for fission support) and other cases of trailing fields in lexical blocks, compile units, and subprograms. llvm-svn: 176834
* Don't remove a landing pad if the invoke requires a table entry.Bill Wendling2013-03-111-0/+77
| | | | | | | | An invoke may require a table entry. For instance, when the function it calls is expected to throw. <rdar://problem/13360379> llvm-svn: 176827
* Fix test case.Benjamin Kramer2013-03-091-2/+2
| | | | llvm-svn: 176773
OpenPOWER on IntegriCloud