aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Remove Value::getNameLenDaniel Dunbar2009-07-261-7/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77148 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate some uses of DOUT, cerr, and getNameStart().Daniel Dunbar2009-07-263-217/+217
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77145 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Value::{isName, getNameRef}.Daniel Dunbar2009-07-252-2/+2
| | | | | | | Also, change MDString to use a StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77098 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial update to VMCore to use Twines for string arguments.Daniel Dunbar2009-07-252-3/+6
| | | | | | | | - The only meat here is in Value.{h,cpp} the rest is essential 'const std::string &' -> 'const Twine &'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77048 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 80-col violations.Eric Christopher2009-07-251-5/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77045 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ExtractElementInst to ::Create instead of new. Update all uses.Eric Christopher2009-07-252-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77044 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a few more things to use raw_ostream.Dan Gohman2009-07-251-14/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77039 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert a few more uses of llvm/Support/Streams.h to raw_ostream.Dan Gohman2009-07-253-23/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77033 91177308-0d34-0410-b5e6-96231b3b80d8
* Make AliasAnalysis and related classes useDan Gohman2009-07-252-2/+2
| | | | | | | getAnalysisIfAvailable<TargetData>(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77028 91177308-0d34-0410-b5e6-96231b3b80d8
* More migration to raw_ostream, the water has dried up around the iostream hole.Daniel Dunbar2009-07-2517-83/+107
| | | | | | | | | | | - Some clients which used DOUT have moved to DEBUG. We are deprecating the "magic" DOUT behavior which avoided calling printing functions when the statement was disabled. In addition to being unnecessary magic, it had the downside of leaving code in -Asserts builds, and of hiding potentially unnecessary computations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-2422-270/+268
| | | | | | thanks to contexts-on-types. More to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
* AliasAnalysis wants sizes in address-units, not bits.Dan Gohman2009-07-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77009 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this condition I accidentally inverted.Dan Gohman2009-07-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76988 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert several more passes to use getAnalysisIfAvailable<TargetData>()Dan Gohman2009-07-244-30/+31
| | | | | | | instead of getAnalysis<TargetData>(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76982 91177308-0d34-0410-b5e6-96231b3b80d8
* Move more to raw_ostream, provide support for writing MachineBasicBlock,Daniel Dunbar2009-07-241-3/+6
| | | | | | | LiveInterval, etc to raw_ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76965 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch to getNameStr().Daniel Dunbar2009-07-242-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76962 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert StringMap to using StringRef for its APIs.Daniel Dunbar2009-07-231-1/+1
| | | | | | | | | | | | | - Yay for '-'s and simplifications! - I kept StringMap::GetOrCreateValue for compatibility purposes, this can eventually go away. Likewise the StringMapEntry Create functions still follow the old style. - NIFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76888 91177308-0d34-0410-b5e6-96231b3b80d8
* refactor a blob of code out to a new 'FoldOrOfFCmps' function andChris Lattner2009-07-231-67/+70
| | | | | | | simplify it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76866 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some existing optimizations that would only trigger on scalarsChris Lattner2009-07-231-2/+20
| | | | | | | | | | | | | | | | | | | | | | | also apply to vectors. This allows us to compile this: #include <emmintrin.h> __m128i a(__m128 a, __m128 b) { return a==a & b==b; } __m128i b(__m128 a, __m128 b) { return a!=a | b!=b; } to: _a: cmpordps %xmm1, %xmm0 ret _b: cmpunordps %xmm1, %xmm0 ret with clang instead of to a ton of horrible code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76863 91177308-0d34-0410-b5e6-96231b3b80d8
* refactor a bunch of code out into a helper function,Chris Lattner2009-07-231-63/+73
| | | | | | | | no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76859 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary store to temporary std::string.Daniel Dunbar2009-07-221-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76782 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't give a massive inlining cost bonus to available_externally Eli Friedman2009-07-221-2/+1
| | | | | | | | | | functions with a single use; eliminating the single use may eliminate the function from the current module, but usually doesn't eliminate it from the final program. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76730 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the Pass+Context magic.Owen Anderson2009-07-2259-460/+514
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert instcombine from using using getAnalysis<TargetData> toDan Gohman2009-07-211-46/+62
| | | | | | | getAnalysisIfAvailable<TargetData>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76676 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getConstantInt{True|False} to get{True|False} at Chris' behest.Owen Anderson2009-07-217-107/+107
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76598 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake files.Ted Kremenek2009-07-212-5/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76595 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a bit more state over to the LLVMContext.Owen Anderson2009-07-211-14/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76533 91177308-0d34-0410-b5e6-96231b3b80d8
* use ExpandInlineAsm on TargetLowering instead of TargetAsmInfo.Chris Lattner2009-07-201-14/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76442 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the addition of hasNoPointerOverflow to GEPOperator.Dan Gohman2009-07-201-84/+1
| | | | | | | | | | | | | Getelementptrs that are defined to wrap are virtually useless to optimization, and getelementptrs that are undefined on any kind of overflow are too restrictive -- it's difficult to ensure that all intermediate addresses are within bounds. I'm going to take a different approach. Remove a few optimizations that depended on this flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76437 91177308-0d34-0410-b5e6-96231b3b80d8
* implement a new magic global "llvm.compiler.used" which is like llvm.used, butChris Lattner2009-07-202-21/+18
| | | | | | | doesn't cause ".no_dead_strip" to be emitted on darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76399 91177308-0d34-0410-b5e6-96231b3b80d8
* Add plumbing for the `linker_private' linkage type. This type is meant forBill Wendling2009-07-201-0/+1
| | | | | | | | | | "private" symbols which the assember shouldn't strip, but which the linker may remove after evaluation. This is mostly useful for Objective-C metadata. This is plumbing, so we don't have a use of it yet. More to come, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76385 91177308-0d34-0410-b5e6-96231b3b80d8
* Canonicalize bitcasts between types like <1 x i64> and i64 to Eli Friedman2009-07-181-0/+24
| | | | | | | | | | | | insertelement/extractelement. I'm not entirely sure this is precisely what we want to do: should we prefer bitcast(insertelement) or insertelement(bitcast)? Similarly. should we prefer extractelement(bitcast) or bitcast(extractelement)? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76345 91177308-0d34-0410-b5e6-96231b3b80d8
* Back out 76300; apparently the preference is to canonicalize the other Eli Friedman2009-07-181-16/+6
| | | | | | | | way (bitcast -> insert/extractelement). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76325 91177308-0d34-0410-b5e6-96231b3b80d8
* add a fixmeChris Lattner2009-07-181-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76324 91177308-0d34-0410-b5e6-96231b3b80d8
* Add combine: X sdiv (1 << Y) -> X udiv (1 << Y) when X doesn't have the Eli Friedman2009-07-181-4/+15
| | | | | | | | sign bit set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76304 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove no-op check.Eli Friedman2009-07-181-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76302 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead check.Eli Friedman2009-07-181-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76301 91177308-0d34-0410-b5e6-96231b3b80d8
* Canonicalize insert/extractelement from single-element vectors into Eli Friedman2009-07-181-6/+16
| | | | | | | | | | | bitcasts. It would also be possible to canonicalize the other way; does anyone have a preference? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76300 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix simplifylibcalls memset recognition to work on 64-bit platforms Eli Friedman2009-07-181-2/+2
| | | | | | | | where int is 32 bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76293 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace intersectWith with maximalIntersectWith. The latter guarantees thatNick Lewycky2009-07-181-10/+10
| | | | | | | | | all values belonging to the intersection will belong to the resulting range. The former was inconsistent about that point (either way is fine, just pick one.) This is part of PR4545. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76289 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the inline cost calculation to take into account instructions Eli Friedman2009-07-181-0/+7
| | | | | | | | | which cannot be folded even if they have constant operands. Significantly helps if_spppsubr.c attached to PR4573. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76285 91177308-0d34-0410-b5e6-96231b3b80d8
* Add line breaks to make the debug output a bit more readable.Eli Friedman2009-07-181-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76284 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert more code to use Operator instead of explicitly handling bothDan Gohman2009-07-171-23/+6
| | | | | | | | ConstantExpr and Instruction. This involves duplicating some code between GetElementPtrInst and GEPOperator, but it's not a lot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76265 91177308-0d34-0410-b5e6-96231b3b80d8
* Make BasicAliasAnalysis and Value::getUnderlyingObject useDan Gohman2009-07-171-4/+16
| | | | | | | | | GEPOperator's hasNoPointer0verflow(), and make a few places in instcombine that create GEPs that may overflow clear the NoOverflow value. Among other things, this partially addresses PR2831. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76252 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some typos in a comment.Dan Gohman2009-07-171-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76249 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new Operator class, for handling Instructions and ConstantExprsDan Gohman2009-07-171-13/+3
| | | | | | | | | | in a convenient manner, factoring out some common code from InstructionCombining and ValueTracking. Move the contents of BinaryOperators.h into Operator.h and use Operator to generalize them to support ConstantExprs as well as Instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76232 91177308-0d34-0410-b5e6-96231b3b80d8
* Initialize another Context, in the hopes of unbreaking CBE.Daniel Dunbar2009-07-171-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76184 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace isTrapping with a new, similar method called Eli Friedman2009-07-173-25/+10
| | | | | | | | | | | | isSafeToSpeculativelyExecute. The new method is a bit closer to what the callers actually care about in that it rejects more things callers don't want. It also adds more precise handling for integer division, and unifies code for analyzing the legality of a speculative load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76150 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a ↵Owen Anderson2009-07-1619-10/+49
| | | | | | | | | number of issues in our current context-passing stuff, which is also fixed here git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76089 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert yesterday's change by removing the LLVMContext parameter to ↵Owen Anderson2009-07-1517-49/+38
| | | | | | AllocaInst and MallocInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75863 91177308-0d34-0410-b5e6-96231b3b80d8