summaryrefslogtreecommitdiff
path: root/test/Transforms/Mem2Reg
Commit message (Collapse)AuthorAge
* Debug Info: update testing cases to specify the debug info version number.Manman Ren2013-11-22
| | | | | | | | | We are going to drop debug info without a version number or with a different version number, to make sure we don't crash when we see bitcode files with different debug info metadata format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195504 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: add an identifier field to DICompositeType.Manman Ren2013-08-26
| | | | | | | | | | | | | | | | | | | DICompositeType will have an identifier field at position 14. For now, the field is set to null in DIBuilder. For DICompositeTypes where the template argument field (the 13th field) was optional, modify DIBuilder to make sure the template argument field is set. Now DICompositeType has 15 fields. Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode. Update verifier to check that DICompositeType has 15 fields and the last field is null or a MDString. Update testing cases to include an extra field for DICompositeType. The identifier field will be used by type uniquing so a front end can genearte a DICompositeType with a unique identifer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189282 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
* Remove duplicate copy of testcase in r188327.Nick Lewycky2013-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188328 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r187191, which broke opt -mem2reg on the testcases included in PR16867.Nick Lewycky2013-08-13
| | | | | | | | | | | | | However, opt -O2 doesn't run mem2reg directly so nobody noticed until r188146 when SROA started sending more things directly down the PromoteMemToReg path. In order to revert r187191, I also revert dependent revisions r187296, r187322 and r188146. Fixes PR16867. Does not add the testcases from that PR, but both of them should get added for both mem2reg and sroa when this revert gets unreverted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188327 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder|Verifier: handle DbgLoc attached to instructions.Manman Ren2013-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also remove checking of llvm.dbg.sp since it is not used in generating dwarf. Current state of Finder: DebugInfoFinder tries to list all debug info MDNodes used in a module. To list debug info MDNodes used by an instruction, DebugInfoFinder provides processDeclare, processValue and processLocation to handle DbgDeclareInst, DbgValueInst and DbgLoc attached to instructions. processModule will go through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes used by the CUs. TODO: 1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We need to add a list of variables that are used by DbgDeclareInst and DbgValueInst. 2> MDString fields should be null or isa<MDString> and MDNode fields should be null or isa<MDNode>. We currently use empty string or int 0 to represent null. 3> Go though Verify functions and make sure that they check field types. 4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each testing case has a llvm.dbg.cu. Re-apply r187609 with fix to pass ocaml binding. vmcore.ml generates a debug location with scope being metadata !{}, in verifier we treat this as a null scope. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187812 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert "Debug Info Finder|Verifier: handle DbgLoc attached toEric Christopher2013-08-02
| | | | | | | | instructions." in an attempt to bring back some bots. This reverts commit r187609. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187638 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Finder|Verifier: handle DbgLoc attached to instructions.Manman Ren2013-08-01
| | | | | | | | | | | | | | | | | | | | | | | | | Also remove checking of llvm.dbg.sp since it is not used in generating dwarf. Current state of Finder: DebugInfoFinder tries to list all debug info MDNodes used in a module. To list debug info MDNodes used by an instruction, DebugInfoFinder provides processDeclare, processValue and processLocation to handle DbgDeclareInst, DbgValueInst and DbgLoc attached to instructions. processModule will go through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes used by the CUs. TODO: 1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We need to add a list of variables that are used by DbgDeclareInst and DbgValueInst. 2> MDString fields should be null or isa<MDString> and MDNode fields should be null or isa<MDNode>. We currently use empty string or int 0 to represent null. 3> Go though Verify functions and make sure that they check field types. 4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each testing case has a llvm.dbg.cu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187609 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: update testing cases to pass verifier.Manman Ren2013-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187362 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-implement the analysis of uses in mem2reg to be significantly moreChandler Carruth2013-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | robust. It now uses an InstVisitor and worklist to actually walk the uses of the Alloca transitively and detect the pattern which we can directly promote: loads & stores of the whole alloca and instructions we can completely ignore. Also, with this new implementation teach both the predicate for testing whether we can promote and the promotion engine itself to use the same code so we no longer have strange divergence between the two code paths. I've added some silly test cases to demonstrate that we can handle slightly more degenerate code patterns now. See the below for why this is even interesting. Performance impact: roughly 1% regression in the performance of SROA or ScalarRepl on a large C++-ish test case where most of the allocas are basically ready for promotion. The reason is because of silly redundant work that I've left FIXMEs for and which I'll address in the next commit. I wanted to separate this commit as it changes the behavior. Once the redundant work in removing the dead uses of the alloca is fixed, this code appears to be faster than the old version. =] So why is this useful? Because the previous requirement for promotion required a *specific* visit pattern of the uses of the alloca to verify: we *had* to look for no more than 1 intervening use. The end goal is to have SROA automatically detect when an alloca is already promotable and directly hand it to the mem2reg machinery rather than trying to partition and rewrite it. This is a 25% or more performance improvement for SROA, and a significant chunk of the delta between it and ScalarRepl. To get there, we need to make mem2reg actually capable of promoting allocas which *look* promotable to SROA without have SROA do tons of work to massage the code into just the right form. This is actually the tip of the iceberg. There are tremendous potential savings we can realize here by de-duplicating work between mem2reg and SROA. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187191 91177308-0d34-0410-b5e6-96231b3b80d8
* Current batch of -disable-debug-info-verifier.Rafael Espindola2013-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187130 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: improve the verifier to check field types.Manman Ren2013-07-25
| | | | | | | | | Make sure the context and type fields are MDNodes. We will generate verification errors if those fields are non-empty strings. Fix testing cases to make them pass the verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187106 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Transforms tests to use CHECK-LABEL for easier debugging. No ↵Stephen Lin2013-07-14
| | | | | | | | | | | | | | | | | | | | | | | functionality change. This update was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186268 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Adding DIImportedModules to DIScopes."David Blaikie2013-03-28
| | | | | | | | | This reverts commit 342d92c7a0adeabc9ab00f3f0d88d739fe7da4c7. Turns out we're going with a different schema design to represent DW_TAG_imported_modules so we won't need this extra field. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178215 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding DIImportedModules to DIScopes.David Blaikie2013-03-27
| | | | | | | | | | | | This is just the basic groundwork for supporting DW_TAG_imported_module but I wanted to commit this before pushing support further into Clang or LLVM so that this rather churny change is isolated from the rest of the work. The major churn here is obviously adding another field (within the common DIScope prefix) to all DIScopes (files, classes, namespaces, lexical scopes, etc). This should be the last big churny change needed for DW_TAG_imported_module/using directive support/PR14606. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178099 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused field in DISubprogramDavid Blaikie2013-03-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177661 91177308-0d34-0410-b5e6-96231b3b80d8
* Split out filename & directory from DIFile to start generalizing over DIScopesDavid Blaikie2013-03-17
| | | | | | | | | | This is the first step to making all DIScopes have a common metadata prefix (so that things (using directives, for example) that can appear in any scope can be added to that common prefix). DIFile is itself a DIScope so the common prefix of all DIScopes cannot be a DIFile - instead it's the raw filename/directory name pair. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177239 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize debug info test to be resilient to changes in metadata node numberingDavid Blaikie2013-03-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177238 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the unused 4th operand for DIFile debug info metadataDavid Blaikie2013-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176983 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrading debug info test cases to be (more) compatible with the current ↵David Blaikie2013-03-11
| | | | | | | | | | | | debug info format. These cases were found by further work to remove support for debug info versioning. Common cleanups (other than changing the version info in the tag field) included adding the last parameter to compile_units (recently added for fission support) and other cases of trailing fields in lexical blocks, compile units, and subprograms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176834 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
* Upgrade syntax of tests using volatile instructions to use 'load volatile' ↵Chris Lattner2011-11-27
| | | | | | instead of 'volatile load', which is archaic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145171 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the returns_twice attribute to LLVM.Rafael Espindola2011-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141001 91177308-0d34-0410-b5e6-96231b3b80d8
* Update more tests to the new EH scheme.Bill Wendling2011-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138903 91177308-0d34-0410-b5e6-96231b3b80d8
* Add comments and test for atomic load/store and mem2reg.Eli Friedman2011-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137690 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test for r133251.Nick Lewycky2011-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133339 91177308-0d34-0410-b5e6-96231b3b80d8
* Copy location info for current function argument from dbg.declare if ↵Devang Patel2010-06-04
| | | | | | respective store instruction does not have any location info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105490 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing space; works for me.Dale Johannesen2010-05-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104992 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not drop location info for inlined function args.Devang Patel2010-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104884 91177308-0d34-0410-b5e6-96231b3b80d8
* Update test to use valid debug info.Devang Patel2010-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103287 91177308-0d34-0410-b5e6-96231b3b80d8
* When converting dbg.declare to dbg.value, attach promoted store's debug ↵Victor Hernandez2010-01-27
| | | | | | metadata to dbg.value git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94634 91177308-0d34-0410-b5e6-96231b3b80d8
* In mem2reg, for all alloca/stores that get promoted where the alloca has an ↵Victor Hernandez2010-01-26
| | | | | | associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94493 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r94260 until findDbgDeclare() is made more efficientVictor Hernandez2010-01-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94432 91177308-0d34-0410-b5e6-96231b3b80d8
* In mem2reg, for all alloca/stores that get promoted where the alloca has an ↵Victor Hernandez2010-01-23
| | | | | | associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94260 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bug exposed by moving SRoA earlier which caused a crash building kc++Chris Lattner2009-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85786 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR5023: The instruction form of DominatorTree::dominates did not Chris Lattner2009-09-21
| | | | | | | | | | | take into consideration that the result of an invoke is only valid in the normal dest, not the unwind dest. This caused 'PHINode::hasConstantValue' to return true in an invalid situation, causing mem2reg to delete a phi that was actually needed. This caused a crash building 483.xalancbmk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82491 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
* 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
* no need to print outputChris Lattner2008-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58228 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
* Upgrade tests.Tanya Lattner2008-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48538 91177308-0d34-0410-b5e6-96231b3b80d8
* Upgrade tests.Tanya Lattner2008-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48536 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't promote volatile loads/stores. This is needed (for example) to handle ↵Anton Korobeynikov2007-08-26
| | | | | | | | | setjmp/longjmp properly. This fixes PR1520. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41461 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
* Move Mem2Reg/DifferingTypes.ll -> ScalarRepl/DifferingTypes.ll. -scalarreplChris Lattner2007-05-05
| | | | | | | implements this xform. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36804 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1319:Reid Spencer2007-04-16
| | | | | | | Fix syntax of tests to ensure grep pattern is properly quoted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36134 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR1319:Reid Spencer2007-04-15
| | | | | | | | | | | Upgrade to use new Tcl exec based test harness. This exposes 3 bugs that were previously not being reported: test/Transforms/GlobalDCE/2002-08-17-FunctionDGE.ll test/Transforms/GlobalOpt/memset.ll test/Transforms/IndVarsSimplify/exit_value_tests.llx git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36065 91177308-0d34-0410-b5e6-96231b3b80d8