1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

86374 Commits

Author SHA1 Message Date
Ulrich Weigand
497a8eab4a Make TOC order deterministic by using MapVector instead of DenseMap.
llvm-svn: 167737
2012-11-12 19:13:24 +00:00
Nadav Rotem
0d1d8f0215 fix a spelling mistake
llvm-svn: 167734
2012-11-12 18:45:12 +00:00
Hal Finkel
7cca290894 BBVectorize: Check the input types of shuffles for legality
This fixes a bug where shuffles were being fused such that the
resulting input types were not legal on the target. This would
occur only when both inputs and dependencies were also foldable
operations (such as other shuffles) and there were other connected
pairs in the same block.

llvm-svn: 167731
2012-11-12 14:50:59 +00:00
Alexander Potapenko
7d1c22f15d Don't use __cxa_demangle under MSVC (which doesn't have it)
llvm-svn: 167730
2012-11-12 14:49:58 +00:00
Alexey Samsonov
40de89cfd1 [ASan] fixup for r167725: Don't fetch name of StructType if it is literal
llvm-svn: 167729
2012-11-12 14:47:00 +00:00
Alexey Samsonov
8fee8dc998 Fixup for r167558: Store raw pointer (instead of reference) to RelocMap in DIContext. This is needed to prevent crashes because of dangling reference if the clients don't provide RelocMap to DIContext constructor.
llvm-svn: 167728
2012-11-12 14:25:36 +00:00
Meador Inge
0cf613c15a Normalize memcmp constant folding results.
The library call simplifier folds memcmp calls with all constant arguments
to a constant.  For example:

  memcmp("foo", "foo", 3) ->  0
  memcmp("hel", "foo", 3) ->  1
  memcmp("foo", "hel", 3) -> -1

The folding is implemented in terms of the system memcmp that LLVM gets
linked with.  It currently just blindly uses the value returned from
the system memcmp as the folded constant.

This patch normalizes the values returned from the system memcmp to
(-1, 0, 1) so that we get consistent results across multiple platforms.
The test cases were adjusted accordingly.

llvm-svn: 167726
2012-11-12 14:00:45 +00:00
Alexey Samsonov
40043146fa [ASan]: Add minimalistic support for turning off initialization-order checking for globals of specified types. Tests for this behavior will go to ASan test suite in compiler-rt.
llvm-svn: 167725
2012-11-12 14:00:01 +00:00
Gabor Greif
e410d28c25 do not play preprocessor tricks with 'private', use public interfaces instead; this appeases the VC++ buildbots
llvm-svn: 167724
2012-11-12 13:34:59 +00:00
Alexander Potapenko
441c9aafe6 [ASan] Add llvm-symbolizer from to tools/
This is the second and last (2/2) part of a change that moves llvm-symbolizer to llvm/tools/, which will allow to build it
with both cmake and configure+make.

llvm-svn: 167723
2012-11-12 11:33:29 +00:00
Gabor Greif
269fe89c77 add unit test for waymarking algorithm (Use::getUser)
llvm-svn: 167720
2012-11-12 10:01:17 +00:00
Eric Christopher
cde3ef14c3 Remove unused field.
llvm-svn: 167719
2012-11-12 07:35:12 +00:00
Michael Liao
5bf5c77881 Fix PR14314
- Fix operand order for atomic sub, where the minuend is the value
  loaded from memory and the subtrahend is the parameter specified.

llvm-svn: 167718
2012-11-12 06:49:17 +00:00
Craig Topper
6f32cdabf0 Add --enable-werror and --enable-cxx11 to projects/sample/
llvm-svn: 167716
2012-11-12 06:11:12 +00:00
Justin Holewinski
da9a98c364 [NVPTX] Add more precise PTX/SM target attributes
Each SM and PTX version is modeled as a subtarget feature/CPU. Additionally,
PTX 3.1 is added as the default PTX version to be out-of-the-box compatible
with CUDA 5.0.

Available CPUs for this target:

  sm_10 - Select the sm_10 processor.
  sm_11 - Select the sm_11 processor.
  sm_12 - Select the sm_12 processor.
  sm_13 - Select the sm_13 processor.
  sm_20 - Select the sm_20 processor.
  sm_21 - Select the sm_21 processor.
  sm_30 - Select the sm_30 processor.
  sm_35 - Select the sm_35 processor.

