summaryrefslogtreecommitdiff
path: root/test/Transforms/MergeFunc
Commit message (Collapse)AuthorAge
* PR17925 bugfix.Stepan Dyatkovskiy2013-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Short description. This issue is about case of treating pointers as integers. We treat pointers as different if they references different address space. At the same time, we treat pointers equal to integers (with machine address width). It was a point of false-positive. Consider next case on 32bit machine: void foo0(i32 addrespace(1)* %p) void foo1(i32 addrespace(2)* %p) void foo2(i32 %p) foo0 != foo1, while foo1 == foo2 and foo0 == foo2. As you can see it breaks transitivity. That means that result depends on order of how functions are presented in module. Next order causes merging of foo0 and foo1: foo2, foo0, foo1 First foo0 will be merged with foo2, foo0 will be erased. Second foo1 will be merged with foo2. Depending on order, things could be merged we don't expect to. The fix: Forbid to treat any pointer as integer, except for those, who belong to address space 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195769 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach MergeFunctions about address spacesMatt Arsenault2013-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194342 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't merge tiny functions.Matt Arsenault2013-10-01
| | | | | | | | | | | | | | | | | | | | | It's silly to merge functions like these: define void @foo(i32 %x) { ret void } define void @bar(i32 %x) { ret void } to get define void @bar(i32) { tail call void @foo(i32 %0) ret void } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191786 91177308-0d34-0410-b5e6-96231b3b80d8
* Bugfix for PR17099:Stepan Dyatkovskiy2013-09-17
| | | | | | | | | | | | | Wrong cast operation. MergeFunctions emits Bitcast instead of pointer-to-integer operation. Patch fixes MergeFunctions::writeThunk function. It replaces unconditional Bitcast creation with "Value* createCast(...)" method, that checks operand types and selects proper instruction. See unit-test as example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190859 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing CHECK-LABELMatt Arsenault2013-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190740 91177308-0d34-0410-b5e6-96231b3b80d8
* [tests] Cleanup initialization of test suffixes.Daniel Dunbar2013-08-16
| | | | | | | | | | | | | | | | | - Instead of setting the suffixes in a bunch of places, just set one master list in the top-level config. We now only modify the suffix list in a few suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py). - Aside from removing the need for a bunch of lit.local.cfg files, this enables 4 tests that were inadvertently being skipped (one in Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been XFAILED). - This commit also fixes a bunch of config files to use config.root instead of older copy-pasted code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188513 91177308-0d34-0410-b5e6-96231b3b80d8
* TBAA: remove !tbaa from testing cases if not used.Manman Ren2013-04-30
| | | | | | | | This will make it easier to turn on struct-path aware TBAA since the metadata format will change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180796 91177308-0d34-0410-b5e6-96231b3b80d8
* MergeFunc: Make pointer and integer types generate the same hash.Benjamin Kramer2013-04-19
| | | | | | | | | The logic that actually compares the types considers pointers and integers the same if they are of the same size. This created a strange mismatch between hash and reality and made the test case for this fail on some platforms (yay, test cases). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179905 91177308-0d34-0410-b5e6-96231b3b80d8
* Make variable match any name.Bill Wendling2013-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179903 91177308-0d34-0410-b5e6-96231b3b80d8
* Try explicitly setting the target triple to see if this gets it to pass on ARM.Bill Wendling2013-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179890 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to pacify this test for the buildbots.Chad Rosier2013-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179874 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test to make sure that a int-to-ptr can be merged correctly.Bill Wendling2013-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179869 91177308-0d34-0410-b5e6-96231b3b80d8
* We are not able to bitcast a pointer to an integral value.Bill Wendling2013-04-15
| | | | | | | | | Two return types are not equivalent if one is a pointer and the other is an integral. This is because we cannot bitcast a pointer to an integral value. PR15185 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179569 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the test moves from 176733. Use "REQUIRES: asserts" instead.Jan Wen Voung2013-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176873 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable statistics on Release builds and move tests that depend on -stats.Jan Wen Voung2013-03-08
| | | | | | | | | | | | | | | | | Summary: Statistics are still available in Release+Asserts (any +Asserts builds), and stats can also be turned on with LLVM_ENABLE_STATS. Move some of the FastISel stats that were moved under DEBUG() back out of DEBUG(), since stats are disabled across the board now. Many tests depend on grepping "-stats" output. Move those into a orig_dir/Stats/. so that they can be marked as unsupported when building without statistics. Differential Revision: http://llvm-reviews.chandlerc.com/D486 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176733 91177308-0d34-0410-b5e6-96231b3b80d8
* CastInst::castIsValid should return true if the dest type is the same asEvan Cheng2013-01-10
| | | | | | | Value's current type. The casting is trivial even for aggregate type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172143 91177308-0d34-0410-b5e6-96231b3b80d8
* Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ↵Dmitri Gribenko2012-12-30
| | | | | | | | | ModuleID This is done to avoid odd test failures, like the one fixed in r171243. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171250 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the remaining TCL-style quotes found in the testsuite. This isChandler Carruth2012-07-02
| | | | | | | | | | | | | | | | | another mechanical change accomplished though the power of terrible Perl scripts. I have manually switched some "s to 's to make escaping simpler. While I started this to fix tests that aren't run in all configurations, the massive number of tests is due to a really frustrating fragility of our testing infrastructure: things like 'grep -v', 'not grep', and 'expected failures' can mask broken tests all too easily. Essentially, I'm deeply disturbed that I can change the testsuite so radically without causing any change in results for most platforms. =/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159547 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert the uses of '|&' to use '2>&1 |' instead, which works on oldChandler Carruth2012-07-02
| | | | | | | | | | versions of Bash. In addition, I can back out the change to the lit built-in shell test runner to support this. This should fix the majority of fallout on Darwin, but I suspect there will be a few straggling issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159544 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert all tests using TCL-style quoting to use shell-style quoting.Chandler Carruth2012-07-02
| | | | | | | | | | | | | | | | | | | | | | | | This was done through the aid of a terrible Perl creation. I will not paste any of the horrors here. Suffice to say, it require multiple staged rounds of replacements, state carried between, and a few nested-construct-parsing hacks that I'm not proud of. It happens, by luck, to be able to deal with all the TCL-quoting patterns in evidence in the LLVM test suite. If anyone is maintaining large out-of-tree test trees, feel free to poke me and I'll send you the steps I used to convert things, as well as answer any painful questions etc. IRC works best for this type of thing I find. Once converted, switch the LLVM lit config to use ShTests the same as Clang. In addition to being able to delete large amounts of Python code from 'lit', this will also simplify the entire test suite and some of lit's architecture. Finally, the test suite runs 33% faster on Linux now. ;] For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159525 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace all instances of dg.exp file with lit.local.cfg, since all tests are ↵Eli Bendersky2012-02-16
| | | | | | | | | | | run with LIT now and now Dejagnu. dg.exp is no longer needed. Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert to the new EH model.Bill Wendling2011-11-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144050 91177308-0d34-0410-b5e6-96231b3b80d8
* When removing a function from the function set and adding it to deferred, weNick Lewycky2011-02-09
| | | | | | | | | | | | | | could end up removing a different function than we intended because it was functionally equivalent, then end up with a comparison of a function against itself in the next round of comparisons (the one in the function set and the one on the deferred list). To fix this, I introduce a choice in the form of comparison for ComparableFunctions, either normal or "pointer only" used to find exact Function*'s in lookups. Also add some debugging statements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125180 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix surprising missed optimization in mergefunc where we forgot to considerNick Lewycky2011-01-27
| | | | | | | that relationships like "i8* null" is equivalent to "i32* null". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124368 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach mergefunc how to emit aliases safely again -- but keep it turned it offNick Lewycky2011-01-25
| | | | | | | | for now. It's controlled by the HasGlobalAliases variable which is not attached to any flag yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124182 91177308-0d34-0410-b5e6-96231b3b80d8
* Arrays and vectors with different numbers of elements are not equivalent.Nick Lewycky2010-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108517 91177308-0d34-0410-b5e6-96231b3b80d8
* Change tests from "opt %s" to "opt < %s" so that opt doesn't see theDan Gohman2009-09-11
| | | | | | | | | input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8
* Use opt -S instead of piping bitcode output through llvm-dis.Dan Gohman2009-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81257 91177308-0d34-0410-b5e6-96231b3b80d8
* Change these tests to feed the assembly files to opt directly, insteadDan Gohman2009-09-08
| | | | | | | of using llvm-as, now that opt supports this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8
* Given two identical weak functions, produce one internal function and two weakNick Lewycky2009-06-12
| | | | | | | thunks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73230 91177308-0d34-0410-b5e6-96231b3b80d8
* This test is wrong. If you have two weak functions F and G you can't makeNick Lewycky2009-06-12
| | | | | | | | either one call the other since either one can be replaced at link time, and they need to be independent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73225 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix tests not to emit IR outputAnton Korobeynikov2008-11-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58729 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes from Duncan's review:Nick Lewycky2008-11-02
| | | | | | | | | * merge two weak functions by making them both alias a third non-weak fn * don't reimplement CallSite::hasArgument * whitelist the safe linkage types git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58568 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new MergeFunctions pass. It finds identical functions and merges them.Nick Lewycky2008-11-02
This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc) and so it probably wont be turned on by default. Also, may of those are likely to go away when PR2973 is fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58557 91177308-0d34-0410-b5e6-96231b3b80d8