Commit Graph

156174 Commits

Author SHA1 Message Date
Edwin Vane 3bf14cebee Introducing new tool clang-replace
Introducing new tool 'clang-replace' that finds files containing
serialized Replacements and applies those changes after deduplication
and detecting conflicts.

Currently the tool does not apply changes. It stops just after the
deduplication and conflict report phase. Forthcoming patches will
complete functionality.

Both build systems updated for new tool.

Includes a conflict test case.

clang-replace added to Doxygen build.

Differential Revision: http://llvm-reviews.chandlerc.com/D1424

llvm-svn: 189008
2013-08-22 13:07:14 +00:00
Chandler Carruth 1c34afcb61 Teach the SLP vectorizer the correct way to check for consecutive access
using GEPs. Previously, it used a number of different heuristics for
analyzing the GEPs. Several of these were conservatively correct, but
failed to fall back to SCEV even when SCEV might have given a reasonable
answer. One was simply incorrect in how it was formulated.

There was good code already to recursively evaluate the constant offsets
in GEPs, look through pointer casts, etc. I gathered this into a form
code like the SLP code can use in a previous commit, which allows all of
this code to become quite simple.

There is some performance (compile time) concern here at first glance as
we're directly attempting to walk both pointers constant GEP chains.
However, a couple of thoughts:

1) The very common cases where there is a dynamic pointer, and a second
   pointer at a constant offset (usually a stride) from it, this code
   will actually not do any unnecessary work.

2) InstCombine and other passes work very hard to collapse constant
   GEPs, so it will be rare that we iterate here for a long time.

That said, if there remain performance problems here, there are some
obvious things that can improve the situation immensely. Doing
a vectorizer-pass-wide memoizer for each individual layer of pointer
values, their base values, and the constant offset is likely to be able
to completely remove redundant work and strictly limit the scaling of
the work to scrape these GEPs. Since this optimization was not done on
the prior version (which would still benefit from it), I've not done it
here. But if folks have benchmarks that slow down it should be straight
forward for them to add.

I've added a test case, but I'm not really confident of the amount of
testing done for different access patterns, strides, and pointer
manipulation.

llvm-svn: 189007
2013-08-22 12:45:17 +00:00
Joey Gouly e1de9e9c33 [ARM] Constrain some register classes in EmitAtomicBinary64 so that
we pass these tests with -verify-machineinstrs.

llvm-svn: 189006
2013-08-22 12:19:24 +00:00
Elena Demikhovsky c35219e3ee AVX-512: Added masked SHIFT commands, more encoding tests
llvm-svn: 189005
2013-08-22 12:18:28 +00:00
Manuel Klimek 2fdbea2819 Revert "Implement a rudimentary form of generic lambdas."
This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.

llvm-svn: 189004
2013-08-22 12:12:24 +00:00
Manuel Klimek 1559dd8a1c Revert "Remove some unused variables identified by Juergen Ributzka *I need to turn on this warning in Visual C++ - sorry!*"
This reverts commit d01d0b63d87ac465f15ce1d6b56bf3faf4525769.

llvm-svn: 189003
2013-08-22 12:12:05 +00:00
Logan Chien 2361f51e82 Fix ARM FastISel PIC function call.
The function call to external function should come with PLT relocation
type if the PIC relocation model is used.

llvm-svn: 189002
2013-08-22 12:08:04 +00:00
NAKAMURA Takumi 2f493c7777 Suppress MemoryBufferTest.cpp on win32 for now. Investigating.
llvm-svn: 189001
2013-08-22 12:00:44 +00:00
Chandler Carruth 989e630871 Add a new helper method to Value to strip in-bounds constant offsets of
pointers, but accumulate the offset into an APInt in the process of
stripping it.

This is a pretty handy thing to have, such as when trying to determine
if two pointers are at some constant relative offset. I'll be committing
a patch shortly to use it for exactly that purpose.

llvm-svn: 189000
2013-08-22 11:25:11 +00:00
NAKAMURA Takumi 774cf3190c MemoryBufferTest.cpp: Tweak offset corresponding to the case that PageSize is greater than 8000.
PageSize, aka AllocationGranularity, is 65536 on Win32 (and Cygwin).

llvm-svn: 188999
2013-08-22 10:23:58 +00:00
NAKAMURA Takumi 26c8ea657f MemoryBuffer.cpp: Consider if PageSize were not 4096 in shouldUseMmap(). Follow-up to r188903.
The AllocationGranularity can be 65536 on Win32, even on Cygwin.

llvm-svn: 188998
2013-08-22 10:23:52 +00:00
Chandler Carruth 6b795f12c4 Clean up the doxygen formatting of the comments on the strip* methods on
Value. These methods probably don't belong here, and I'm discussing
moving the lot of them to a better home, but for now I'm about to extend
their functionality and wanted to tidy them up first.

