Commit Graph

43275 Commits

Author SHA1 Message Date
Chris Lattner 590b10dba2 add testcase for r61051
llvm-svn: 61052
2008-12-15 21:46:23 +00:00
Chris Lattner 49e3bdc165 enhance heap-sra to apply to fixed sized array allocations, not just
variable sized array allocations.

llvm-svn: 61051
2008-12-15 21:44:34 +00:00
Mon P Wang 580f2c7b61 Added support for splitting and scalarizing vector shifts.
llvm-svn: 61050
2008-12-15 21:44:00 +00:00
Chris Lattner 1c731fa86f Use stripPointerCasts.
llvm-svn: 61047
2008-12-15 21:20:32 +00:00
Chris Lattner f0eb568021 minor tweaks for formatting, allow bitcast in ValueIsOnlyUsedLocallyOrStoredToOneGlobal.
llvm-svn: 61046
2008-12-15 21:08:54 +00:00
Chris Lattner c4274a71d5 refactor some code into a new TryToOptimizeStoreOfMallocToGlobal function.
Use GetElementPtrInst::hasAllZeroIndices where possible.

llvm-svn: 61045
2008-12-15 21:02:25 +00:00
Chris Lattner 3cdf0a8a2e add a basic test for heap-sra
llvm-svn: 61041
2008-12-15 19:42:05 +00:00
Chris Lattner e3401db1f3 Teach basicaa to use the nocapture attribute when possible. When the
intrinsics are properly marked nocapture, the fixme should be addressed.

llvm-svn: 61040
2008-12-15 18:59:22 +00:00
Dan Gohman a7e139a3e6 Fix printing of PseudoSourceValues in SDNode graphs.
llvm-svn: 61036
2008-12-15 17:28:10 +00:00
Dan Gohman 498d391245 Fix a typo in a comment.
llvm-svn: 61035
2008-12-15 17:26:50 +00:00
Chris Lattner 5d196e64f1 add some more notes.
llvm-svn: 61033
2008-12-15 08:32:28 +00:00
Chris Lattner 81ee731852 Add a testcase for GCC PR 23455, which lpre handles now. Add some
comments about why we're not getting other cases.

llvm-svn: 61032
2008-12-15 07:49:24 +00:00
Nick Lewycky bc07dbd1c5 Update generated files after nocapture syntax change.
llvm-svn: 61031
2008-12-15 07:31:07 +00:00
Nick Lewycky 8d2ea18346 It turns out that "align 1" and unaligned are different. Add a bias to the
alignment attribute such that 0 means unaligned.

This will probably require a rebuild of llvm-gcc because of the change to
Attributes.h. If you see many test failures on "make check", please rebuild
your llvm-gcc.

llvm-svn: 61030
2008-12-15 07:29:55 +00:00
Mon P Wang ac4e120912 Added support to LegalizeType for expanding the operands of scalar to vector
and insert vector element.  Modified extract vector element to extend the
result to match the expected promoted type.

llvm-svn: 61029
2008-12-15 06:57:02 +00:00
Chris Lattner 3c2c36b590 gvn now hoists this load out of the hot non-call path.
llvm-svn: 61028
2008-12-15 06:34:48 +00:00
Chris Lattner 0c68ae0603 Enable Load PRE. This teaches GVN to push partially redundant loads up the
CFG when there is exactly one predecessor where the load is not available.
This is designed to not increase code size but still eliminate partially
redundant loads.  This fires 1765 times on 403.gcc even though it doesn't
do critical edge splitting yet (the most common reason for it to fail).

llvm-svn: 61027
2008-12-15 05:28:29 +00:00
Chris Lattner 7ed5ccc517 if we have a phi translation failure of the start block,
return *just* a clobber of the start block, not other 
random stuff as well.

llvm-svn: 61026
2008-12-15 04:58:29 +00:00
Chris Lattner b2429e2d69 Adjust testcase to make it more stable across visitation order changes,
unbreaking it after r61024.

llvm-svn: 61025
2008-12-15 04:42:00 +00:00
Owen Anderson 03aacbae90 Ifdef out some code that I didn't mean to enable by default yet.
llvm-svn: 61024
2008-12-15 03:52:17 +00:00
Chris Lattner 69131fd872 make GVN try to rename inputs to the resultant replaced values, which
cleans up the generated code a bit.  This should have the added benefit of
not randomly renaming functions/globals like my previous patch did. :)

llvm-svn: 61023
2008-12-15 03:46:38 +00:00
Chris Lattner ff9f3dba12 Implement initial support for PHI translation in memdep. This means that
memdep keeps track of how PHIs affect the pointer in dep queries, which 
allows it to eliminate the load in cases like rle-phi-translate.ll, which
basically end up being:

