Commit Graph

157989 Commits

Author SHA1 Message Date
Matt Arsenault e6952f28ca Cleanup handling of constant function casts.
Some of this code is no longer necessary since int<->ptr casts are no
longer occur as of r187444.

This also fixes handling vectors of pointers, and adds a bunch of new
testcases for vectors and address spaces.

llvm-svn: 190885
2013-09-17 21:10:14 +00:00
Matt Kopec cccf2cc8c1 Rename shared libraries for TestLoadUnload.py due to potential shared library name clashes.
llvm-svn: 190884
2013-09-17 20:57:15 +00:00
Bill Schmidt bdae03f227 [PowerPC] Add a FIXME.
Documenting a design choice to generate only medium model sequences for TLS
addresses at this time.  Small and large code models could be supported if
necessary.

llvm-svn: 190883
2013-09-17 20:22:05 +00:00
Bill Schmidt bb381d7063 [PowerPC] Fix problems with large code model (PR17169).
Large code model on PPC64 requires creating and referencing TOC entries when
using the addis/ld form of addressing.  This was not being done in all cases.
The changes in this patch to PPCAsmPrinter::EmitInstruction() fix this.  Two
test cases are also modified to reflect this requirement.

Fast-isel was not creating correct code for loading floating-point constants
using large code model.  This also requires the addis/ld form of addressing.
Previously we were using the addis/lfd shortcut which is only applicable to
medium code model.  One test case is modified to reflect this requirement.

llvm-svn: 190882
2013-09-17 20:03:25 +00:00
Fariborz Jahanian 4c3d9c5e24 ObjectiveC migrator: Don't infer a property from isXXX method
of retainable object (readonly or otherwise).

llvm-svn: 190881
2013-09-17 19:38:55 +00:00
Argyrios Kyrtzidis 85230d50f2 [arcmt] Don't try to handle files that are already ARC'ified, this is not possible currently.
rdar://14461559

llvm-svn: 190880
2013-09-17 19:14:29 +00:00
Ashok Thirumurthi 30c27d6ace Fix a typo in DataExtractor.cpp causing build breakage
that was introduced by r190873.

llvm-svn: 190879
2013-09-17 19:07:02 +00:00
Fariborz Jahanian 92f7242a56 ObjectiveC migrator. Infer property in categories
declared as getter with or without setter method.
// rdar://15010020

llvm-svn: 190878
2013-09-17 19:00:30 +00:00
Sean Callanan 46fc006619 Use a StreamString to fix the endianness in
constants before using them in the IR interpreter.

Patch by Félix Cloutier.

llvm-svn: 190877
2013-09-17 18:26:42 +00:00
Arnold Schwaighofer cae8735a54 Costmodel: Add support for horizontal vector reductions
Upcoming SLP vectorization improvements will want to be able to estimate costs
of horizontal reductions. Add infrastructure to support this.

We model reductions as a series of (shufflevector,add) tuples ultimately
followed by an extractelement. For example, for an add-reduction of <4 x float>
we could generate the following sequence:

 (v0, v1, v2, v3)
   \   \  /  /
     \  \  /
       +  +

 (v0+v2, v1+v3, undef, undef)
    \      /
 ((v0+v2) + (v1+v3), undef, undef)

 %rdx.shuf = shufflevector <4 x float> %rdx, <4 x float> undef,
                           <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
 %bin.rdx = fadd <4 x float> %rdx, %rdx.shuf
 %rdx.shuf7 = shufflevector <4 x float> %bin.rdx, <4 x float> undef,
                          <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
 %bin.rdx8 = fadd <4 x float> %bin.rdx, %rdx.shuf7
 %r = extractelement <4 x float> %bin.rdx8, i32 0

This commit adds a cost model interface "getReductionCost(Opcode, Ty, Pairwise)"
that will allow clients to ask for the cost of such a reduction (as backends
might generate more efficient code than the cost of the individual instructions
summed up). This interface is excercised by the CostModel analysis pass which
looks for reduction patterns like the one above - starting at extractelements -
and if it sees a matching sequence will call the cost model interface.