Available features for this target:

  ptx30 - Use PTX version 3.0.
  ptx31 - Use PTX version 3.1.
  sm_10 - Target SM 1.0.
  sm_11 - Target SM 1.1.
  sm_12 - Target SM 1.2.
  sm_13 - Target SM 1.3.
  sm_20 - Target SM 2.0.
  sm_21 - Target SM 2.1.
  sm_30 - Target SM 3.0.
  sm_35 - Target SM 3.5.

llvm-svn: 167699
2012-11-12 03:16:43 +00:00
Meador Inge
1ed197fb71 Delete a stale comment. No functional change.
llvm-svn: 167698
2012-11-12 00:28:15 +00:00
Craig Topper
e9616c2f3c Move some helper methods to being static functions in the implementation file.
llvm-svn: 167696
2012-11-11 22:45:02 +00:00
Meador Inge
69e38a3d15 Remove hard-coded constant in Transforms/InstCombine/memcmp-1.ll
Transforms/InstCombine/memcmp-1.ll has a test case that looks like:

  @foo = constant [4 x i8] c"foo\00"
  @hel = constant [4 x i8] c"hel\00"

  ...

  %mem1 = getelementptr [4 x i8]* @hel, i32 0, i32 0
  %mem2 = getelementptr [4 x i8]* @foo, i32 0, i32 0
  %ret = call i32 @memcmp(i8* %mem1, i8* %mem2, i32 3)
  ret i32 %ret
  ; CHECK: ret i32 2

The folded return value (2 above) is computed using the system memcmp
that the compiler is linked with.  This can return different values on
different systems.  The test was originally written on an OS X 10.7.5
x86-64 box and passed.  However, it failed on one of the x86-64 FreeBSD
buildbots because the system memcpy on that machine returned a different
value (1 instead of 2).

I fixed the test by checking the folding constants with regexes.

llvm-svn: 167691
2012-11-11 07:10:25 +00:00
Meador Inge
ba025d5d90 instcombine: Migrate memset optimizations
This patch migrates the memset optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167689
2012-11-11 06:49:03 +00:00
Nadav Rotem
af8ed30774 Update the vectorizer docs.
llvm-svn: 167688
2012-11-11 06:47:51 +00:00
Meador Inge
e093f6c41e instcombine: Migrate memmove optimizations
This patch migrates the memmove optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167687
2012-11-11 06:22:40 +00:00
Meador Inge
bf03751391 instcombine: Migrate memcpy optimizations
This patch migrates the memcpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167686
2012-11-11 05:54:34 +00:00
Nadav Rotem
0e46931b95 Use the isTruncFree and isZExtFree API to figure out of these operations are free. Thanks Andy!
llvm-svn: 167685
2012-11-11 05:34:45 +00:00
Nadav Rotem
0f2d71a695 Fix a comment typo and add comments.
llvm-svn: 167684
2012-11-11 05:15:00 +00:00
Meador Inge
13e6be2fd6 instcombine: Migrate memcmp optimizations
This patch migrates the memcmp optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167683
2012-11-11 05:11:20 +00:00
Meador Inge
a062b17960 instcombine: Migrate strstr optimizations
This patch migrates the strstr optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167682
2012-11-11 03:51:48 +00:00
Meador Inge
9ad3990ff0 Add method for replacing instructions to LibCallSimplifier
In some cases the library call simplifier may need to replace instructions
other than the library call being simplified.  In those cases it may be
necessary for clients of the simplifier to override how the replacements
are actually done.  As such, a new overrideable method for replacing
instructions was added to LibCallSimplifier.

A new subclass of LibCallSimplifier is also defined which overrides
the instruction replacement method.  This is because the instruction
combiner defines its own replacement method which updates the worklist
when instructions are replaced.

llvm-svn: 167681
2012-11-11 03:51:43 +00:00
Benjamin Kramer
20d52f752f Provide definitions for all functions.
ICC refuses to compile a class in an anonymous namespace if some functions
aren't defined. Fixes PR13477.

