summaryrefslogtreecommitdiff
path: root/test/Transforms/GlobalOpt
Commit message (Collapse)AuthorAge
* 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
* Add a testcase for the GlobalOpt inbounds fix.Dan Gohman2009-09-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81168 91177308-0d34-0410-b5e6-96231b3b80d8
* Add inbounds to these getelementptrs, now that GlobalOpt requires this,Dan Gohman2009-09-07
| | | | | | | to preserve the meaning of these tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81166 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
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-04
| | | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid infinite looping in AllGlobalLoadUsesSimpleEnoughForHeapSRA(). This ↵Evan Cheng2009-06-02
| | | | | | can happen when PHI uses are recursively dependent on each other. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72710 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore debug info while evaluating function.Devang Patel2009-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66490 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a serious pessimization that Tron on IRC pointed out where we wouldChris Lattner2009-03-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "boolify" pointers, generating really awful code because getting the pointer value requires a load itself. Before: _foo: movb $1, _X.b ret _get: xorl %ecx, %ecx movb _X.b, %al testb %al, %al movl $_Y, %eax cmove %ecx, %eax ret With the xform disabled: _foo: movl $_Y, _X ret _get: movl _X, %eax ret git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66351 91177308-0d34-0410-b5e6-96231b3b80d8
* While thinking about the one-definition-rule and tryingDuncan Sands2009-03-06
| | | | | | | | | | | | | | to find a tiny mouse hole to squeeze through, it struck me that globals without a name can be considered internal since they can't be referenced from outside the current module. This patch makes GlobalOpt give them internal linkage. Also done for aliases even though they always have names, since in my opinion anonymous aliases should be allowed for consistency with global variables and functions. So if that happens one day, this code is ready! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66267 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 66224.Devang Patel2009-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66233 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert rev. 66167. Devang Patel2009-03-06
| | | | | | | We are still not out of woods yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66232 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not let debug info prevert globalopt from shriking a global vars to boolean.Devang Patel2009-03-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66224 91177308-0d34-0410-b5e6-96231b3b80d8
* GlobalOpt only process non constant local GVs while optimizing global vars.Devang Patel2009-03-05
| | | | | | | | | | | | | If non constant local GV named A is used by a constant local GV named B (e.g. llvm.dbg.variable) and B is not used by anyone else then eliminate A as well as B. In other words, debug info should not interfere in removal of unused GV. --This life, and those below, will be ignored-- M test/Transforms/GlobalOpt/2009-03-03-dbg.ll M lib/Transforms/IPO/GlobalOpt.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66167 91177308-0d34-0410-b5e6-96231b3b80d8
* Should have XFAILed this test.Bill Wendling2009-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66086 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert r65994. It was causing rdar://6646455.Bill Wendling2009-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66083 91177308-0d34-0410-b5e6-96231b3b80d8
* If a global constant is dead then global's debug info should not prevent the ↵Devang Patel2009-03-04
| | | | | | optimizer in deleting the global. And while deleting global, delete global's debug info also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65994 91177308-0d34-0410-b5e6-96231b3b80d8
* If the target of an alias has internal linkage, then theDuncan Sands2009-02-15
| | | | | | | | | alias can be morphed into the target. Implement this transform, and fix a crash in the existing transform at the same time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64583 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite OptimizeAwayTrappingUsesOfLoads to 1) avoid a temporaryChris Lattner2009-01-14
| | | | | | | | | vector and extraneous loop over it, 2) not delete globals used by phis/selects etc which could actually be useful. This fixes PR3321. Many thanks to Duncan for narrowing this down. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62201 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement the old and horrible bison parser for .ll files with a niceChris Lattner2009-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and clean recursive descent parser. This change has a couple of ramifications: 1. The parser code is about 400 lines shorter (in what we maintain, not including what is autogenerated). 2. The code should be significantly faster than the old code because we don't have to work around bison's poor handling of datatypes with ctors/dtors. This also makes the code much more resistant to memory leaks. 3. We now get caret diagnostics from the .ll parser, woo. 4. The actual diagnostics emited from the parser are completely different so a bunch of testcases had to be updated. 5. I now disallow "%ty = type opaque %ty = type i32". There was no good reason to support this, it was just an accident of the old implementation. I have no reason to think that anyone is actually using this. 6. The syntax for sticking a global variable has changed to make it unambiguous. I don't think anyone is depending on this since only clang supports this and it is not solid yet, so I'm not worried about anything breaking. 7. This gets rid of the last use of bison, and along with it the .cvs files. I'll prune this from the makefiles as a subsequent commit. There are a few minor cleanups that can be done after this commit (suggestions welcome!) but this passes dejagnu testing and is ready for its time in the limelight. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61558 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance heap sra to be substantially more aggressive w.r.t PHIChris Lattner2008-12-17
| | | | | | | | | | nodes. This allows it to do fairly general phi insertion if a load from a pointer global wants to be SRAd but the load is used by (recursive) phi nodes. This fixes a pessimization on ppc introduced by Load PRE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61123 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix another crash found by inspection. If we have a PHI node mergingChris Lattner2008-12-16
| | | | | | | | the load multiple times, make sure the check the uses of the PHI to ensure they are transformable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61102 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a crash found by inspection.Chris Lattner2008-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61101 91177308-0d34-0410-b5e6-96231b3b80d8
* add testcase for r61051Chris Lattner2008-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61052 91177308-0d34-0410-b5e6-96231b3b80d8
* add a basic test for heap-sraChris Lattner2008-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61041 91177308-0d34-0410-b5e6-96231b3b80d8
* Resolve aliases, when possibleAnton Korobeynikov2008-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56001 91177308-0d34-0410-b5e6-96231b3b80d8
* Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.Matthijs Kooijman2008-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53716 91177308-0d34-0410-b5e6-96231b3b80d8
* sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif2008-05-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif2008-05-20
| | | | | | renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51328 91177308-0d34-0410-b5e6-96231b3b80d8
* When SRoA'ing a global variable, make sure the new globals get the Chris Lattner2008-04-26
| | | | | | | | | | appropriate alignment. This fixes a miscompilation of 252.eon on x86-64 (rdar://5891920). Bill, please pull this into Tak. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50308 91177308-0d34-0410-b5e6-96231b3b80d8
* rename *.llx -> *.ll, last batch.Chris Lattner2008-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49971 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove llvm-upgrade and update test cases.Tanya Lattner2008-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47793 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove any 'nest' parameter attributes if the functionDuncan Sands2008-02-16
| | | | | | | is not passed as an argument to a trampoline intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47220 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't let globalopt hack on volatile loads or stores.Chris Lattner2008-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46523 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the miscompilation of MiBench/consumer-lame that was exposed by Evan'sChris Lattner2008-01-14
| | | | | | | | byval work. This miscompilation is due to the program indexing an array out of range and us doing a transformation that broke this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45949 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1896Chris Lattner2008-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45568 91177308-0d34-0410-b5e6-96231b3b80d8
* upgrade testChris Lattner2007-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44067 91177308-0d34-0410-b5e6-96231b3b80d8
* Tighten up a check for folding away loads from (newly constant) globals. ThisChris Lattner2007-11-09
| | | | | | | | fixes a crash on Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll and rdar://5585488. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43949 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1553:Reid Spencer2007-07-19
| | | | | | | | | | Change the keywords for the zext and sext parameter attributes to be zeroext and signext so they don't conflict with the keywords for the instructions of the same name. This gets around the ambiguity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40069 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert .cvsignore filesJohn Criswell2007-06-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37801 91177308-0d34-0410-b5e6-96231b3b80d8
* new testcase for PR1491Chris Lattner2007-06-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37422 91177308-0d34-0410-b5e6-96231b3b80d8
* this crashes globaloptChris Lattner2007-05-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37021 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1319:Reid Spencer2007-04-16
| | | | | | | | | Remove && from the end of the lines to prevent tests from throwing run lines into the background. Also, clean up places where the same command is run multiple times by using a temporary file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36142 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1336:Reid Spencer2007-04-16
| | | | | | | Correct this test case. It was passing a uint where a ubyte was expected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36101 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1336:Reid Spencer2007-04-15
| | | | | | | XFAIL tests covered by the PR. These will be un-XFAILed as they are fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36093 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1319:Reid Spencer2007-04-15
| | | | | | | Upgrade to use new Tcl exec based test harness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36062 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the llvm-runtest function much more amenable by eliminating all theReid Spencer2007-04-11
| | | | | | | | | global variables that needed to be passed in. This makes it possible to add new global variables with only a couple changes (Makefile and llvm-dg.exp) instead of touching every single dg.exp file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35918 91177308-0d34-0410-b5e6-96231b3b80d8
* new testcase that crashes globaloptChris Lattner2007-04-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35688 91177308-0d34-0410-b5e6-96231b3b80d8
* new testcase. @foo should be marked fastcc by globaloptChris Lattner2007-02-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34607 91177308-0d34-0410-b5e6-96231b3b80d8