ec68f552f2a5c1df10813a80929995185eb98243 |
|
21-Aug-2012 |
Chandler Carruth <chandlerc@gmail.com> |
Port the global copy optimization from the SROA pass to InstCombine. This optimization is really just replacing allocas wholesale with globals, there is no scalarization. The underlying motivation for this patch is to simplify the SROA pass and focus it on splitting and promoting allocas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
78f8ef42173a3a9867ed789073d4ddc652fb7ff2 |
|
09-Jul-2012 |
Nuno Lopes <nunoplopes@sapo.pt> |
instcombine: merge the functions that remove dead allocas and dead mallocs/callocs/... This patch removes ~70 lines in InstCombineLoadStoreAlloca.cpp and makes both functions a bit more aggressive than before :) In theory, we can be more aggressive when removing an alloca than a malloc, because an alloca pointer should never escape, but we are not taking advantage of this anyway git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
91fa1da2f73ce77d386cacb1a69f38dcdf7cd60c |
|
26-Jun-2012 |
Duncan Sands <baldrick@free.fr> |
Replacing zero-sized alloca's with a null pointer is too aggressive, instead merge all zero-sized alloca's into one, fixing c43204g from the Ada ACATS conformance testsuite. What happened there was that a variable sized object was being allocated on the stack, "alloca i8, i32 %size". It was then being passed to another function, which tested that the address was not null (raising an exception if it was) then manipulated %size bytes in it (load and/or store). The optimizers cleverly managed to deduce that %size was zero (congratulations to them, as it isn't at all obvious), which made the alloca zero size, causing the optimizers to replace it with null, which then caused the check mentioned above to fail, and the exception to be raised, wrongly. Note that no loads and stores were actually being done to the alloca (the loop that does them is executed %size times, i.e. is not executed), only the not-null address check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
2450eca96061ddb1d9a62f42669184684476448a |
|
08-Apr-2012 |
Chandler Carruth <chandlerc@gmail.com> |
Teach InstCombine to nuke a common alloca pattern -- an alloca which has GEPs, bit casts, and stores reaching it but no other instructions. These often show up during the iterative processing of the inliner, SROA, and DCE. Once we hit this point, we can completely remove the alloca. These were actually showing up in the final, fully optimized code in a bunch of inliner tests I've been working on, and notably they show up after LLVM finishes optimizing away all function calls involved in hash_combine(a, b). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
0ccae0b1f6b95e4500adb45649472389a1f111a7 |
|
16-Mar-2012 |
Bill Wendling <isanbard@gmail.com> |
Revert r152907. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
ff030fd3005e05a2f73a0008faac02063c2582bb |
|
16-Mar-2012 |
Bill Wendling <isanbard@gmail.com> |
The alignment of the pointer part of the store instruction may have an alignment. If that's the case, then we want to make sure that we don't increase the alignment of the store instruction. Because if we increase it to be "more aligned" than the pointer, code-gen may use instructions which require a greater alignment than the pointer guarantees. <rdar://problem/11043589> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
5b6f42f57e730c2d968c313a27fa505a3c3e5efa |
|
16-Aug-2011 |
Bill Wendling <isanbard@gmail.com> |
Use the getFirstInsertionPt() method instead of getFirstNonPHI + an 'isa<>' check for a LandingPadInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
05d0023a95a11cde1247920d61d26cc82216f566 |
|
16-Aug-2011 |
Bill Wendling <isanbard@gmail.com> |
A few places where we want to skip the landingpad instruction for insertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
cc4a0435b7ee34af2c64a6f7ee63642f56096d1b |
|
16-Aug-2011 |
Eli Friedman <eli.friedman@gmail.com> |
Update instcombine for atomic load/store. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
a9203109f4ac95aa7e9624f2838e3d89623ec902 |
|
25-Jul-2011 |
Jay Foad <jay.foad@gmail.com> |
Convert GetElementPtrInst to use ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
0a2a60ace9b79164b71794ce7ff981171c61e442 |
|
22-Jul-2011 |
Jay Foad <jay.foad@gmail.com> |
Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to use ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135761 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
8908ff207d8dc0daccde3dc5710dc805ec98e1fa |
|
22-Jul-2011 |
Jay Foad <jay.foad@gmail.com> |
Fix an MSVC warning, caused by a case I missed when converting ConstantExpr::getGetElementPtr to use ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
db125cfaf57cc83e7dd7453de2d509bc8efd0e5e |
|
18-Jul-2011 |
Chris Lattner <sabre@nondot.org> |
land David Blaikie's patch to de-constify Type, with a few tweaks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
a311c34d2af7c750f016ef5e4c41bee77a1dfac7 |
|
27-May-2011 |
Eli Friedman <eli.friedman@gmail.com> |
Final step of instcombine debuginfo; switch a couple more places over to InsertNewInstWith, and use setDebugLoc for the cases which can't be easily handled by the automated mechanisms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
e6f364b6c44eda14cd4ad54366ea5cc7246b9500 |
|
19-May-2011 |
Eli Friedman <eli.friedman@gmail.com> |
More instcombine cleanup, towards improving debug line info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
3ecfc861b4365f341c5c969b40e1afccde676e6f |
|
30-Mar-2011 |
Jay Foad <jay.foad@gmail.com> |
Remove PHINode::reserveOperandSpace(). Instead, add a parameter to PHINode::Create() giving the (known or expected) number of operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
948d9e7ec7c4f8da50d2640d3564b01d40ffd4b1 |
|
14-Mar-2011 |
Jin-Gu Kang <jaykang10@imrc.kist.re.kr> |
This case is solved by Scalar Replacement of Aggregates (DT) and Early CSE pass so this patch reverts it to original source code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
198e97c4238079f6af0ffd675c2339dcc46b9d8e |
|
13-Mar-2011 |
Jin-Gu Kang <jaykang10@imrc.kist.re.kr> |
Add comment as following: load and store reference same memory location, the memory location is represented by getelementptr with two uses (load and store) and the getelementptr's base is alloca with single use. At this point, instructions from alloca to store can be removed. (this pattern is generated when bitfield is accessed.) For example, %u = alloca %struct.test, align 4 ; [#uses=1] %0 = getelementptr inbounds %struct.test* %u, i32 0, i32 0;[#uses=2] %1 = load i8* %0, align 4 ; [#uses=1] %2 = and i8 %1, -16 ; [#uses=1] %3 = or i8 %2, 5 ; [#uses=1] store i8 %3, i8* %0, align 4 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
c5c03f90240e1d2bf9f1579ae14b5dc8f0547c33 |
|
12-Mar-2011 |
Jin-Gu Kang <jaykang10@imrc.kist.re.kr> |
This patch removes some of useless instructions generated by bitfield access. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
5aa3fa6d827e162893534454b2a2c4b6e50884fc |
|
08-Mar-2011 |
Devang Patel <dpatel@apple.com> |
llvm.dbg.declare intrinsic does not use any llvm::Values. It's magic! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
ab4c366274a582dd8146b2820c6b999cad5fce36 |
|
15-Feb-2011 |
Duncan Sands <baldrick@free.fr> |
Spelling fix: consequtive -> consecutive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
687140c818ba4b896329a83324714140b6580ef8 |
|
25-Dec-2010 |
Chris Lattner <sabre@nondot.org> |
Move getOrEnforceKnownAlignment out of instcombine into Transforms/Utils. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
17a0bf996fb61cdd43cec2cfc7db53145bbc767a |
|
25-Oct-2010 |
Dan Gohman <gohman@apple.com> |
Fix a case where instcombine was stripping metadata (and alignment) from stores when folding in bitcasts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
c97fb52799eea845569425c0430b2b944cad7093 |
|
31-Aug-2010 |
Owen Anderson <resistor@mac.com> |
Remove r111665, which implemented store-narrowing in InstCombine. Chris discovered a miscompilation in it, and it's not easily fixable at the optimizer level. I'll investigate reimplementing it in DAGCombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
a4cba04a0384881f8f18d0e2253ae0bc69e64d2d |
|
20-Aug-2010 |
Owen Anderson <resistor@mac.com> |
Re-apply r111568 with a fix for the clang self-host. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
45c3b65eb79e1cc223c5ec344c2c5d110752fdc3 |
|
20-Aug-2010 |
Owen Anderson <resistor@mac.com> |
Revert r111568 to unbreak clang self-host. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
9419cab4c360d532bb5c3e171cdc8eca400b1b53 |
|
20-Aug-2010 |
Owen Anderson <resistor@mac.com> |
When a set of bitmask operations, typically from a bitfield initialization, only modifies the low bytes of a value, we can narrow the store to only over-write the affected bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
0fd353376b2741fc477c5fe05a5f18ae3abc4f60 |
|
03-Aug-2010 |
Dan Gohman <gohman@apple.com> |
Make instcombine set explicit alignments on load or store instructions with alignment 0, so that subsequent passes don't need to bother checking the TargetData ABI size manually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110128 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
96f1d8ebdd33b3f9bdb3b1163f36072c68599f42 |
|
22-Jul-2010 |
Gabor Greif <ggreif@gmail.com> |
mass elimination of reliance on automatic iterator dereferencing git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
a9b8338bfa126de7ad6d57ca417b39d5c6a979ff |
|
12-Jul-2010 |
Gabor Greif <ggreif@gmail.com> |
cache result of operator* git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
b654435712f3e1345cc40aff99724de9300e5de0 |
|
09-Jul-2010 |
Gabor Greif <ggreif@gmail.com> |
do not repeatedly dereference use_iterator git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
dd9344f3face8f1978a7f9f393c31b628144d1f6 |
|
28-May-2010 |
Dan Gohman <gohman@apple.com> |
Move FindAvailableLoadedValue isSafeToLoadUnconditionally out of lib/Transforms/Utils and into lib/Analysis so that Analysis passes can use them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
05d62537276197b3351d9887f4967590b6a3b901 |
|
28-May-2010 |
Dan Gohman <gohman@apple.com> |
Teach instcombine to promote alloca array sizes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
1df9859c40492511b8aa4321eb76496005d3b75b |
|
16-Feb-2010 |
Duncan Sands <baldrick@free.fr> |
There are two ways of checking for a given type, for example isa<PointerType>(T) and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
b0bc6c361da9009e8414efde317d9bbff755f6c0 |
|
15-Feb-2010 |
Duncan Sands <baldrick@free.fr> |
Uniformize the names of type predicates: rather than having isFloatTy and isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
49db68fba01722ca032dc5170f8248a9d25f0199 |
|
30-Jan-2010 |
Bob Wilson <bob.wilson@apple.com> |
Check alignment of loads when deciding whether it is safe to execute them unconditionally. Besides checking the offset, also check that the underlying object is aligned as much as the load itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
6ecfccfd55274187368b86d7f2e65f77d1921c36 |
|
30-Jan-2010 |
Bob Wilson <bob.wilson@apple.com> |
Use more specific types to avoid casts. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
fb2ea6130ddd318867e3afc23fb7eded64278841 |
|
29-Jan-2010 |
Bob Wilson <bob.wilson@apple.com> |
Preserve load alignment in instcombine transformations. I've been unable to create a testcase where this matters. The select+load transformation only occurs when isSafeToLoadUnconditionally is true, and in those situations, instcombine also changes the underlying objects to be aligned. This seems like a good idea regardless, and I've verified that it doesn't pessimize the subsequent realignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
3eb4f7e2dd98038f94e45d1c45ccff49e6659c87 |
|
29-Jan-2010 |
Bob Wilson <bob.wilson@apple.com> |
Improve isSafeToLoadUnconditionally to recognize that GEPs with constant indices are safe if the result is known to be within the bounds of the underlying object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
29fa5e98863332eb808a6f5c1e29138ca6fd7f5c |
|
22-Jan-2010 |
Victor Hernandez <vhernandez@apple.com> |
Keep ignoring pointer-to-pointer bitcasts git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
a4c77622f7f9f7546f0eae7c171ab56df125dc9a |
|
22-Jan-2010 |
Victor Hernandez <vhernandez@apple.com> |
No need to look through bitcasts for DbgInfoIntrinsic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
d3dc3cc98f0366a9860a68eaa1f823dfc7fa310b |
|
19-Jan-2010 |
Eric Christopher <echristo@apple.com> |
Fix comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|
8d9b8d717e665945b31b0742b901561fb433cece |
|
05-Jan-2010 |
Chris Lattner <sabre@nondot.org> |
split out load/store/alloca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
|