llvm-svn: 167676
2012-11-10 16:10:16 +00:00
Meador Inge
a202e0c179 instcombine: Migrate strcspn optimizations
This patch migrates the strcspn optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 167675
2012-11-10 15:16:48 +00:00
Benjamin Kramer
511004a2cd Simplify the SmallVector pretty printer for LLDB a bit and make it work with reference types.
llvm-svn: 167674
2012-11-10 09:45:32 +00:00
Craig Topper
f8089e0864 Remove unnecessary subtraction and addition by 1 around a couple for loops.
llvm-svn: 167673
2012-11-10 09:25:36 +00:00
Craig Topper
f04d47d0ca Tidy up spacing. No functional change.
llvm-svn: 167671
2012-11-10 09:02:47 +00:00
Craig Topper
2f64a42f1c Removed unimplemented method declaration.
llvm-svn: 167670
2012-11-10 09:00:12 +00:00
Craig Topper
adebc23cac Simplify custom emitter code for pcmp(e/i)str(i/m) and make the helper functions static.
llvm-svn: 167669
2012-11-10 08:57:41 +00:00
Evan Cheng
2599006e46 Convert an improper CodeGen test to a MC test.
llvm-svn: 167663
2012-11-10 04:30:40 +00:00
Meador Inge
9b62fb8d77 instcombine: Query target library information to gate libcall simplifications
Several of the simplifiers migrated from the simplify-libcalls pass to
the instcombine pass were not correctly checking the target library
information to gate the simplifications.  This patch ensures that the
check is made.

llvm-svn: 167660
2012-11-10 03:11:10 +00:00
Meador Inge
c87e59c34e Add more functions to the target library information.
In the process of migrating optimizations from the simplify-libcalls pass
to the instcombine pass I noticed that a few functions are missing from
the target library information.  These functions need to be available for
querying in the instcombine library call simplifiers.  More functions will
probably be added in the future as more simplifiers are migrated to
instcombine.

llvm-svn: 167659
2012-11-10 03:11:06 +00:00
Evan Cheng
6ed26ba70c xfail a bad test. This is a MC test but it's dependent on a codegen optimization which is now disabled.
llvm-svn: 167658
2012-11-10 02:34:36 +00:00
Evan Cheng
ebe241fb9d Disable the Thumb no-return call optimization:
mov lr, pc
b.w _foo

The "mov" instruction doesn't set bit zero to one, it's putting incorrect
value in lr. It messes up backtraces.

rdar://12663632

llvm-svn: 167657
2012-11-10 02:09:05 +00:00
Craig Topper
f424da6ff9 Cleanup pcmp(e/i)str(m/i) instruction definitions and load folding support.
llvm-svn: 167652
2012-11-10 01:23:36 +00:00
Justin Holewinski
be8faeed70 [NVPTX] Use ABI alignment for parameters when alignment is not specified.
Affects SM 2.0+.  Fixes bug 13324.

llvm-svn: 167646
2012-11-09 23:50:24 +00:00
Evandro Menezes
3163eb097c Fix issue with invalid flat operand number
Avoid iterating over list of operands beyond the number of operands in it.

PS: this fixes issue with revision #167634.
llvm-svn: 167635
2012-11-09 21:27:03 +00:00
Evandro Menezes
065305e336 Fix issue with invalid flat operand number
Avoid iterating over list of operands beyond the number of operands in it.

llvm-svn: 167634
2012-11-09 20:29:37 +00:00
Anton Korobeynikov
9040102509 Add ARM TARGET2 relocation. The testcase will follow with actualy use-case.
Based on the patch by Logan Chien!

llvm-svn: 167633
2012-11-09 20:20:12 +00:00
Roman Divacky
9196fa48cc Switch FreeBSD/i386 back to 4byte stack alignment. This partially
reverts r126226.

llvm-svn: 167632
2012-11-09 20:10:44 +00:00
Jakob Stoklund Olesen
887571e652 Fix assertions in updateRegMaskSlots().
The RegMaskSlots contains 'r' slots while NewIdx and OldIdx are 'B'
slots. This broke the checks in the assertions.

This fixes PR14302.

llvm-svn: 167625
2012-11-09 19:18:49 +00:00
Chad Rosier
c928e82253 Revert r167620; this can be implemented using an existing CL option.
llvm-svn: 167622
2012-11-09 18:25:27 +00:00
Chad Rosier
2962c226a7 Add support for -mstrict-align compiler option for ARM targets.
rdar://12340498

llvm-svn: 167620
2012-11-09 17:29:38 +00:00
Benjamin Kramer
35333a7560 Silence GCC warning about falling off the end of a non-void function.
llvm-svn: 167618
2012-11-09 15:45:22 +00:00
Dmitry Vyukov
fab21a5c47 tsan: switch to new memory_order constants (ABI compatible)
llvm-svn: 167615
2012-11-09 14:12:16 +00:00