summaryrefslogtreecommitdiff
path: root/lib/Transforms
Commit message (Collapse)AuthorAge
* Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrapDan Gohman2009-08-20
| | | | | | | and hasNoSignedWrap, for consistency with the nuw and nsw properties. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79539 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a few places to check if TargetData is available before using it.Dan Gohman2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79493 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SROA and PredicateSimplifier cope if TargetData is notDan Gohman2009-08-19
| | | | | | | available. This is very conservative for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79442 91177308-0d34-0410-b5e6-96231b3b80d8
* Use hasDefinitiveInitializer() instead of testing the same thingDan Gohman2009-08-19
| | | | | | | | by hand, and fix a few places that were using hasInitializer() that appear to depend on the initializer value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79441 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix up PHI nodes correctly in the presence of unreachable BBs, part two. AlsoNick Lewycky2009-08-19
| | | | | | | delete a newed pointer, and improve readability a little bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79411 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more careful when modifying PHI nodes. Patch by Andre Tavares.Nick Lewycky2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79407 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix SimplifyLibcalls and ValueTracking to check mayBeOverriddenDan Gohman2009-08-19
| | | | | | | before performing optimizations based on constant string values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79384 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug that caused globalopt to miscompile tramp3d: don't missDan Gohman2009-08-18
| | | | | | | unruly indices for arrays that are members of structs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79337 91177308-0d34-0410-b5e6-96231b3b80d8
* Make TargetData optional in MemCpyOptimizer.Dan Gohman2009-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79306 91177308-0d34-0410-b5e6-96231b3b80d8
* Make TargetData optional in SimplifyLibCalls.Dan Gohman2009-08-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79298 91177308-0d34-0410-b5e6-96231b3b80d8
* The attached patches attempt to fix cross builds. For example, if youAnton Korobeynikov2009-08-18
| | | | | | | | | | | | | try to use i686-darwin to build for arm-eabi, you'll quickly run into several false assumptions that the target OS must be the same as the host OS. These patches split $(OS) into $(HOST_OS) and $(TARGET_OS) to help builds like "make check" and the test-suite able to cross compile. Along the way a target of *-unknown-eabi is defined as "Freestanding" so that TARGET_OS checks have something to work with. Patch by Sandeep Patel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79296 91177308-0d34-0410-b5e6-96231b3b80d8
* Update comments to new-style syntax.Dan Gohman2009-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79263 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash on critical edge. Patch by Andre Tavares.Nick Lewycky2009-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79252 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix debug output to include a newline after printing a Value, nowDan Gohman2009-08-17
| | | | | | | that Value's operator<< doesn't include one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79240 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't access the first element of a potentially emptyDuncan Sands2009-08-17
| | | | | | | | | | | | vector (&Formals[0]). With this change llvm-gcc builds with expensive checking enabled for C, C++ and Fortran. While there, change a std::vector into a SmallVector. This is partly gratuitous, but mostly because not all STL vector implementations define the data method (and it should be faster). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79237 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash trying to promote VLAs.Nick Lewycky2009-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79226 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix for PR3016: detect the tricky case, where there are Eli Friedman2009-08-16
| | | | | | | | | | | | | | | | | | unfoldable references to a PHI node in the block being folded, and disable the transformation in that case. The correct transformation of such PHI nodes depends on whether BB dominates Succ, and dominance is expensive to compute here. (Alternatively, it's possible to check whether any uses are live, but that's also essentially a dominance calculation. Another alternative is to use reg2mem, but it probably isn't a good idea to use that in simplifycfg.) Also, remove some incorrect code from CanPropagatePredecessorsForPHIs which is made unnecessary with this patch: it didn't consider the case where a PHI node in BB has multiple uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79174 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to get the context from an erased Instruction.Benjamin Kramer2009-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79134 91177308-0d34-0410-b5e6-96231b3b80d8
* SSI construction should just go ahead and ignore instructions in unreachableNick Lewycky2009-08-15
| | | | | | | blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79132 91177308-0d34-0410-b5e6-96231b3b80d8
* Make TargetData optional in GlobalOpt and ArgumentPromotion.Dan Gohman2009-08-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78967 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually privatize a IntegerTypes, and fix a few bugs exposed by this.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78955 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* When InstCombine simplifies a load -> extract element to gep -> load, placeMon P Wang2009-08-13
| | | | | | | | the new load by the old load instead of by the extract element because a store could have occurred between the load and extract element. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78891 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify conditional.Andreas Bolka2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78889 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify and reduce indentation using early exits.Andreas Bolka2009-08-13
| | | | | | No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78888 91177308-0d34-0410-b5e6-96231b3b80d8
* DEBUGify some DOUTs.Andreas Bolka2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78887 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune trailing whitespace.Andreas Bolka2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78886 91177308-0d34-0410-b5e6-96231b3b80d8
* Transform -X/C to X/-C, implementing a README.txt entry.Dan Gohman2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78812 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize (x/C)*C to x if the division is exact.Dan Gohman2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78811 91177308-0d34-0410-b5e6-96231b3b80d8
* Update instcombine's debug output to account for Value*'s operator<<Dan Gohman2009-08-12
| | | | | | | not appending its own newline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78810 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a bunch more now-unnecessary Context arguments.Dan Gohman2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78809 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate a bunch of now unnecessary explicit Context variables.Dan Gohman2009-08-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78808 91177308-0d34-0410-b5e6-96231b3b80d8
* Add contexts to some of the MVT APIs. No functionality change yet, just the ↵Owen Anderson2009-08-12
| | | | | | infrastructure work needed to get the contexts to where they need to be first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78759 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize exact sdiv by a constant power of 2 to ashr.Dan Gohman2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78714 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary casts.Dan Gohman2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78664 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead metadata.Devang Patel2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78651 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MVT to EVT, in preparation for splitting SimpleValueType out into its ↵Owen Anderson2009-08-10
| | | | | | own struct type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78610 91177308-0d34-0410-b5e6-96231b3b80d8
* More ProfileInfo improvements.Daniel Dunbar2009-08-08
| | | | | | | | | | | | | - Part of optimal static profiling patch sequence by Andreas Neustifter. - Store edge, block, and function information separately for each functions (instead of in one giant map). - Return frequencies as double instead of int, and use a sentinel value for missing information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78477 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix dom frontier update. This fixes PR4667.Devang Patel2009-08-07
| | | | | | | Patch by Jakub Staszak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78388 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of namespace pollution.Dan Gohman2009-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78363 91177308-0d34-0410-b5e6-96231b3b80d8
* Use DebugInfoFinder.Devang Patel2009-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78333 91177308-0d34-0410-b5e6-96231b3b80d8
* Privatize the StructType table, which unfortunately involves routing ↵Owen Anderson2009-08-05
| | | | | | contexts through a number of APIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
* Check for !isa<Constant> instead of isa<Instruction>. ThisDan Gohman2009-08-04
| | | | | | | | matches what the comment says, and it avoids spurious BitCast instructions for Argument values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78121 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new Constant::getIntegerValue helper function, and convert aDan Gohman2009-08-03
| | | | | | | | few places in InstCombine to use it, to fix problems handling pointer types. This fixes the recent llvm-gcc bootstrap error. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78005 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SimplifyDemandedUseBits generate vector constants where Eli Friedman2009-08-03
| | | | | | | | | | appropriate. Patch per report on llvmdev. No testcase because the original report didn't come with a testcase, and I can't come up with a case that actually fails. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77986 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-31
| | | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix GVN's debug output, now that operator<< on Value* doesn't printDan Gohman2009-07-31
| | | | | | | a trailing newline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77719 91177308-0d34-0410-b5e6-96231b3b80d8
* - Convert the rest of the DOUTs to DEBUG+errs().Bill Wendling2009-07-31
| | | | | | | | | - One formatting change. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77717 91177308-0d34-0410-b5e6-96231b3b80d8
* PR4662: Fix a crash introduced by the recent LLVMContext changes.Eli Friedman2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77716 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getTrue() and getFalse() to 2.5-like APIs.Owen Anderson2009-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77685 91177308-0d34-0410-b5e6-96231b3b80d8