llvm-svn: 188997
2013-08-22 10:12:18 +00:00
David Majnemer ee7e86c08f Typo.
llvm-svn: 188996
2013-08-22 10:04:41 +00:00
Tim Northover 421804420d ARM: use TableGen patterns to select CMOV operations.
Back in the mists of time (2008), it seems TableGen couldn't handle the
patterns necessary to match ARM's CMOV node that we convert select operations
to, so we wrote a lot of fairly hairy C++ to do it for us.

TableGen can deal with it now: there were a few minor differences to CodeGen
(see tests), but nothing obviously worse that I could see, so we should
probably address anything that *does* come up in a localised manner.

llvm-svn: 188995
2013-08-22 09:57:11 +00:00
Robert Wilhelm cafda82855 const'ify Sema::ActOnCXXTryBlock by
changing Parameter from MutableArrayRef to
ArrayRef.
No functionality change intended.

llvm-svn: 188994
2013-08-22 09:20:03 +00:00
Dmitri Gribenko 56fde96610 gnu-flags.c test: relax the check a bit
This tests warning flags, so no need to test for specific alignment which is
platform-dependent.

llvm-svn: 188993
2013-08-22 08:13:43 +00:00
David Majnemer a39da8e236 Analysis: Make %I in printf more reasonable, add more tests
llvm-svn: 188992
2013-08-22 07:53:21 +00:00
Craig Topper a31a882f87 Constify more uses of ASTContext&. No functional change.
llvm-svn: 188991
2013-08-22 07:09:37 +00:00
Tim Northover 2ddeeed096 ARM: respect tied 64-bit inlineasm operands when printing
The code for 'Q' and 'R' operand modifiers needs to look through tied
operands to discover the register class.

llvm-svn: 188990
2013-08-22 06:51:04 +00:00
Craig Topper c571c810bf Constify some more ASTContext& uses.
llvm-svn: 188989
2013-08-22 06:02:26 +00:00
Shankar Easwaran 1d76b115a3 [lld][test] fix -Wreturn-type error
llvm-svn: 188988
2013-08-22 05:44:08 +00:00
Michael Gottesman 1adac3582d [stackprotector] When finding the split point to splice off the end of a parentmbb into a successmbb, include any DBG_VALUE MI.
Fix for PR16954.

llvm-svn: 188987
2013-08-22 05:40:50 +00:00
Craig Topper e6960e2db5 Constify the ASTContext& passed to Stmt creation functions. Also constify the context in couple other functions that are called from creation functions.
llvm-svn: 188986
2013-08-22 05:28:54 +00:00
Craig Topper ce7167c84a Constify the ASTContext& passed to Expr creation functions. Also constify the context in couple other functions that are called from creation functions.
llvm-svn: 188985
2013-08-22 04:58:56 +00:00
Craig Topper 258a86802a Add test cases for avx512 feature flags. Fix typo in avx512pf options.
llvm-svn: 188984
2013-08-22 04:32:55 +00:00
Shankar Easwaran 5677e433d6 fix build failures on platforms that use -Wunused-private-variable for builds
llvm-svn: 188983
2013-08-22 04:24:57 +00:00
Shankar Easwaran b8b42658ea [lld][Driver] Fix the unit test for lld gnu flavor
llvm-svn: 188982
2013-08-22 03:18:01 +00:00
Shankar Easwaran c1ea4572ba [lld][Hexagon] Enable Hexagon sdata sorting test
llvm-svn: 188981
2013-08-22 03:02:17 +00:00
Matt Arsenault f599d97449 Teach LoopVectorize about address space sizes
llvm-svn: 188980
2013-08-22 02:42:55 +00:00
Faisal Vali dbca225589 Remove some unused variables identified by Juergen Ributzka *I need to turn on this warning in Visual C++ - sorry!*
llvm-svn: 188979
2013-08-22 02:13:38 +00:00
Shankar Easwaran 88d0d44635 [lld] Fix unused private fields for fixing build failure on darwin
llvm-svn: 188978
2013-08-22 01:49:16 +00:00
Faisal Vali fd5277c063 Implement a rudimentary form of generic lambdas.
Specifically, the following features are not included in this commit:
  - any sort of capturing within generic lambdas 
  - nested lambdas
  - conversion operator for captureless lambdas
  - ensuring all visitors are generic lambda aware


As an example of what compiles:

template <class F1, class F2>
struct overload : F1, F2 {
    using F1::operator();
    using F2::operator();
    overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
  };

  auto Recursive = [](auto Self, auto h, auto ... rest) {
    return 1 + Self(Self, rest...);
  };
  auto Base = [](auto Self, auto h) {
      return 1;
  };
  overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
  int num_params =  O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