We will also support a second form of pairwise reduction that is well supported
on common architectures (haddps, vpadd, faddp).

 (v0, v1, v2, v3)
  \   /    \  /
 (v0+v1, v2+v3, undef, undef)
    \     /
 ((v0+v1)+(v2+v3), undef, undef, undef)

  %rdx.shuf.0.0 = shufflevector <4 x float> %rdx, <4 x float> undef,
        <4 x i32> <i32 0, i32 2 , i32 undef, i32 undef>
  %rdx.shuf.0.1 = shufflevector <4 x float> %rdx, <4 x float> undef,
        <4 x i32> <i32 1, i32 3, i32 undef, i32 undef>
  %bin.rdx.0 = fadd <4 x float> %rdx.shuf.0.0, %rdx.shuf.0.1
  %rdx.shuf.1.0 = shufflevector <4 x float> %bin.rdx.0, <4 x float> undef,
        <4 x i32> <i32 0, i32 undef, i32 undef, i32 undef>
  %rdx.shuf.1.1 = shufflevector <4 x float> %bin.rdx.0, <4 x float> undef,
        <4 x i32> <i32 1, i32 undef, i32 undef, i32 undef>
  %bin.rdx.1 = fadd <4 x float> %rdx.shuf.1.0, %rdx.shuf.1.1
  %r = extractelement <4 x float> %bin.rdx.1, i32 0

llvm-svn: 190876
2013-09-17 18:06:50 +00:00
Ed Maste 661e89c13d Don't output a stray 0x if GetData fails for memory read -f hex
llvm-svn: 190875
2013-09-17 17:54:45 +00:00
Fariborz Jahanian ff0c460863 ObjectiveC modern translator: Provide proper cast of
the ObjectiveC object of an @synchronized statement.
// rdar://14993814

llvm-svn: 190874
2013-09-17 17:51:48 +00:00
Ed Maste 74a23ea494 Avoid abort on "memory read -s N" for N=3,5,6,7
We cannot use "GetMaxU64Bitfield" for non-power-of-two sizes, so just use
the same code that handles N > 8 for these.

Review: http://llvm-reviews.chandlerc.com/D1699
llvm-svn: 190873
2013-09-17 17:51:33 +00:00
Andrew Kaylor bac7af21da Logging enhancements to ConnectionFileDescriptor
llvm-svn: 190872
2013-09-17 17:18:58 +00:00
Arnold Schwaighofer 4a3dcaa193 SLPVectorizer: Don't vectorize phi nodes that use invoke values
We can't insert an insertelement after an invoke. We would have to split a
critical edge. So when we see a phi node that uses an invoke we just give up.

radar://14990770

llvm-svn: 190871
2013-09-17 17:03:29 +00:00
Quentin Colombet b8d672ef5b [InstCombiner] Slice a big load in two loads when the elements are next to each
other in memory.

The motivation was to get rid of truncate and shift right instructions that get
in the way of paired load or floating point load.
E.g.,
Consider the following example:
struct Complex {
  float real;
  float imm;
};

When accessing a complex, llvm was generating a 64-bits load and the imm field
was obtained by a trunc(lshr) sequence, resulting in poor code generation, at
least for x86.

The idea is to declare that two load instructions is the canonical form for
loading two arithmetic type, which are next to each other in memory.

Two scalar loads at a constant offset from each other are pretty
easy to detect for the sorts of passes that like to mess with loads. 

<rdar://problem/14477220>

llvm-svn: 190870
2013-09-17 16:57:34 +00:00
Preston Gurd ba6f9d1b7d Remove unused code, which had been commented out.
llvm-svn: 190869
2013-09-17 16:53:36 +00:00
Daniel Malea 4b86728bf4 Examine more than 1 frame for equivalent contexts in ThreadPlanStepOverRange
- searches frames beginning from the current frame, stops when an equivalent context is found
- not using GetStackFrameCount() for performance reasons
- fixes TestInlineStepping (clang/gcc buildbots)

