1. Aug 15, 2014
    • Daniel Jasper's avatar
      clang-format: Prefer breaking after return type over template param · ea79ea16
      Daniel Jasper authored
      Before:
        typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa aaaaaaaaaa<
            aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(bool *aaaaaaaaaaaaaaaaaa,
                                                         bool *aa) {}
      
      After:
        typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa
        aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
            bool *aaaaaaaaaaaaaaaaaa, bool *aa) {}
      
      llvm-svn: 215693
      ea79ea16
    • Daniel Jasper's avatar
      clang-format: [proto] Understand text-format nesting without : · 497d9fdc
      Daniel Jasper authored
      Before:
        option (MyProto.options) = {
          field_c : "OK" msg_field{field_d : 123}
        };
      
      After:
        option (MyProto.options) = {
          field_c : "OK"
          msg_field{field_d : 123}
        };
      
      (Note that the colon after "msg_field" is optional).
      
      llvm-svn: 215692
      497d9fdc
    • Eric Fiselier's avatar
    • Chandler Carruth's avatar
      [x86] Fix the very broken formation of vpunpck instructions in the · 17fd848b
      Chandler Carruth authored
      target-specific shuffl DAG combines.
      
      We were recognizing the paired shuffles backwards. This code needs to be
      replaced anyways as we have the same functionality elsewhere, but I'll
      do the refactoring in a follow-up, this is the minimal fix to the
      behavior.
      
      In addition to fixing miscompiles with the new vector shuffle lowering,
      it also causes the canonicalization to kick in much better, selecting
      the smaller encoding variants in lots of places in the new AVX path.
      This still isn't quite ideal as we don't need both the shufpd and the
      punpck instructions, but that'll get fixed in a follow-up patch.
      
      llvm-svn: 215690
      17fd848b
    • Rafael Espindola's avatar
      Don't print comments to an object streamer :-) · fe963b17
      Rafael Espindola authored
      llvm-svn: 215689
      fe963b17
    • Rafael Espindola's avatar
      EmitAbsValue is the same as EmitValue on non-darwin. NFC. · 91f6621e
      Rafael Espindola authored
      llvm-svn: 215688
      91f6621e
    • Chandler Carruth's avatar
      [x86] Fix PR20540 where the x86 shuffle DAG combiner had completely · 372c143c
      Chandler Carruth authored
      broken logic for merging shuffle masks in the face of SM_SentinelZero
      mask operands.
      
      While these are '-1' they don't mean 'undef' the way '-1' means in the
      pre-legalized shuffle masks. Instead, they mean that the shuffle
      operation is forcibly zeroing that lane. Reflect this and explicitly
      handle it in a bunch of places. In one place the effect is equivalent
      but much more clear. In the rest it was really weirdly broken.
      
      Also, rewrite the entire merging thing to be a more directy operation
      with a single loop and just doing math to map the indices through the
      various masks.
      
      Also add a bunch of asserts to try to make in extremely clear what the
      different masks can possibly look like.
      
      Finally, add some comments to clarify that we're merging shuffle masks
      *up* here rather than *down* as we do everywhere else, and thus the
      logic is quite confusing.
      
      Thanks to several different people for sending test cases, and for
      Robert Khasanov for an initial attempt at fixing.
      
      llvm-svn: 215687
      372c143c
    • Keno Fischer's avatar
      Make sure CallExpr::getLocStart doesn't segfault · 070db177
      Keno Fischer authored
      Summary:
      When the CallExpr passed to Sema::ConvertArgumentsForCall has all default parameters, and the number of actual arguments passed is zero, this function will segfault in the call to Call->getLocStart() if the Callee has an invalid getLocStart(), the reason being that since ConvertArgumentsForCall has set the correct number of arguments, but has not filled them in yet, getLocStart() will try to access the first (not yet existent) argument and thus segfaults.
      
      This fixes that by making getLocStart return an invalid source location if the queried argument is NULL rather than segfaulting.
      
      Reviewers: rnk
      
      Reviewed By: rnk
      
      Subscribers: cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D4917
      
      llvm-svn: 215686
      070db177
    • Bill Schmidt's avatar
      [PPC64] Add missing dependency on X2 to LDinto_toc. · 3755e17d
      Bill Schmidt authored
      The LDinto_toc pattern has been part of 64-bit PowerPC for a long
      time, and represents loading from a memory location into the TOC
      register (X2).  However, this pattern doesn't explicitly record that
      it modifies that register.  This patch adds the missing dependency.
      
      It was very surprising to me that this has never shown up as a problem
      in the past, and that we only saw this problem recently in a single
      scenario when building a self-hosted clang.  It turns out that in most
      cases we have another dependency present that keeps the LDinto_toc
      instruction tied in place.  LDinto_toc is used for TOC restore
      following a call site, so this is a typical sequence:
      
         BCTRL8 <regmask>, %CTR8<imp-use>, %RM<imp-use>, %X3<imp-use>, %X12<imp-use>, %X1<imp-def>, ...
         LDinto_toc 24, %X1
         ADJCALLSTACKUP 96, 0, %R1<imp-def>, %R1<imp-use>
      
      Because the LDinto_toc is inserted prior to the ADJCALLSTACKUP, there
      is a natural anti-dependency between the two that keeps it in place.
      
      Therefore we don't usually see a problem.  However, in one particular
      case, one call is followed immediately by another call, and the second
      call requires a parameter that is a TOC-relative address.  This is the
      code sequence:
      
        BCTRL8 <regmask>, %CTR8<imp-use>, %RM<imp-use>, %X3<imp-use>, %X4<imp-use>, %X5<imp-use>, %X12<imp-use>, %X1<imp-def>, ...
        LDinto_toc 24, %X1
        ADJCALLSTACKUP 96, 0, %R1<imp-def>, %R1<imp-use>
        ADJCALLSTACKDOWN 96, %R1<imp-def>, %R1<imp-use>
        %vreg39<def> = ADDIStocHA %X2, <ga:@.str>; G8RC_and_G8RC_NOX0:%vreg39
        %vreg40<def> = ADDItocL %vreg39<kill>, <ga:@.str>; G8RC:%vreg40 G8RC_and_G8RC_NOX0:%vreg39
      
      Note that the back-to-back stack adjustments are the same size!  The
      back end is smart enough to recognize this and optimize them away:
      
        BCTRL8 <regmask>, %CTR8<imp-use>, %RM<imp-use>, %X3<imp-use>, %X4<imp-use>, %X5<imp-use>, %X12<imp-use>, %X1<imp-def>, ...
        LDinto_toc 24, %X1
        %vreg39<def> = ADDIStocHA %X2, <ga:@.str>; G8RC_and_G8RC_NOX0:%vreg39
        %vreg40<def> = ADDItocL %vreg39<kill>, <ga:@.str>; G8RC:%vreg40 G8RC_and_G8RC_NOX0:%vreg39
      
      Now there is nothing to prevent the ADDIStocHA instruction from moving
      ahead of the LDinto_toc instruction, and because of the longest-path
      heuristic, this is what happens.
      
      With the accompanying patch, %X2 is represented as an implicit def:
      
        BCTRL8 <regmask>, %CTR8<imp-use>, %RM<imp-use>, %X3<imp-use>, %X4<imp-use>, %X5<imp-use>, %X12<imp-use>, %X1<imp-def>, ...
        LDinto_toc 24, %X1, %X2<imp-def,dead>
        ADJCALLSTACKUP 96, 0, %R1<imp-def,dead>, %R1<imp-use>
        ADJCALLSTACKDOWN 96, %R1<imp-def,dead>, %R1<imp-use>
        %vreg39<def> = ADDIStocHA %X2, <ga:@.str>; G8RC_and_G8RC_NOX0:%vreg39
        %vreg40<def> = ADDItocL %vreg39<kill>, <ga:@.str>; G8RC:%vreg40 G8RC_and_G8RC_NOX0:%vreg39
      
      So now when the two stack adjustments are removed, ADDIStocHA is
      prevented from being moved above LDinto_toc.
      
      I have not yet created a test case for this, because the original
      failure occurs on a relatively large function that needs reduction.
      However, this is a fairly serious bug, despite its infrequency, and I
      wanted to get this patch onto the list as soon as possible so that it
      can be considered for a 3.5 backport.  I'll work on whittling down a
      test case.
      
      Have we missed the boat for 3.5 at this point?
      
      Thanks,
      Bill
      
      llvm-svn: 215685
      3755e17d
    • Johannes Doerfert's avatar
      Added support for modulo expressions · 5130c849
      Johannes Doerfert authored
        The support is limited to signed modulo access and condition
        expressions with a constant right hand side, e.g., A[i % 2] or
        A[i % 9]. Test cases are modified according to this new feature and
        new test cases are added.
      
      Differential Revision: http://reviews.llvm.org/D4843
      
      llvm-svn: 215684
      5130c849
    • Reid Kleckner's avatar
      Limit our MSVC compat hack for nested names from dependent bases · 062be331
      Reid Kleckner authored
      Previously, any undeclared unqualified id starting a nested name
      specifier in a dependent context would have its lookup retried during
      template instantiation.  Now we limit that retry hack to methods of a
      class with dependent bases.  Free function templates in particular are
      no longer affected by this hack.
      
      Also, diagnose this as a Microsoft extension. This has the downside that
      template authors may see this warning *and* an error during
      instantiation time about this identifier. Fixing that will probably
      require formalizing some kind of "delayed" identifier, instead of our
      ad-hoc solutions of forming dependent AST nodes when lookup fails.
      
      Based on a patch by Kim Gräsman!
      
      Differential Revision: http://reviews.llvm.org/D4854
      
      llvm-svn: 215683
      062be331
    • Juergen Ributzka's avatar
      [FastISel][ARM] Fall-back to constant pool loads when materializing an i32 constant. · 81db58e1
      Juergen Ributzka authored
      FastEmit_i won't always succeed to materialize an i32 constant and just fail.
      This would trigger a fall-back to SelectionDAG, which is really not necessary.
      
      This fix will first fall-back to a constant pool load to materialize the constant
      before giving up for good.
      
      This fixes <rdar://problem/18022633>.
      
      llvm-svn: 215682
      81db58e1
    • Eric Christopher's avatar
      Fix typo in error message. · 7cbd2b99
      Eric Christopher authored
      llvm-svn: 215681
      7cbd2b99
    • Nick Kledzik's avatar
      [mach-o] Support -F and -framework options in darwin driver · 2d835dad
      Nick Kledzik authored
      Darwin has a packaging mechanism for shared libraries and headers called
      frameworks.  A directory Foo.framework contains a shared library binary file
      "Foo" and a subdirectory "Headers". Most OS frameworks are all in one
      directory /System/Library/Frameworks/.  As a linking convenience, the linker
      option "-framework Foo" means search the framework directories specified
      with -F (analogous to -L) looking for a shared library Foo.framework/Foo.
      
      llvm-svn: 215680
      2d835dad
    • DeLesley Hutchins's avatar
      Thread Safety Analysis: Move -Wthread-safety-negative out of the · e8d2a9d7
      DeLesley Hutchins authored
      -Wthread-safety umbrella flag, pending updates to documentation.  The flag
      works, but is likely to be confusing to existing users of -Wthread-safety.
      
      llvm-svn: 215679
      e8d2a9d7
    • Brad Smith's avatar
      Use a switch statement for IsIntegratedAssemblerDefault(). · d4cb911d
      Brad Smith authored
      llvm-svn: 215678
      d4cb911d
    • DeLesley Hutchins's avatar
      Thread safety analysis: add -Wthread-safety-verbose flag, which adds... · eb0ea5f4
      DeLesley Hutchins authored
      Thread safety analysis: add -Wthread-safety-verbose flag, which adds additional notes that are helpful when compiling statistics on thread safety warnings.
      
      llvm-svn: 215677
      eb0ea5f4
    • Hal Finkel's avatar
      Copy noalias metadata from call sites to inlined instructions · 61c38612
      Hal Finkel authored
      When a call site with noalias metadata is inlined, that metadata can be
      propagated directly to the inlined instructions (only those that might access
      memory because it is not useful on the others). Prior to inlining, the noalias
      metadata could express that a call would not alias with some other memory
      access, which implies that no instruction within that called function would
      alias. By propagating the metadata to the inlined instructions, we preserve
      that knowledge.
      
      This should complete the enhancements requested in PR20500.
      
      llvm-svn: 215676
      61c38612
    • Richard Smith's avatar
      [modules] Turn off a broken optimization: we need to pick up implicit special · 462b6fc6
      Richard Smith authored
      members from all redefinitions of a class that have them, in case the special
      member is defined in one module but only declared in another.
      
      llvm-svn: 215675
      462b6fc6
    • Zachary Turner's avatar
      Update .gitignore for MacOSX · 015ebbc8
      Zachary Turner authored
      Differential Revision: http://reviews.llvm.org/D4912
      
      llvm-svn: 215674
      015ebbc8
    • Juergen Ributzka's avatar
      Revert several FastISel commits to track down a buildbot error. · 790bacf2
      Juergen Ributzka authored
      This reverts:
      r215595 "[FastISel][X86] Add large code model support for materializing floating-point constants."
      r215594 "[FastISel][X86] Use XOR to materialize the "0" value."
      r215593 "[FastISel][X86] Emit more efficient instructions for integer constant materialization."
      r215591 "[FastISel][AArch64] Make use of the zero register when possible."
      r215588 "[FastISel] Let the target decide first if it wants to materialize a constant."
      r215582 "[FastISel][AArch64] Cleanup constant materialization code. NFCI."
      
      llvm-svn: 215673
      790bacf2
    • Reid Kleckner's avatar
      Don't Lex past EOF when lexing _Pragma · 53e6a5d6
      Reid Kleckner authored
      Fixes PR20662.
      
      llvm-svn: 215672
      53e6a5d6
    • DeLesley Hutchins's avatar
      Thread Safety Analysis: fix to improve handling of references to guarded · 4133b13b
      DeLesley Hutchins authored
      data members and range based for loops.
      
      llvm-svn: 215671
      4133b13b
    • Joerg Sonnenberger's avatar
      Use the big endian emulations for NetBSD/arm in EB mode. · b7045342
      Joerg Sonnenberger authored
      llvm-svn: 215670
      b7045342
    • Greg Clayton's avatar
      fix the _regexp-break command to allow quotes around the name: · 2d4b5129
      Greg Clayton authored
      (lldb) b "Foo::Bar::Baz"
      
      <rdar://problem/11782098>
      
      llvm-svn: 215668
      2d4b5129
    • Duncan P. N. Exon Smith's avatar
      Fix whitespace error from r215279, NFC · e85df165
      Duncan P. N. Exon Smith authored
      llvm-svn: 215667
      e85df165
    • Adam Nemet's avatar
      [AVX512] Add FMA intrinsics · 2278fcbf
      Adam Nemet authored
      Part of <rdar://problem/17688758>
      
      llvm-svn: 215666
      2278fcbf
    • Adam Nemet's avatar
      [AVX512] Add test for FMA masking instrinsics · 241c3252
      Adam Nemet authored
      llvm-svn: 215665
      241c3252
    • Adam Nemet's avatar
      [AVX512] Switch FMA intrinsics to the masking version · 6fa67575
      Adam Nemet authored
      This does the renaming and updates the lowering logic.
      
      Part of <rdar://problem/17688758>
      
      llvm-svn: 215664
      6fa67575
    • Adam Nemet's avatar
      [X86] Break out logic to map FMA Intrinsic number to Opcode · 9b4f08c7
      Adam Nemet authored
      No functional change.  Will be used to lower AVX512 masking FMA intrinsics.
      
      llvm-svn: 215663
      9b4f08c7
    • Adam Nemet's avatar
      [AVX512] Add enum for the static rounding types · 50b83f0b
      Adam Nemet authored
      No functional change.  This will be used by the new FMA intrinsic lowering
      code.
      
      We can probably add NO_EXC here as well, I am just not too familiar with this
      part of AVX512 yet.  We can add that later.
      
      llvm-svn: 215662
      50b83f0b
    • Adam Nemet's avatar
      [AVX512] Break out the logic to lower masking intrinsics · 6f31063d
      Adam Nemet authored
      No functional change.  This will be used by the FMA intrinsic lowering as well
      and hopefully many more.
      
      llvm-svn: 215661
      6f31063d
    • Adam Nemet's avatar
      [AVX512] Add masking variant for the FMA instructions · 2e91ee58
      Adam Nemet authored
      This change further evolves the base class AVX512_masking in order to make it
      suitable for the masking variants of the FMA instructions.
      
      Besides AVX512_masking there is now a new base class that instructions
      including FMAs can use: AVX512_masking_3src.  With three-source (destructive)
      instructions one of the sources is already tied to the destination.  This
      difference from AVX512_masking is captured by this new class.  The common bits
      between _masking and _masking_3src are broken out into a new super class
      called AVX512_masking_common.
      
      As with valign, there is some corresponding restructuring of the underlying
      format classes.  The idea is the same we want to derive from two classes
      essentially: one providing the format bits and another format-independent
      multiclass supplying the various masking and non-masking instruction variants.
      
      Existing fma tests in avx512-fma*.ll provide coverage here for the non-masking
      variants.  For masking, the next patches in the series will add intrinsics and
      intrinsic tests.
      
      For AVX512_masking_3src to work, the (ins ...) dag has to be passed *without*
      the leading source operand that is tied to dst ($src1).  This is necessary to
      properly construct the (ins ...) for the different variants.  For the record,
      I did check that if $src is mistakenly included, you do get a fairly intuitive
      error message from the tablegen backend.
      
      Part of <rdar://problem/17688758>
      
      llvm-svn: 215660
      2e91ee58
    • Juergen Ributzka's avatar
      Revert "[FastISel][AArch64] Add support for more addressing modes." · 34ed422c
      Juergen Ributzka authored
      This reverts commits r215597, because it might have broken the build bots.
      
      llvm-svn: 215659
      34ed422c
    • Hafiz Abid Qadeer's avatar
      Fix 'pid' and 'executable' fields in the list-thread-group. · eba7eb7b
      Hafiz Abid Qadeer authored
      The documentation says that these fields should be generated when 
      we have proper process or target file. Current implementation did not
      check for this. Eclipse seem to use list-thread-group command even
      before setting the executable in which case current implementation
      can return garbage data.
      
      llvm-svn: 215658
      eba7eb7b
    • Hal Finkel's avatar
      Add noalias metadata for general calls (not just memory intrinsics) during inlining · d2dee16c
      Hal Finkel authored
      When preserving noalias function parameter attributes by adding noalias
      metadata in the inliner, we should do this for general function calls (not just
      memory intrinsics). The logic is very similar to what already existed (except
      that we want to add this metadata even for functions taking no relevant
      parameters). This metadata can be used by ModRef queries in the caller after
      inlining.
      
      This addresses the first part of PR20500. Adding noalias metadata during
      inlining is still turned off by default.
      
      llvm-svn: 215657
      d2dee16c
    • Hafiz Abid Qadeer's avatar
      Implementation of exec-run using lldb API. · 6cd101a3
      Hafiz Abid Qadeer authored
      Previously it was using run command which did not set the process
      pointer in the sessionInfo. This commit also sends the proper
      out-of-band data.
      
      llvm-svn: 215656
      6cd101a3
    • Deepak Panickal's avatar
      Fix command "gdb-set" to handle long option --threadgroup and accept... · f92dc58f
      Deepak Panickal authored
      Fix command "gdb-set" to handle long option --threadgroup and accept --longOption type words as just words for string types.
      For example, MI command "17-gdb-set --thread-group i1 args --interpreter" is now acceptable, "--interpreter" was previous not valid.
      
      llvm-svn: 215655
      f92dc58f
    • Zachary Turner's avatar
      Modification to clang-format style. · 43f30a40
      Zachary Turner authored
      Fixes constructor initializer list and function return type style.
      
      llvm-svn: 215654
      43f30a40
    • Moritz Roth's avatar
      Testing commit access. · 6f257cf2
      Moritz Roth authored
      Remove a trailing whitespace.
      
      llvm-svn: 215653
      6f257cf2