Commit Graph

45542 Commits

Author SHA1 Message Date
Chris Lattner
80e8b506b8 rewrite the memset_pattern pattern generation stuff to accept any 2/4/8/16-byte
constant, including globals.  This makes us generate much more "pretty" pattern
globals as well because it doesn't break it down to an array of bytes all the
time.

This enables us to handle stores of relocatable globals.  This kicks in about
48 times in 254.gap, giving us stuff like this:

@.memset_pattern40 = internal constant [2 x %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)*] [%struct.TypHeader* (%struct.TypHeader*, %struct
.TypHeader*)* @IsFalse, %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)* @IsFalse], align 16

...
  call void @memset_pattern16(i8* %scevgep5859, i8* bitcast ([2 x %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)*]* @.memset_pattern40 to i8*
), i64 %tmp75) nounwind



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126044 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 19:56:44 +00:00
Chris Lattner
41bfbb0a87 Stores of null pointers should turn into memset, we weren't recognizing
them as splat values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126041 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 19:35:49 +00:00
Chris Lattner
3a393728a6 Implement rdar://9009151, transforming strided loop stores of
unsplatable values into memset_pattern16 when it is available
(recent darwins).  This transforms lots of strided loop stores
of ints for example, like 5 in vpr:

  Formed memset:   call void @memset_pattern16(i8* %4, i8* getelementptr inbounds ([16 x i8]* @.memset_pattern9, i32 0, i32 0), i64 %tmp25)
    from store to: {%3,+,4}<%11> at:   store i32 3, i32* %scevgep, align 4, !tbaa !4




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126040 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 19:31:39 +00:00
Eric Christopher
dd6e40a4f4 Fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126018 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 03:19:09 +00:00
Devang Patel
5bc9fec7ec Do not emit empty DW_TAG_lexical_block DIEs. In one test case, size of debug info reduced by almost 7%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126009 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 01:31:27 +00:00
Jakob Stoklund Olesen
1b847deb26 Give SplitAnalysis a VRM member to access VirtRegMap::getOriginal().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126005 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:53:42 +00:00
Joerg Sonnenberger
4b19c9865e Avoid dangling else warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126004 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:43:45 +00:00
Jakob Stoklund Olesen
0eeca44046 Missed member rename for naming convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126003 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:42:33 +00:00
Jakob Stoklund Olesen
fd38917d4d This method belonged in VirtRegMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:38:43 +00:00
Jakob Stoklund Olesen
a2ebf60ef2 Separate timers for local and global splitting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126001 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 00:38:40 +00:00
Devang Patel
29020a3b45 These tags are now covered by dwarf::TagString().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125987 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 23:13:40 +00:00
Devang Patel
98d9f5d90d Provide tag strings for llvm specific tags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125986 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 23:06:29 +00:00
Devang Patel
a778f5c798 Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
This time with a fix that avoids using invalidated DenseMap iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125984 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:43:42 +00:00
Jakob Stoklund Olesen
e324f6e05f Use VirtRegMap's Virt2SplitMap to keep track of the original live range before splitting.
All new virtual registers created for spilling or splitting point back to their original.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125980 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:35:20 +00:00
Chris Lattner
188a7e00e7 add a way to disable all builtins, wire it up to opt's -disable-simplifylibcalls flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125978 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:34:03 +00:00
Chris Lattner
c19175c9d8 Make loop-idiom use TargetLibraryInfo to determine whether it is allowed
to hack on memset, memcpy etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125974 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:22:15 +00:00
Oscar Fuentes
6d857ca4d7 Move library stuff out of the toplevel CMakeLists.txt file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:06:14 +00:00
Jakob Stoklund Olesen
ba05c01dab Add VirtRegMap::rewrite() and use it in the new register allocators.
The rewriter works almost identically to -rewriter=trivial, except it also
eliminates any identity copies.

This makes the new register allocators independent of VirtRegRewriter.cpp which
will be going away at the same time as RegAllocLinearScan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:03:18 +00:00
Chris Lattner
ce99120084 introduce a new TargetLibraryInfo pass, which transformations can use to
query about available library functions.  For now this just has 
memset_pattern16, which exists on darwin, but it can be extended for a 
bunch of other things in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125965 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 21:50:34 +00:00
Bill Wendling
5028249fab Reapply r114997 now that the buildbots have been updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125960 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 21:12:58 +00:00
Bruno Cardoso Lopes
8bba1a5ef0 Fix style and a typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125949 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 19:49:06 +00:00
Bruno Cardoso Lopes
584bf7bb03 Add assembly parsing support for "msr" and also fix its encoding. Also add
testcases for the disassembler to make sure it still works for "msr".



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125948 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 19:45:59 +00:00
Chris Lattner
6309b3e9be improve support for OpenBSD, patch by Amit Kulkarni!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125943 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 17:04:56 +00:00
Rafael Espindola
1e09e5b979 Expose getTypeName to the C API. Patch by Patrick Walton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125845 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 16:35:37 +00:00
Duncan Sands
39a7de72c8 Add some transforms of the kind X-Y>X -> 0>Y which are valid when there is no
overflow.  These subsume some existing equality transforms, so zap those.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125843 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 16:25:37 +00:00
Chris Lattner
c1e4ce6044 add a poor division by constant case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125832 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 05:35:49 +00:00
Cameron Zwarich
1646953538 Roll out r125794 to help diagnose the llvm-gcc-i386-linux-selfhost failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:58:10 +00:00
Chris Lattner
78f7a25f98 prevent jump threading from merging blocks when their address is
taken (and used!).  This prevents merging the blocks (invalidating
the block addresses) in a case like this:

#define _THIS_IP_  ({ __label__ __here; __here: (unsigned long)&&__here; })

void foo() {
  printf("%p\n", _THIS_IP_);
  printf("%p\n", _THIS_IP_);
  printf("%p\n", _THIS_IP_);
}

which fixes PR4151.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:43:06 +00:00
Chris Lattner
13fb0db0c2 hoist GlobalValue::removeDeadConstantUsers up to being a method on Constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:41:42 +00:00
Chris Lattner
f5ebfb0d28 Don't unroll loops whose header block's address is taken.
This is part of a futile attempt to not "break" bizzaro
code like this:

 l1:
  printf("l1: %p\n", &&l1);
  ++x;

  if( x < 3 ) goto l1;


Previously we'd fold &&l1 to 1, which is fine per our semantics
but not helpful to the user.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125827 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 04:25:21 +00:00
Joerg Sonnenberger
5ad596f9d2 Recognize monitor/mwait with explicit register arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125805 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 00:48:11 +00:00
Argyrios Kyrtzidis
c788f44642 Check the errorcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 00:47:07 +00:00
Jakob Stoklund Olesen
febb0bd0b9 Trim debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125802 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 00:32:47 +00:00
Joerg Sonnenberger
97755a063e Recognize leavel and leaveq aliases for leave.
Validate encoding of leave in 64bit mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125795 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:36:39 +00:00
Devang Patel
a4defc00eb Do not lose debug info of an inlined function argument even if the argument is only used through GEPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:33:27 +00:00
Chris Lattner
c8cb8ef9c2 have instcombine preserve nsw/nuw/exact when sinking
common operations through a phi. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125790 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:01:49 +00:00
Jakob Stoklund Olesen
0db841f9c2 Add basic register allocator statistics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125789 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 22:53:48 +00:00
Chris Lattner
1521e91fc4 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125787 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 22:32:54 +00:00
Chris Lattner
4bd8217af3 fix instcombine merging GEPs through a PHI to only make the
result inbounds if all of the inputs are inbounds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125785 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 22:21:26 +00:00
Nadav Rotem
093399cbf3 Enhance constant folding of bitcast operations on vectors of floats.
Add getAllOnesValue of FP numbers to Constants and APFloat.
Add more tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 21:22:27 +00:00
Chris Lattner
bd9f6bf5cd add is always integer, thanks to Frits for noticing this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125774 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 20:55:29 +00:00
David Greene
583b68f34f [AVX] Recorganize X86ShuffleDecode into its own library
(LLVMX86Utils.a) to break cyclic library dependencies between
LLVMX86CodeGen.a and LLVMX86AsmParser.a.  Previously this code was in
a header file and marked static but AVX requires some additional
functionality here that won't be used by all clients.  Since including
unused static functions causes a gcc compiler warning, keeping it as a
header would break builds that use -Werror.  Putting this in its own
library solves both problems at once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 19:18:59 +00:00
Jakob Stoklund Olesen
034a80d065 Split local live ranges.
A local live range is live in a single basic block. If such a range fails to
allocate, try to find a sub-range that would get a larger spill weight than its
interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125764 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 19:13:53 +00:00
Dan Gohman
64849ce66f The labyrinthine X86 backend no longer appears to require
these patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 18:50:19 +00:00
Duncan Sands
fbd53f79f5 Fix wrong logic in promotion of signed mul-with-overflow (I pointed this out at
the time but presumably my email got lost).  Examples where the previous logic
got it wrong: (1) a signed i8 multiply of 64 by 2 overflows, but the high part is
zero; (2) a signed i8 multiple of -128 by 2 overflows, but the high part is all
ones. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 12:42:48 +00:00
NAKAMURA Takumi
6904f05e60 Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 12:24:17 +00:00
NAKAMURA Takumi
e310b3a2a3 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125746 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 12:23:50 +00:00
Duncan Sands
fe167c5a14 This has been implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125738 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 08:16:56 +00:00
Duncan Sands
a77243300b Transform "A + B >= A + C" into "B >= C" if the adds do not wrap. Likewise for some
variations (some of these were already present so I unified the code).  Spotted by my
auto-simplifier as occurring a lot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 07:46:37 +00:00
Cameron Zwarich
2598b1f4ac Switch to SmallVector in SimpleRegisterCoalescing for a 3.5% speedup on 403.gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125728 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 06:52:07 +00:00