llvm-svn: 190868
2013-09-17 16:35:45 +00:00
Daniel Malea 7d0d66924f Update Linux bug tracker link in TestPrintStackTraces
- now fails due to llvm.org/pr15415 (partial stack trace while stopped inside read() call)

llvm-svn: 190867
2013-09-17 16:30:30 +00:00
Serge Pavlov 8ec39992c1 Added documentation to getMemsetStores.
llvm-svn: 190866
2013-09-17 16:24:42 +00:00
Daniel Malea f04a22d9dc Re-enabling TestStopHookMultipleThreads
- original bug llvm.org/pr14323 is long closed

llvm-svn: 190865
2013-09-17 16:06:30 +00:00
Ben Langmuir de39520f79 Add llvm.x86.* intrinsics for Intel SHA Extensions
Add llvm.x86.* intrinsics for all of the Intel SHA Extensions instructions, as
well as tests. Also remove mayLoad and hasSideEffects, which can be inferred
from the instruction patterns.

llvm-svn: 190864
2013-09-17 13:44:39 +00:00
Kostya Serebryany bc86efb89d [asan] inline the calls to __asan_stack_free_* with small sizes. Yet another 10%-20% speedup for use-after-return
llvm-svn: 190863
2013-09-17 12:14:50 +00:00
Joey Gouly 830c27ab2d [ARM] Fix the deprecation of MCR encodings that map to CP15{ISB,DSB,DMB}.
llvm-svn: 190862
2013-09-17 09:54:57 +00:00
Daniel Jasper fb81b09d87 clang-format: Don't accidentally move tokens into preprocessor directive.
This fixes llvm.org/PR17265.

Before:
  Foo::Foo()
  #ifdef BAR
      : baz(0)
  #endif {
  }

After:
  Foo::Foo()
  #ifdef BAR
      : baz(0)
  #endif
  {
  }

llvm-svn: 190861
2013-09-17 09:52:48 +00:00
Alexey Samsonov c947eb08b5 [ASan] Don't add SANITIZER_INTERFACE_ATTRIBUTE for internal ASan functions
llvm-svn: 190860
2013-09-17 09:42:03 +00:00
Stepan Dyatkovskiy dc2c4b4462 Bugfix for PR17099:
Wrong cast operation.
MergeFunctions emits Bitcast instead of pointer-to-integer operation.
Patch fixes MergeFunctions::writeThunk function. It replaces
unconditional Bitcast creation with "Value* createCast(...)" method, that
checks operand types and selects proper instruction.
See unit-test as example.

llvm-svn: 190859
2013-09-17 09:36:11 +00:00
Daniel Jasper 545c652d75 clang-format: Add comment to tests explaining their grouping.
llvm-svn: 190858
2013-09-17 09:26:07 +00:00
Joerg Sonnenberger 8092c957d2 Fix typo.
llvm-svn: 190857
2013-09-17 08:46:53 +00:00
Alexey Samsonov a7f35c06dc [ASan] Enable fake stack test on Mac and Android, as no-instrumentation tests are now fixed
llvm-svn: 190856
2013-09-17 08:40:32 +00:00
Daniel Jasper 88f9222c4e clang-format: Fix line breaking bug after empty ifs.
Before:
  if () {
  }
    else {
  }

After:
  if () {
  } else {
  }

This fixed llvm.org/PR17262.

llvm-svn: 190855
2013-09-17 08:28:05 +00:00
Daniel Jasper 0de8efa63d clang-format: Don't split a >>-operator.
Before (with column limit 60):
  aaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa >
      > aaaaa);

After:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaa >> aaaaa);

(Not sure how that could have stayed in that long without being
detected..)