BB1:
   X = load P
   br BB3
BB2:
   Y = load Q
   br BB3
BB3:
   R = phi [P] [Q]
   load R

turning "load R" into a phi of X/Y.  In addition to additional exposed
opportunities, this makes memdep safe in many cases that it wasn't before
(which is required for load PRE) and also makes it substantially more 
efficient.  For example, consider:


bb1:  // has many predecessors.
   P = some_operator()
   load P

In this example, previously memdep would scan all the predecessors of BB1
to see if they had something that would mustalias P.  In some cases (e.g.
test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end
up eliminating something.  In many other cases though, it would scan and not
find anything useful.  MemDep now stops at a block if the pointer is defined
in that block and cannot be phi translated to predecessors.  This causes it
to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not
scanning tons of stuff that is unlikely to be useful.  For example, this
speeds up GVN as a whole from 3.928s to 2.448s (60%)!.  IMO, scalar GVN 
should be enhanced to simplify the rle-must-alias pointer base anyway, which
would allow the loads to be eliminated.

In the future, this should be enhanced to phi translate through geps and 
bitcasts as well (as indicated by FIXMEs) making memdep even more powerful.

llvm-svn: 61022
2008-12-15 03:35:32 +00:00
Owen Anderson bfe133e4ac Add support for slow-path GVN with full phi construction for scalars. This is disabled for now, as it actually pessimizes code in the abscence
of phi translation for load elimination.  This slow down GVN a bit, by about 2% on 403.gcc.

llvm-svn: 61021
2008-12-15 02:03:00 +00:00
Nick Lewycky e88d388fb9 Fix whitespace in comment.
Remove TODO; icmp isn't a binary operator, so this function will never deal
with them.

llvm-svn: 61020
2008-12-15 01:35:36 +00:00
Nick Lewycky ddffe620e4 Introducing nocapture, a parameter attribute for pointers to indicate that the
callee will not introduce any new aliases of that pointer.

The attributes had all bits allocated already, so I decided to collapse
alignment. Alignment was previously stored as a 16-bit integer from bits 16 to
32 of the attribute, but it was required to be a power of 2. Now it's stored in
log2 encoded form in five bits from 16 to 21. That gives us 11 more bits of
space.

You may have already noticed that you only need four bits to encode a 16-bit
power of two, so why five bits? Because the AsmParser accepted 32-bit
alignments, even though we couldn't store them (they were silently discarded).
Now we can store them in memory, but not in the bitcode.

The bitcode format was already storing these as 64-bit VBR integers. So, the
bitcode format stays the same, keeping the alignment values stored as 16 bit
raw values. There's some hideous code in the reader and writer that deals with
this, waiting to be ripped out the moment we run out of bits again and have to
replace the parameter attributes table encoding.

llvm-svn: 61019
2008-12-15 01:34:58 +00:00
Chris Lattner a66e9f4218 silence warning when asserts disabled.
llvm-svn: 61014
2008-12-14 21:38:24 +00:00
Chris Lattner c3d36efbb5 silence warning when asserts disabled.
llvm-svn: 61013
2008-12-14 21:37:33 +00:00
Chris Lattner f5eef9f6db eliminate warning when asserts disabled.
llvm-svn: 61012
2008-12-14 21:36:23 +00:00
Chris Lattner a236dc44d6 another random testcase that shouldn't crash gvn and is
good for coverage with future changes.

llvm-svn: 61011
2008-12-14 21:20:46 +00:00
Nick Lewycky 4048ca5739 Clarify the meaning of the NoAlias response. The plan is to refer to this from
a future version of LangRef.

llvm-svn: 61010
2008-12-14 21:08:48 +00:00
Owen Anderson e34c2399de Generalize GVN's phi construciton routine to work for things other than loads.
llvm-svn: 61009
2008-12-14 19:10:35 +00:00
Duncan Sands f312dc7729 Reapply r60997, this time without forgetting that
target constants are allowed to have an illegal
type.

llvm-svn: 61006
2008-12-14 09:43:15 +00:00
Misha Brukman e10a3d54ef Fixed HTML validator warning.
llvm-svn: 61005
2008-12-14 08:01:51 +00:00
Misha Brukman f845ef79f3 CSS cleanup:
* Lowercased all HTML element names
* Standardized spacing around { and }
* removed class "doc_table_nw": grep finds no uses

llvm-svn: 61004
2008-12-14 07:20:36 +00:00
Bill Wendling e5af6f1990 Temporarily revert r60997. It was causing this failure:
Running /Users/void/llvm/llvm.src/test/CodeGen/Generic/dg.exp ...
FAIL: /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll
Failed with exit(1) at line 1
while running:  llvm-as < /Users/void/llvm/llvm.src/test/CodeGen/Generic/asm-large-immediate.ll |  llc | /usr/bin/grep 68719476738
Assertion failed: ((TypesNeedLegalizing || getTypeAction(VT) == Legal) && "Illegal type introduced after type legalization?"), function HandleOp, file /Users/void/llvm/llvm.src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 493.
0   llc               0x0085392e char const* std::find<char const*, char>(char const*, char const*, char const&) + 98
1   llc               0x00853e63 llvm::sys::PrintStackTraceOnErrorSignal() + 593
2   libSystem.B.dylib 0x96cac09b _sigtramp + 43
3   libSystem.B.dylib 0xffffffff _sigtramp + 1765097359
4   libSystem.B.dylib 0x96d24ec2 raise + 26
5   libSystem.B.dylib 0x96d3447f abort + 73
6   libSystem.B.dylib 0x96d26063 __assert_rtn + 101
7   llc               0x004f9018 llvm::cast_retty<llvm::SubprogramDesc, llvm::DebugInfoDesc*>::ret_type llvm::cast<llvm::Sub
...

llvm-svn: 61001
2008-12-13 23:53:00 +00:00
Duncan Sands 24092271cc LegalizeDAG is not supposed to introduce illegal
types into the DAG if they were not already there.
Check this with an assertion.

llvm-svn: 60997
2008-12-13 22:33:38 +00:00
Chris Lattner 9b9a145694 RLE isn't smart enough to eliminate this safely yet.
llvm-svn: 60994
2008-12-13 21:04:20 +00:00
Chris Lattner d923519cc5 rename some tests to be more uniform in naming convention.
llvm-svn: 60988
2008-12-13 18:47:40 +00:00
Chris Lattner 9e24267120 gvn should never crash on this.
llvm-svn: 60987
2008-12-13 18:39:44 +00:00
Chris Lattner 695bc778f8 These messages should always be emitted when NDEBUG is unset, not when
NDEBUG is unset and -debug is passed.

llvm-svn: 60986
2008-12-13 18:37:58 +00:00
Mikhail Glushenkov e04b5bfd19 Add a comment to the auto-generated docs.
llvm-svn: 60985
2008-12-13 17:51:47 +00:00
Mikhail Glushenkov 6027992ea9 Merge llvm-rst.css and llvm.css.
llvm-svn: 60984
2008-12-13 17:50:58 +00:00
Cedric Venet 13b3e7f217 Add explicit this-> for some member function in templated base class.
These call are probably dependent but VS with /Za don't seems to think so. We need to help him.

llvm-svn: 60978
2008-12-13 10:55:13 +00:00
Bill Wendling 293b9181e5 Temporarily revert r60973. It's inexplicably causing a failure when self-hosting LLVM:
llvm[2]: Linking Release executable opt (without symbols)
...
Undefined symbols:
  "llvm::APFloat::IEEEsingle", referenced from:
      __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(Constants.o)
      __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(AsmWriter.o)
      __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(ConstantFold.o)
  "llvm::APFloat::IEEEdouble", referenced from:
      __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(Constants.o)
      __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(AsmWriter.o)
      __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(ConstantFold.o)
ld: symbol(s) not found

This is in release mode. To replicate, compile llvm and llvm-gcc in optimized
mode. Then build llvm, in optimized mode, with the newly created compiler.

llvm-svn: 60977
2008-12-13 09:28:44 +00:00
Torok Edwin 040688f1b2 Fix getFieldAs() to use the parameter instead of 6.
Add missing DIType constructor, needed by DIVariable::getType().

llvm-svn: 60976
2008-12-13 08:25:29 +00:00
Mon P Wang 472cd640fa Remove assertion to allow promotion of a truncating store operand
llvm-svn: 60975
2008-12-13 08:16:43 +00:00
Mon P Wang f95bd2078d Added basic support for expanding VSETCC
llvm-svn: 60974
2008-12-13 08:15:14 +00:00
Chris Lattner 1e29f7c97d make RLE preserve the name of the load that it replaces. This is just
a pretification of the IR.

llvm-svn: 60973
2008-12-13 07:22:47 +00:00
Duncan Sands b6f09933c0 On big-endian machines it is wrong to do a full
width register load followed by a truncating
store for the copy, since the load will not place
the value in the lower bits.  Probably partial
loads/stores can never happen here, but fix it
anyway.

llvm-svn: 60972
2008-12-13 07:18:38 +00:00
Misha Brukman 234b44add2 Fix spelling.
llvm-svn: 60971
2008-12-13 05:21:37 +00:00