summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix typo.Julien Lerouge2012-10-231-1/+1
| | | | llvm-svn: 166456
* Explain why DenseMap is still used here instead of MapVector.Julien Lerouge2012-10-231-1/+9
| | | | llvm-svn: 166454
* Iterating over a DenseMap<std::pair<BasicBlock*, unsigned>, PHINode*> is notJulien Lerouge2012-10-221-4/+4
| | | | | | | | | deterministic, replace it with a DenseMap<std::pair<unsigned, unsigned>, PHINode*> (we already have a map from BasicBlock to unsigned). <rdar://problem/12541389> llvm-svn: 166435
* revert r166264 because the LTO build is still failingNadav Rotem2012-10-191-19/+13
| | | | llvm-svn: 166340
* Move SplitBlockAndInsertIfThen to BasicBlockUtils.Evgeniy Stepanov2012-10-191-0/+39
| | | | llvm-svn: 166278
* recommit the patch that makes LSR and LowerInvoke use the TargetTransform ↵Nadav Rotem2012-10-191-13/+19
| | | | | | interface. llvm-svn: 166264
* Cosmetic change -- move two simplifiers to the right commented statement group.Meador Inge2012-10-181-2/+2
| | | | llvm-svn: 166199
* instcombine: Migrate strcpy optimizationsMeador Inge2012-10-181-2/+49
| | | | | | | | | | | | This patch migrates the strcpy optimizations from the simplify-libcalls pass into the instcombine library call simplifier. Note also that StrCpyChkOpt has been updated with a few simplifications that were being done in the simplify-libcalls version of StrCpyOpt, but not in the migrated implementation of StrCpyOpt. There is no reason to overload StrCpyOpt with fortified and regular simplifications in the new model since there is already a dedicated simplifier for __strcpy_chk. llvm-svn: 166198
* Temporarily revert the TargetTransform changes.Bob Wilson2012-10-181-19/+13
| | | | | | | | | | | 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
* Resubmit the changes to llvm core to update the functions to support ↵Micah Villmow2012-10-151-1/+2
| | | | | | different pointer sizes on a per address space basis. llvm-svn: 165941
* Add an enum for the return and function indexes into the AttrListPtr object. ↵Bill Wendling2012-10-152-15/+24
| | | | | | This gets rid of some magic numbers. llvm-svn: 165924
* Attributes RewriteBill Wendling2012-10-151-27/+33
| | | | | | | | | | Convert the internal representation of the Attributes class into a pointer to an opaque object that's uniqued by and stored in the LLVMContext object. The Attributes class then becomes a thin wrapper around this opaque object. Eventually, the internal representation will be expanded to include attributes that represent code generation options, etc. llvm-svn: 165917
* instcombine: Migrate strcmp and strncmp optimizationsMeador Inge2012-10-151-0/+99
| | | | | | | This patch migrates the strcmp and strncmp optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 165915
* Simplify code. No functionality change.Benjamin Kramer2012-10-141-5/+3
| | | | llvm-svn: 165904
* Remove the bitwise assignment OR operator from the Attributes class. Replace ↵Bill Wendling2012-10-141-2/+4
| | | | | | it with the equivalent from the builder class. llvm-svn: 165895
* Remove unused private field.Benjamin Kramer2012-10-131-1/+0
| | | | llvm-svn: 165881
* instcombine: Migrate strchr and strrchr optimizationsMeador Inge2012-10-131-0/+86
| | | | | | | This patch migrates the strchr and strrchr optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 165875
* instcombine: Migrate strcat and strncat optimizationsMeador Inge2012-10-131-0/+106
| | | | | | | This patch migrates the strcat and strncat optimizations from the simplify-libcalls pass into the instcombine library call simplifier. llvm-svn: 165874
* Implement new LibCallSimplifier classMeador Inge2012-10-132-0/+290
| | | | | | | | | | | | | | | | This patch implements the new LibCallSimplifier class as outlined in [1]. In addition to providing the new base library simplification infrastructure, all the fortified library call simplifications were moved over to the new infrastructure. The rest of the library simplification optimizations will be moved over with follow up patches. NOTE: The original fortified library call simplifier located in the SimplifyFortifiedLibCalls class was not removed because it is still used by CodeGenPrepare. This class will eventually go away too. [1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-August/052283.html llvm-svn: 165873
* PGO: create metadata for switch only if it has more than one targets.Manman Ren2012-10-111-1/+1
| | | | | | | When all cases of a switch statement are dead, the weights vector only has one element, and we will get an ssertion failure when calling createBranchWeights. llvm-svn: 165759
* Revert 165732 for further review.Micah Villmow2012-10-111-2/+1
| | | | llvm-svn: 165747
* Add in the first iteration of support for llvm/clang/lldb to allow variable ↵Micah Villmow2012-10-111-1/+2
| | | | | | per address space pointer sizes to be optimized correctly. llvm-svn: 165726
* Add a new interface to allow IR-level passes to access codegen-specific ↵Nadav Rotem2012-10-101-13/+19
| | | | | | information. llvm-svn: 165665
* Pass into the AttributeWithIndex::get method an ArrayRef of attributeBill Wendling2012-10-101-31/+33
| | | | | | enums. These are then created via the correct Attributes creation method. llvm-svn: 165607
* Have 'addFnAttr' take the attribute enum value. Then have it build the ↵Bill Wendling2012-10-101-1/+1
| | | | | | attribute object and add it appropriately. No functionality change. llvm-svn: 165595
* Move TargetData to DataLayout.Micah Villmow2012-10-089-53/+53
| | | | llvm-svn: 165402
* This patch corrects commit 165126 by using an integer bit width instead of Preston Gurd2012-10-041-9/+8
| | | | | | | | a pointer to a type, in order to remove the uses of getGlobalContext(). Patch by Tyler Nowicki. llvm-svn: 165255
* SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer ↵Benjamin Kramer2012-10-041-2/+3
| | | | | | | | | | dereference" optimization to also handle instructions with multiple uses. We conservatively only check the first use to avoid walking long use chains. This catches the common case of having both a load and a store to a pointer supplied by a PHI node. llvm-svn: 165232
* This Patch corrects a problem whereby the optimization to use a faster dividePreston Gurd2012-10-031-5/+15
| | | | | | | | | | | | | | instruction (for Intel Atom) was not being done by Clang, because the type context used by Clang is not the default context. It fixes the problem by getting the global context types for each div/rem instruction in order to compare them against the types in the BypassTypeMap. Tests for this will be done as a separate patch to Clang. Patch by Tyler Nowicki. llvm-svn: 165126
* SimplifyCFG: Don't crash when forming a switch bitmap with an undef default ↵Benjamin Kramer2012-10-011-2/+5
| | | | | | | | value. Fixes PR13985. llvm-svn: 164934
* SimplifyCFG: Enumerating all predecessors of a BB can be expensive ↵Benjamin Kramer2012-09-301-3/+7
| | | | | | | | (switches), avoid it if possible. No functionality change. llvm-svn: 164923
* Fix a integer overflow in SimplifyCFG's look up table formation logic.Benjamin Kramer2012-09-271-0/+4
| | | | | | | | If the width is very large it gets truncated from uint64_t to uint32_t when passed to TD->fitsInLegalInteger. The truncated value can fit in a register. This manifested in massive memory usage or crashes (PR13946). llvm-svn: 164784
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-272-2/+2
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 llvm-svn: 164768
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-272-2/+2
| | | | llvm-svn: 164767
* Address Duncan's comments on r164684:Hans Wennborg2012-09-261-9/+5
| | | | | | | | - Put statistics in alphabetical order - Don't use getZextValue when building TableInt, just use APInts - Introduce Create{Z,S}ExtOrTrunc in IRBuilder. llvm-svn: 164696
* Address Duncan's comments on r164682:Hans Wennborg2012-09-261-6/+4
| | | | | | | - Finish assert messages with exclamation mark - Move overflow checking into ShouldBuildLookupTable. llvm-svn: 164692
* SimplifyCFG: Make the switch-to-lookup table transformation store theHans Wennborg2012-09-261-12/+89
| | | | | | | | | | | | | | | | tables in bitmaps when they fit in a target-legal register. This saves some space, and it also allows for building tables that would otherwise be deemed too sparse. One interesting case that this hits is example 7 from http://blog.regehr.org/archives/320. We currently generate good code for this when lowering the switch to the selection DAG: we build a bitmask to decide whether to jump to one block or the other. My patch will result in the same bitmask, but it removes the need for the jump, as the return value can just be retrieved from the mask. llvm-svn: 164684
* SimplifyCFG: Refactor the switch-to-lookup table transformation byHans Wennborg2012-09-261-72/+115
| | | | | | breaking out the building of lookup tables into a separate class. llvm-svn: 164682
* Rename virtual table anchors from Anchor() to anchor() for consistency with ↵Craig Topper2012-09-261-1/+1
| | | | | | the rest of the tree. llvm-svn: 164666
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-261-7/+115
| | | | | | | | and u/srem. Fixed issue with Release build. llvm-svn: 164654
* Revert r164614 to appease the buildbots.Chad Rosier2012-09-251-115/+7
| | | | llvm-svn: 164627
* Expansions for u/srem, using the udiv expansion. More unit tests for udiv ↵Michael Ilseman2012-09-251-7/+115
| | | | | | and u/srem. llvm-svn: 164614
* SimplifyCFG: sink common codes from IF, ELSE blocks down to END block.Manman Ren2012-09-201-0/+173
| | | | | | | | | | | | We already have HoistThenElseCodeToIf, this patch implements SinkThenElseCodeToEnd. When END block has only two predecessors and each predecessor terminates with unconditional branches, we compare instructions in IF and ELSE blocks backwards and check whether we can sink the common instructions down. rdar://12191395 llvm-svn: 164325
* Renaming functions to match coding style guidelinesMichael Ilseman2012-09-191-4/+4
| | | | llvm-svn: 164238
* Doxygen-ify commentsMichael Ilseman2012-09-191-8/+16
| | | | llvm-svn: 164235
* Put the * and & next to the variable, rather than the type.Michael Ilseman2012-09-191-73/+73
| | | | llvm-svn: 164232
* SimplifyCFG: Don't generate invalid code for switch used to initializeHans Wennborg2012-09-191-9/+8
| | | | | | | | | | | | | two variables where the first variable is returned and the second ignored. I don't think this occurs in practice (other passes should have cleaned up the unused phi node), but it should still be handled correctly. Also make the logic for determining if we should return early less sketchy. llvm-svn: 164225
* IntegerDivision: Style cleanups, avoid warning about mixing || and && ↵Benjamin Kramer2012-09-191-7/+5
| | | | | | without parens. llvm-svn: 164216
* New utility for expanding integer division for targets that don't support it.Michael Ilseman2012-09-182-0/+307
| | | | | | Implementation derived from compiler-rt's implementation of signed and unsigned integer division. llvm-svn: 164173
* PGO: preserve branch-weight metadata when simplifying Switch to a sub, an icmpManman Ren2012-09-181-1/+38
| | | | | | and a conditional branch; also when removing dead cases from a switch. llvm-svn: 164084
OpenPOWER on IntegriCloud