Some implementation notes:

  - Add a new Declarator context => LambdaExprParameterContext to 
    clang::Declarator to allow the use of 'auto' in declaring generic
    lambda parameters
    
  - Augment AutoType's constructor (similar to how variadic 
    template-type-parameters ala TemplateTypeParmDecl are implemented) to 
    accept an IsParameterPack to encode a generic lambda parameter pack.
  
  - Add various helpers to CXXRecordDecl to facilitate identifying
    and querying a closure class
  
  - LambdaScopeInfo (which maintains the current lambda's Sema state)
    was augmented to house the current depth of the template being
    parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
    so that Sema::ActOnLambdaAutoParameter may use it to create the 
    appropriate list of corresponding TemplateTypeParmDecl for each
    auto parameter identified within the generic lambda (also stored
    within the current LambdaScopeInfo).  Additionally, 
    a TemplateParameterList data-member was added to hold the invented
    TemplateParameterList AST node which will be much more useful
    once we teach TreeTransform how to transform generic lambdas.
    
  - SemaLambda.h was added to hold some common lambda utility
    functions (this file is likely to grow ...)
    
  - Teach Sema::ActOnStartOfFunctionDef to check whether it
    is being called to instantiate a generic lambda's call
    operator, and if so, push an appropriately prepared
    LambdaScopeInfo object on the stack.
    
  - Teach Sema::ActOnStartOfLambdaDefinition to set the
    return type of a lambda without a trailing return type
    to 'auto' in C++1y mode, and teach the return type
    deduction machinery in SemaStmt.cpp to process either
    C++11 and C++14 lambda's correctly depending on the flag.    

  - various tests were added - but much more will be needed.

A greatful thanks to all reviewers including Eli Friedman,  
James Dennett and the ever illuminating Richard Smith.  And 
yet I am certain that I have allowed unidentified bugs to creep in; 
bugs, that I will do my best to slay, once identified!

Thanks!

llvm-svn: 188977
2013-08-22 01:49:11 +00:00
Hans Wennborg da68efdb68 Remove llvm-lit from the cmake install target.
Since it's an llvm-internal tool, we shouldn't install it.

llvm-svn: 188976
2013-08-22 01:34:09 +00:00
Larisse Voufo 8122b22adc Add a constexpr functionality test for static data member templates.
llvm-svn: 188975
2013-08-22 01:05:27 +00:00
Larisse Voufo 72caf2bb6b Refactor for clarity and simplicity.
llvm-svn: 188974
2013-08-22 00:59:14 +00:00
Virgile Bello 6c46216daf Revert the change that was done to test commit access.
llvm-svn: 188973
2013-08-22 00:56:22 +00:00
Virgile Bello d74d2882cd Test commit access.
llvm-svn: 188972
2013-08-22 00:54:36 +00:00
Bill Wendling a08bb49c61 FileCheck-ize tests.
llvm-svn: 188971
2013-08-22 00:51:19 +00:00
Eli Friedman a4ff59a7f8 Adjust for r188968.
llvm-svn: 188970
2013-08-22 00:48:18 +00:00
Larisse Voufo 4cda461ec4 Improve support for static data member templates. This revision still has at least one bug, as it does not respect the variable template specialization hierarchy well.
llvm-svn: 188969
2013-08-22 00:28:27 +00:00
Eli Friedman 5ba37d5282 Split isFromMainFile into two functions.
Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't.  Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).

llvm-svn: 188968
2013-08-22 00:27:10 +00:00
Jim Grosbach 6a7a727174 ARM: R9 is not safe to use for tcGPR.
Indirect tail-calls shouldn't use R9 for the branch destination, as
it's not reliably a call-clobbered register.

rdar://14793425

llvm-svn: 188967
2013-08-22 00:14:24 +00:00
Shankar Easwaran b4fae7c3d0 remove trailing whitespace
llvm-svn: 188965
2013-08-22 00:08:25 +00:00
Howard Hinnant 56c917c57f XFAIL 3 tests on darwin 11-12. The tests have recently been modified, are correct, and pass with an updated libc++.dylib
llvm-svn: 188964
2013-08-22 00:04:22 +00:00
Shankar Easwaran 2032609327 [lld][Darwin] fixing an accidentally removed change
llvm-svn: 188963
2013-08-21 23:31:58 +00:00
David Blaikie eaa49e252d DebugInfo: Require only the declaration of types only used as parameter and return types
llvm-svn: 188962
2013-08-21 23:23:07 +00:00
Shankar Easwaran c4dba32d19 [lld] Fix win7 failure on adding InputGraph functionality
llvm-svn: 188961
2013-08-21 23:13:22 +00:00
Daniel Dunbar 019c5905df [tests] Update to use lit's now-integrated XFAIL handling.
llvm-svn: 188960
2013-08-21 23:06:32 +00:00
Eli Friedman 2d1611b2de Reduce sizeof(TemplateArgument) from 32 to 24.
No intended functionality change.

llvm-svn: 188959
2013-08-21 23:05:56 +00:00
Shankar Easwaran e44104b001 add InputGraph functionality
llvm-svn: 188958
2013-08-21 22:57:10 +00:00