summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/ScalarRepl
Commit message (Collapse)AuthorAgeFilesLines
...
* fix RewriteStoreUserOfWholeAlloca to use the correct type sizeChris Lattner2009-05-081-0/+12
| | | | | | | | | method, fixing a crash on PR4146. While the store will ultimately overwrite the "padded size" number of bits in memory, the stored value may be a subset of this size. This function only wants to handle the case where all bits are stored. llvm-svn: 71224
* fix a crash on a pointless but valid zero-length memset, rdar://6808691Chris Lattner2009-04-211-0/+16
| | | | llvm-svn: 69680
* Fix a bug.Zhou Sheng2009-03-181-0/+3961
| | | | | | If I->use_empty(), this method should return false. llvm-svn: 67180
* teach SROA to handle promoting vector allocas with a memset into them intoChris Lattner2009-03-081-2/+16
| | | | | | a vector type instead of into an integer type. llvm-svn: 66368
* Enhance SROA to "promote to scalar" allocas which are Chris Lattner2009-03-082-6/+20
| | | | | | | memcpy/memmove'd into or out of. This fixes a serious perf issue that Nate ran into. llvm-svn: 66366
* While converting an aggregate to scalare, ignore and remove aggregate's ↵Devang Patel2009-03-061-0/+184
| | | | | | debug info. llvm-svn: 66262
* Fix PR3720 by properly propagating alignment information from memcpy/memmove Chris Lattner2009-03-041-0/+19
| | | | | | onto element accesses. llvm-svn: 66053
* adjust for asmprinter change.Chris Lattner2009-03-011-2/+2
| | | | llvm-svn: 65741
* Enable scalar replacement of AllocaInst whose one of the user is dbg info.Devang Patel2009-02-101-0/+105
| | | | llvm-svn: 64207
* fix PR3489, use bits instead of bytes.Chris Lattner2009-02-061-0/+20
| | | | llvm-svn: 63916
* teach "convert from scalar" to handle loads of fca's.Chris Lattner2009-02-031-0/+9
| | | | llvm-svn: 63659
* make scalar conversion handle stores of first classChris Lattner2009-02-031-0/+12
| | | | | | | aggregate values. loads are not yet handled (coming soon to an sroa near you). llvm-svn: 63649
* Make SROA produce a vector only when the alloca is actually Chris Lattner2009-02-031-0/+19
| | | | | | | | | | | | | | | | | | | accessed at least once as a vector. This prevents it from compiling the example in not-a-vector into: define double @test(double %A, double %B) { %tmp4 = insertelement <7 x double> undef, double %A, i32 0 %tmp = insertelement <7 x double> %tmp4, double %B, i32 4 %tmp2 = extractelement <7 x double> %tmp, i32 4 ret double %tmp2 } instead, producing the integer code. Producing vectors when they aren't otherwise in the program is dangerous because a lot of other code treats them carefully and doesn't want to break them down. OTOH, many things want to break down tasty i448's. llvm-svn: 63638
* this produces an undefined result, just check that the alloca is goneChris Lattner2009-02-031-1/+1
| | | | | | and that sroa doesn't crash. llvm-svn: 63637
* add another case of undefined behavior without crashing, PR3466.Chris Lattner2009-02-031-0/+9
| | | | llvm-svn: 63620
* Teach ConvertUsesToScalar to handle memset, allowing it to handle Chris Lattner2009-02-031-0/+18
| | | | | | | | | | | | | | crazy cases like: struct f { int A, B, C, D, E, F; }; short test4() { struct f A; A.A = 1; memset(&A.B, 2, 12); return A.C; } llvm-svn: 63596
* rearrange how SRoA handles promotion of allocas to vectors.Chris Lattner2009-02-031-0/+10
| | | | | | | | | | With the new world order, it can handle cases where the first store into the alloca is an element of the vector, instead of requiring the first analyzed store to have the vector type itself. This allows us to un-xfail test/CodeGen/X86/vec_ins_extract.ll. llvm-svn: 63590
* this test produces an undefined value, we don't careChris Lattner2009-02-031-1/+1
| | | | | | what it is, but we do want the alloca promoted. llvm-svn: 63587
* update testChris Lattner2009-02-021-1/+1
| | | | llvm-svn: 63532
* Fix a bug which caused us to miscompile a couple of AdaChris Lattner2009-02-021-0/+16
| | | | | | tests. Thanks for the beautiful reduced testcase Duncan! llvm-svn: 63529
* Simplify and generalize the SROA "convert to scalar" transformation toChris Lattner2009-01-314-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | be able to handle *ANY* alloca that is poked by loads and stores of bitcasts and GEPs with constant offsets. Before the code had a number of annoying limitations and caused it to miss cases such as storing into holes in structs and complex casts (as in bitfield-sroa) where we had unions of bitfields etc. This also handles a number of important cases that are exposed due to the ABI lowering stuff we do to pass stuff by value. One case that is pretty great is that we compile 2006-11-07-InvalidArrayPromote.ll into: define i32 @func(<4 x float> %v0, <4 x float> %v1) nounwind { %tmp10 = call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %v1) %tmp105 = bitcast <4 x i32> %tmp10 to i128 %tmp1056 = zext i128 %tmp105 to i256 %tmp.upgrd.43 = lshr i256 %tmp1056, 96 %tmp.upgrd.44 = trunc i256 %tmp.upgrd.43 to i32 ret i32 %tmp.upgrd.44 } which turns into: _func: subl $28, %esp cvttps2dq %xmm1, %xmm0 movaps %xmm0, (%esp) movl 12(%esp), %eax addl $28, %esp ret Which is pretty good code all things considering :). One effect of this is that SROA will start generating arbitrary bitwidth integers that are a multiple of 8 bits. In the case above, we got a 256 bit integer, but the codegen guys assure me that it can handle the simple and/or/shift/zext stuff that we're doing on these operations. This addresses rdar://6532315 llvm-svn: 63469
* Fix some issues with volatility, move "CanConvertToScalar" check Chris Lattner2009-01-281-0/+12
| | | | | | after the others. llvm-svn: 63227
* strengthen this test.Chris Lattner2009-01-281-3/+2
| | | | llvm-svn: 63222
* Fix PR3304Chris Lattner2009-01-091-0/+15
| | | | llvm-svn: 61995
* This implements the second half of the fix for PR3290, handlingChris Lattner2009-01-081-0/+26
| | | | | | | | | loads from allocas that cover the entire aggregate. This handles some memcpy/byval cases that are produced by llvm-gcc. This triggers a few times in kc++ (with std::pair<std::_Rb_tree_const_iterator <kc::impl_abstract_phylum*>,bool>) and once in 176.gcc (with %struct..0anon). llvm-svn: 61915
* Implement the first half of PR3290: if there is a store of an Chris Lattner2009-01-071-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | integer to a (transitive) bitcast the alloca and if that integer has the full size of the alloca, then it clobbers the whole thing. Handle this by extracting pieces out of the stored integer and filing them away in the SROA'd elements. This triggers fairly frequently because the CFE uses integers to pass small structs by value and the inliner exposes these. For example, in kimwitu++, I see a bunch of these with i64 stores to "%struct.std::pair<std::_Rb_tree_const_iterator<kc::impl_abstract_phylum*>,bool>" In 176.gcc I see a few i32 stores to "%struct..0anon". In the testcase, this is a difference between compiling test1 to: _test1: subl $12, %esp movl 20(%esp), %eax movl %eax, 4(%esp) movl 16(%esp), %eax movl %eax, (%esp) movl (%esp), %eax addl 4(%esp), %eax addl $12, %esp ret vs: _test1: movl 8(%esp), %eax addl 4(%esp), %eax ret The second half of this will be to handle loads of the same form. llvm-svn: 61853
* Allow scalarrepl to treat an all-zero GEP just as bitcast.Matthijs Kooijman2008-10-061-0/+24
| | | | | | | This includes not marking a GEP involving a vector as unsafe, but only when it has all zero indices. This allows scalarrepl to work in a few more cases. llvm-svn: 57177
* Add a testcase showing that scalarrepl supports first class structs.Matthijs Kooijman2008-09-291-0/+30
| | | | | | | I originally made this script to show that scalarrepl didn't support them, but it turned out it does. Better to still add the testcase then. llvm-svn: 56781
* Fix PR2423 by checking all indices for out of range access, not only Chris Lattner2008-08-231-0/+22
| | | | | | | indices that start with an array subscript. x->field[10000] is just as bad as (*X)[14][10000]. llvm-svn: 55226
* Fix PR2369 by making scalarrepl more careful about promoting Chris Lattner2008-06-221-0/+18
| | | | | | | | | structures. Its default threshold is to promote things that are smaller than 128 bytes, which is sane. However, it is not sane to do this for things that turn into 128 *registers*. Add a cap on the number of registers introduced, defaulting to 128/4=32. llvm-svn: 52611
* Fix some tests.Evan Cheng2008-06-121-1/+1
| | | | llvm-svn: 52245
* Fix some escaping and quoting in RUN lines, mainly involving { and <. In twoMatthijs Kooijman2008-06-102-2/+2
| | | | | | | | | cases quoting of <{ didn't work out, so I changed the grep to check for }> instead. This fixes 7 testcases that were not properly running before. llvm-svn: 52182
* Learn ScalarReplAggregrates how stores and loads of first class aggregratesMatthijs Kooijman2008-06-051-0/+32
| | | | | | | | | | work and how to replace them into individual values. Also, when trying to replace an aggregrate that is used by load or store with a single (large) integer, don't crash (but don't replace the aggregrate either). Also adds a testcase for both structs and arrays. llvm-svn: 51997
* sabre brings to my attention that the 'tr' suffix is also obsoleteGabor Greif2008-05-201-1/+1
| | | | llvm-svn: 51349
* Rename the last test with .llx extension to .ll, resolve duplicate test by ↵Gabor Greif2008-05-201-1/+1
| | | | | | renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too. llvm-svn: 51328
* Upgrade tests to not use llvm-upgrade.Tanya Lattner2008-03-1823-377/+336
| | | | llvm-svn: 48484
* fix a bug Anders ran into where scalarrepl would crash when promotingChris Lattner2008-02-291-0/+16
| | | | | | | | a union containing a vector and an array whose elements were smaller than the vector elements. this means we need to compile the load of the array elements into an extract element plus a truncate. llvm-svn: 47752
* Fix a bug where scalarrepl would discard offset if type would match.Chris Lattner2008-01-301-0/+21
| | | | | | | In practice this can only happen on code with already undefined behavior, but this is still a good thing to handle correctly. llvm-svn: 46539
* Change uses of getTypeSize to getABITypeSize, getTypeStoreSizeDuncan Sands2007-11-041-0/+30
| | | | | | | | | | | | | | | | | | | | | | or getTypeSizeInBits as appropriate in ScalarReplAggregates. The right change to make was not always obvious, so it would be good to have an sroa guru review this. While there I noticed some bugs, and fixed them: (1) arrays of x86 long double have holes due to alignment padding, but this wasn't being spotted by HasStructPadding (renamed to HasPadding). The same goes for arrays of oddly sized ints. Vectors also suffer from this, in fact the problem for vectors is much worse because basic vector assumptions seem to be broken by vectors of type with alignment padding. I didn't try to fix any of these vector problems. (2) The code for extracting smaller integers from larger ones (in the "int union" case) was wrong on big-endian machines for integers with size not a multiple of 8, like i1. Probably this is impossible to hit via llvm-gcc, but I fixed it anyway while there and added a testcase. I also got rid of some trailing whitespace and changed a function name which had an obvious typo in it. llvm-svn: 43672
* Convert .cvsignore filesJohn Criswell2007-06-291-3/+0
| | | | llvm-svn: 37801
* Testcase for PR1421Chris Lattner2007-05-301-0/+23
| | | | llvm-svn: 37357
* testcase for PR1446Chris Lattner2007-05-241-0/+27
| | | | llvm-svn: 37325
* Move Mem2Reg/DifferingTypes.ll -> ScalarRepl/DifferingTypes.ll. -scalarreplChris Lattner2007-05-051-0/+19
| | | | | | implements this xform. llvm-svn: 36804
* new testcase, should be able to eliminate the alloca and memcpyChris Lattner2007-04-251-0/+33
| | | | llvm-svn: 36428
* For PR1319:Reid Spencer2007-04-162-5/+4
| | | | | | | | 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. llvm-svn: 36142
* For PR1319:Reid Spencer2007-04-1510-18/+30
| | | | | | | | | | 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 llvm-svn: 36065
* Make the llvm-runtest function much more amenable by eliminating all theReid Spencer2007-04-111-1/+1
| | | | | | | | 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. llvm-svn: 35918
* Remove use of implementation keyword.Reid Spencer2007-03-283-3/+0
| | | | llvm-svn: 35412
* new testcaseChris Lattner2007-03-281-1/+1
| | | | llvm-svn: 35397
* add a testcase the resent patches fail on.Chris Lattner2007-03-191-0/+45
| | | | llvm-svn: 35167
OpenPOWER on IntegriCloud