summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
...
* Updated the documentation in ObjCARC.cpp to fit the style guide better (i.e. ↵Michael Gottesman2013-01-141-232/+259
| | | | | | use doxygen). Still some work to do though. llvm-svn: 172371
* Fixed an infinite loop in the block escape in analysis in ObjCARC caused by ↵Michael Gottesman2013-01-131-3/+14
| | | | | | | | 2x blocks each assigned a value via a phi-node causing each to depend on the other. A test case is provided as well. llvm-svn: 172368
* Remove redundant 'llvm::' qualificationsDmitri Gribenko2013-01-131-1/+1
| | | | llvm-svn: 172358
* Fix PR14547. Handle induction variables of small sizes smaller than i32 (i8 ↵Nadav Rotem2013-01-131-0/+3
| | | | | | and i16). llvm-svn: 172348
* [ObjCARC] Even more debug messages!Michael Gottesman2013-01-131-1/+17
| | | | llvm-svn: 172347
* [ObjCARC] More debug messages.Michael Gottesman2013-01-131-4/+29
| | | | llvm-svn: 172346
* Fix an editor goof in r171738 that Bill spotted. He may even have a testChandler Carruth2013-01-121-1/+1
| | | | | | | | case, but looking at the diff this was an obviously unintended change. Thanks for the careful review Bill! =] llvm-svn: 172336
* GlobalOpt: Avoid jump on uninitialized value.Benjamin Kramer2013-01-121-1/+1
| | | | | | Found by valgrind. llvm-svn: 172318
* Fixed debug message in ObjCARC.Michael Gottesman2013-01-121-2/+2
| | | | llvm-svn: 172299
* Fixed a few debug messages in ObjCARC and added one.Michael Gottesman2013-01-121-3/+5
| | | | llvm-svn: 172298
* Fixed bug in ObjCARC where we were changing a call from objc_autoreleaseRV ↵Michael Gottesman2013-01-121-3/+6
| | | | | | => objc_autorelease but were not updating the InstructionClass to IC_Autorelease. llvm-svn: 172288
* Fixed a bug where we were tail calling objc_autorelease causing an object to ↵Michael Gottesman2013-01-121-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not be placed into an autorelease pool. The reason that this occurs is that tail calling objc_autorelease eventually tail calls -[NSObject autorelease] which supports fast autorelease. This can cause us to violate the semantic gaurantees of __autoreleasing variables that assignment to an __autoreleasing variables always yields an object that is placed into the innermost autorelease pool. The fix included in this patch works by: 1. In the peephole optimization function OptimizeIndividualFunctions, always remove tail call from objc_autorelease. 2. Whenever we convert to/from an objc_autorelease, set/unset the tail call keyword as appropriate. *NOTE* I also handled the case where objc_autorelease is converted in OptimizeReturns to an autoreleaseRV which still violates the ARC semantics. I will be removing that in a later patch and I wanted to make sure that the tree is in a consistent state vis-a-vis ARC always. Additionally some test cases are provided and all tests that have tail call marked objc_autorelease keywords have been modified so that tail call has been removed. *NOTE* One test fails due to a separate bug that I am going to commit soon. Thus I marked the check line TMP: instead of CHECK: so make check does not fail. llvm-svn: 172287
* Fixed whitespace.Michael Gottesman2013-01-111-61/+61
| | | | llvm-svn: 172271
* Added debug messages to GlobalOpt.Michael Gottesman2013-01-111-17/+110
| | | | | | | | | Specifically: 1. Added a missing new line when we emit a debug message saying that we are marking a global variable as constant. 2. Added debug messages that describe what is occuring when GlobalOpt is evaluating a block/function. 3. Added a debug message that says what specific constructor is being evaluated. llvm-svn: 172247
* ARM Cost Model: We need to detect the max bitwidth of types in the loop in ↵Nadav Rotem2013-01-111-6/+12
| | | | | | | | | | | order to select the max vectorization factor. We don't have a detailed analysis on which values are vectorized and which stay scalars in the vectorized loop so we use another method. We look at reduction variables, loads and stores, which are the only ways to get information in and out of loop iterations. If the data types are extended and truncated then the cost model will catch the cost of the vector zext/sext/trunc operations. llvm-svn: 172178
* PR14904: Segmentation fault running pass 'Recognize loop idioms'Shuxin Yang2013-01-101-1/+1
| | | | | | | | The root cause is mistakenly taking for granted that "dyn_cast<Instruction>(a-Value)" return a non-NULL instruction. llvm-svn: 172145
* [msan] Change va_start/va_copy shadow memset alignment to 8.Peter Collingbourne2013-01-101-2/+2
| | | | | | | | | This fixes va_start/va_copy of a va_list field which happens to not be laid out at a 16-byte boundary. Differential Revision: http://llvm-reviews.chandlerc.com/D276 llvm-svn: 172128
* Teach InstCombine to hoist FABS and FNEG through FPTRUNC instructions. The ↵Owen Anderson2013-01-101-1/+27
| | | | | | application of these operations commutes with the truncation, so we should prefer to do them in the smallest size we can, to save register space, use smaller constant pool entries, etc. llvm-svn: 172117
* LoopVectorizer: Fix a bug in the vectorization of BinaryOperators. The ↵Nadav Rotem2013-01-101-4/+4
| | | | | | | | BinaryOperator can be folded to an Undef, and we don't want to set NSW flags to undef vals. PR14878 llvm-svn: 172079
* Fix TryToShrinkGlobalToBoolean in GlobalOpt, so that it does not discard ↵Joey Gouly2013-01-101-1/+2
| | | | | | address spaces. llvm-svn: 172051
* [ObjCARC Debug Message] Added debug message when we convert an autorelease ↵Michael Gottesman2013-01-101-0/+6
| | | | | | into an autoreleaseRV. llvm-svn: 172034
* ARM Cost model: Use the size of vector registers and widest vectorizable ↵Nadav Rotem2013-01-091-3/+48
| | | | | | instruction to determine the max vectorization factor. llvm-svn: 172010
* [ObjCARC Debug Messages] This is a squashed commit of 3x debug message ↵Michael Gottesman2013-01-091-0/+24
| | | | | | | | | | commits ala echristo's suggestion. 1. Added debug messages when in OptimizeIndividualCalls we move calls into predecessors and then erase the original call. 2. Added debug messages when in the process of moving calls in ObjCARCOpt::MoveCalls we create new RR and delete old RR. 3. Added a debug message when we visit a specific retain instruction in ObjCARCOpt::PerformCodePlacement. llvm-svn: 171988
* LICM: Hoist insertvalue/extractvalue out of loops.Benjamin Kramer2013-01-091-7/+6
| | | | | | Fixes PR14854. llvm-svn: 171984
* Cost Model: Move the 'max unroll factor' variable to the TTI and add initial ↵Nadav Rotem2013-01-091-3/+2
| | | | | | Cost Model support on ARM. llvm-svn: 171928
* Consider expression "0.0 - X" as the negation of X ifShuxin Yang2013-01-092-3/+3
| | | | | | | - this expression is explicitly marked no-signed-zero, or - no-signed-zero of this expression can be derived from some context. llvm-svn: 171922
* Code cleanup: refactor the switch statements in the generation of reduction ↵Nadav Rotem2013-01-081-59/+28
| | | | | | variables into an IR builder call. llvm-svn: 171871
* Rename the enum members to match the LLVM coding style.Nadav Rotem2013-01-081-25/+25
| | | | llvm-svn: 171868
* Make sure we don't emit instructions before a landingpad instruction.Bill Wendling2013-01-081-1/+6
| | | | | | PR14782 llvm-svn: 171846
* LoopVectorizer: Add support for floating point reductionsNadav Rotem2013-01-071-58/+91
| | | | llvm-svn: 171812
* Cosmetical changne in order to conform to coding std.Shuxin Yang2013-01-071-5/+6
| | | | | | Thank Eric Christopher for figuring out these problems! llvm-svn: 171805
* LoopVectorizer: When we vectorizer and widen loops we process many elements ↵Nadav Rotem2013-01-071-3/+15
| | | | | | | | | at once. This is a good thing, except for small loops. On small loops post-loop that handles scalars (and runs slower) can take more time to execute than the rest of the loop. This patch disables widening of loops with a small static trip count. llvm-svn: 171798
* This change is to implement following rules:Shuxin Yang2013-01-072-0/+129
| | | | | | | | | | | o. X/C1 * C2 => X * (C2/C1) (if C2/C1 is neither special FP nor denormal) o. X/C1 * C2 -> X/(C1/C2) (if C2/C1 is either specical FP or denormal, but C1/C2 is a normal Fp) Let MDC denote multiplication or dividion with one & only one operand being a constant o. (MDC ± C1) * C2 => (MDC * C2) ± (C1 * C2) (so long as the constant-folding doesn't yield any denormal or special value) llvm-svn: 171793
* Fixed EOL whitespace.Michael Gottesman2013-01-071-29/+29
| | | | llvm-svn: 171791
* When code size is the priority (Oz, MinSize attribute), help llvmQuentin Colombet2013-01-072-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | turning a code like this: if (foo) free(foo) into that: free(foo) Move a call to free from basic block FB into FB's predecessor, P, when the path from P to FB is taken only if the argument of free is not equal to NULL. Some restrictions apply on P and FB to be sure that this code motion is profitable. Namely: 1. FB must have only one predecessor P. 2. FB must contain only the call to free plus an unconditional branch to S. 3. P's successors are FB and S. Because of 1., we will not increase the code size when moving the call to free from FB to P. Because of 2., FB will be empty after the move. Because of 2. and 3., P's branch instruction becomes useless, so as FB (simplifycfg will do the job). llvm-svn: 171762
* Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.Chandler Carruth2013-01-072-2/+2
| | | | llvm-svn: 171749
* Move CallGraphSCCPass.h into the Analysis tree; that's where theChandler Carruth2013-01-073-3/+3
| | | | | | implementation lives already. llvm-svn: 171746
* Remove the long defunct 'DefaultPasses' header. We have a pass managerChandler Carruth2013-01-071-1/+0
| | | | | | | builder these days, and this thing hasn't seen updates for a very long time. llvm-svn: 171741
* Sink AddrMode back into TargetLowering, removing one of the mostChandler Carruth2013-01-071-1/+1
| | | | | | | | | peculiar headers under include/llvm. This struct still doesn't make a lot of sense, but it makes more sense down in TargetLowering than it did before. llvm-svn: 171739
* Remove LSR's use of the random AddrMode struct. These variables wereChandler Carruth2013-01-071-68/+76
| | | | | | | | | | | | already in a class, just inline the four of them. I suspect that this class could be simplified some to not always keep distinct variables for these things, but it wasn't clear to me how given the usage so I opted for a trivial and mechanical translation. This removes one of the two remaining users of a header in include/llvm which does nothing more than define a 4 member struct. llvm-svn: 171738
* Switch the SCEV expander and LoopStrengthReduce to useChandler Carruth2013-01-071-161/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TargetTransformInfo rather than TargetLowering, removing one of the primary instances of the layering violation of Transforms depending directly on Target. This is a really big deal because LSR used to be a "special" pass that could only be tested fully using llc and by looking at the full output of it. It also couldn't run with any other loop passes because it had to be created by the backend. No longer is this true. LSR is now just a normal pass and we should probably lift the creation of LSR out of lib/CodeGen/Passes.cpp and into the PassManagerBuilder. =] I've not done this, or updated all of the tests to use opt and a triple, because I suspect someone more familiar with LSR would do a better job. This change should be essentially without functional impact for normal compilations, and only change behvaior of targetless compilations. The conversion required changing all of the LSR code to refer to the TTI interfaces, which fortunately are very similar to TargetLowering's interfaces. However, it also allowed us to *always* expect to have some implementation around. I've pushed that simplification through the pass, and leveraged it to simplify code somewhat. It required some test updates for one of two things: either we used to skip some checks altogether but now we get the default "no" answer for them, or we used to have no information about the target and now we do have some. I've also started the process of removing AddrMode, as the TTI interface doesn't use it any longer. In some cases this simplifies code, and in others it adds some complexity, but I think it's not a bad tradeoff even there. Subsequent patches will try to clean this up even further and use other (more appropriate) abstractions. Yet again, almost all of the formatting changes brought to you by clang-format. =] llvm-svn: 171735
* Make the MergeGlobals pass correctly handle the address space qualifiers of ↵Silviu Baranga2013-01-071-11/+24
| | | | | | the global variables. We partition the set of globals by their address space, and apply the same the trasnformation as before to merge them. llvm-svn: 171730
* Simplify LoopVectorize to require target transform info and rely on itChandler Carruth2013-01-071-55/+43
| | | | | | | | | being present. Make a member of one of the helper classes a reference as part of this. Reformatting goodness brought to you by clang-format. llvm-svn: 171726
* Merge the unused header file for LoopVectorizer into the source file.Chandler Carruth2013-01-072-538/+519
| | | | | | | | | | | | | | This makes the loop vectorizer match the pattern followed by roughly all other passses. =] Notably, this header file was braken in several regards: it contained a using namespace directive, global #define's that aren't globaly appropriate, and global constants defined directly in the header file. As a side benefit, lots of the types in this file become internal, which will cause the optimizer to chew on this pass more effectively. llvm-svn: 171723
* Switch BBVectorize to directly depend on having a TTI analysis.Chandler Carruth2013-01-071-4/+4
| | | | | | | | | | | | | This could be simplified further, but Hal has a specific feature for ignoring TTI, and so I preserved that. Also, I needed to use it because a number of tests fail when switching from a null TTI to the NoTTI nonce implementation. That seems suspicious to me and so may be something that you need to look into Hal. I worked it by preserving the old behavior for these tests with the flag that ignores all target info. llvm-svn: 171722
* Fix a slew of indentation and parameter naming style issues. This 80% ofChandler Carruth2013-01-071-42/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | this patch brought to you by the tool clang-format. I wanted to fix up the names of constructor parameters because they followed a bit of an anti-pattern by naming initialisms with CamelCase: 'Tti', 'Se', etc. This appears to have been in an attempt to not overlap with the names of member variables 'TTI', 'SE', etc. However, constructor arguments can very safely alias members, and in fact that's the conventional way to pass in members. I've fixed all of these I saw, along with making some strang abbreviations such as 'Lp' be simpler 'L', or 'Lgl' be the word 'Legal'. However, the code I was touching had indentation and formatting somewhat all over the map. So I ran clang-format and fixed them. I also fixed a few other formatting or doxygen formatting issues such as using ///< on trailing comments so they are associated with the correct entry. There is still a lot of room for improvement of the formating and cleanliness of this code. ;] At least a few parts of the coding standards or common practices in LLVM's code aren't followed, the enum naming rules jumped out at me. I may mix some of these while I'm here, but not all of them. llvm-svn: 171719
* Switch LoopIdiom pass to directly require target transform information.Chandler Carruth2013-01-071-3/+3
| | | | | | | | I'm sorry for duplicating bad style here, but I wanted to keep consistency. I've pinged the code review thread where this style was reviewed and changes were requested. llvm-svn: 171714
* Make SimplifyCFG simply depend upon TargetTransformInfo and pass itChandler Carruth2013-01-072-46/+52
| | | | | | | | | | | | | through as a reference rather than a pointer. There is always *some* implementation of this available, so this simplifies code by not having to test for whether it is available or not. Further, it turns out there were piles of places where SimplifyCFG was recursing and not passing down either TD or TTI. These are fixed to be more pedantically consistent even though I don't have any particular cases where it would matter. llvm-svn: 171691
* Fix the enumerator names for ShuffleKind to match tho coding standards,Chandler Carruth2013-01-071-2/+2
| | | | | | and make its comments doxygen comments. llvm-svn: 171688
* Make the popcnt support enums and methods have more clear names andChandler Carruth2013-01-071-1/+1
| | | | | | | follow the conding conventions regarding enumerating a set of "kinds" of things. llvm-svn: 171687
OpenPOWER on IntegriCloud