llvm-svn: 190854
2013-09-17 08:15:46 +00:00
Alexey Samsonov 676c109c24 [ASan] Link tests with -pie if ASan runtime uses zero-base shadow
llvm-svn: 190853
2013-09-17 07:50:12 +00:00
Kostya Serebryany 2f5c2be6bd [asan] further speedup use-after-return: simplify deallocation of fake frames. ~ 20% speedup.
llvm-svn: 190852
2013-09-17 07:42:54 +00:00
Elena Demikhovsky ac3e8eb9f0 AVX-512: Converted to Unix style
llvm-svn: 190851
2013-09-17 07:34:34 +00:00
Craig Topper 514f02cc07 Add AES and SHA instructions to the load folding tables.
llvm-svn: 190850
2013-09-17 06:50:11 +00:00
Craig Topper 684abc8236 Fix column alignment. No functional change.
llvm-svn: 190849
2013-09-17 06:05:17 +00:00
Craig Topper 86d79ef4b8 Push contents of X86TargetInfo::setFeatureEnabled down to a static function called by the virtual version and all the places in getDefaultFeatures. This way getDefaultFeatures doesn't make so many virtual calls.
llvm-svn: 190847
2013-09-17 04:51:29 +00:00
Craig Topper 13f61a6c37 Mark setSSELevel/setMMXLevel/setXOPLevel as static since they don't access anything in the class.
llvm-svn: 190846
2013-09-17 04:12:55 +00:00
Eli Friedman b2a8d464aa Don't build extra init lists.
AssignConvertType::IncompatibleVectors means the two types are in fact
compatible. :)

No testcase; I don't think the extra init list has any actual visible effect
other than making the resulting AST dump look a bit strange.

llvm-svn: 190845
2013-09-17 04:07:04 +00:00
Eli Friedman 1409e6e7c6 Fix const-eval of vector init-lists of a vector.
Like any other type, an init list for a vector can have the same type as
the vector itself; handle that case.

<rdar://problem/14990460>

llvm-svn: 190844
2013-09-17 04:07:02 +00:00
Craig Topper 79d1bff2ad Make a more clear AVX-512 section header that matches similar in the file.
llvm-svn: 190843
2013-09-17 03:34:09 +00:00
Tobias Grosser b276158efa clang-format recent change
llvm-svn: 190842
2013-09-17 03:30:36 +00:00
Tobias Grosser 0695ee433e Move SCEVAffinator member definitions out of class body
Instead of defining the relevant functions inline, we now just keep the
declarations in the class itself. This makes the class declaration a lot
easier to read as all functions can be seen at once. We also use this
opportunity to privatize all functions not used in the public interface of the
class.

llvm-svn: 190841
2013-09-17 03:30:31 +00:00
Shankar Easwaran 063b75013f [lld][ELF] Assign sectionChoice properly to ELF atoms
This sets the sectionChoice property for DefinedAtoms. The output section name
is derived by the property of the atom. This also decreases native file size.

Adds a test.

llvm-svn: 190840
2013-09-17 02:56:22 +00:00
Kevin Qin 36399e6b68 Implement 3 AArch64 neon instructions : umov smov ins.
llvm-svn: 190839
2013-09-17 02:21:02 +00:00
Jim Ingham 47ea51f503 Make the docs for the -s -o -S and -O options clearer.
llvm-svn: 190838
2013-09-17 01:53:35 +00:00
Howard Hinnant 5f878d4bd2 G M: Restore the ability for libcxx to compile again on mingw 64.
llvm-svn: 190837
2013-09-17 01:34:47 +00:00
Anna Zaks 226a56fa1d [analyzer] More reliably detect property accessors.
This has a side effect of preventing a crash, which occurs because we get a
property getter declaration, which is overriding but is declared inside
@protocol. Will file a bug about this inconsistency internally. Getting a
small test case is very challenging.

llvm-svn: 190836
2013-09-17 01:30:57 +00:00
Anna Zaks fb05094b52 [analyzer] Stop tracking the objects with attribute cleanup in the RetainCountChecker.
This suppresses false positive leaks. We stop tracking a value if it is assigned to a variable declared with a cleanup attribute.

llvm-svn: 190835
2013-09-17 00:53:28 +00:00