and though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here

  1. 11 Aug, 2017 6 commits
    • Hans Wennborg's avatar
      Merging r310604: · 354119b4
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310604 | niravd | 2017-08-10 08:12:32 -0700 (Thu, 10 Aug 2017) | 13 lines
      
      [X86] Keep dependencies when constructing loads in combineStore
      
      Summary:
      Preserve chain dependecies between old and new loads constructed to
      prevent loads from reordering below later stores.
      
      Fixes PR34088.
      
      Reviewers: craig.topper, spatel, RKSimon, efriedma
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D36528
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310678
      354119b4
    • Hans Wennborg's avatar
      Merging r310006: · 6257aa2a
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310006 | ahatanak | 2017-08-03 16:55:42 -0700 (Thu, 03 Aug 2017) | 22 lines
      
      [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions.
      
      This commit fixes a bug where clang/llvm doesn't emit an unwind table
      for a function when it is marked noexcept. Without this patch, the
      following code terminates with an uncaught exception on ARM64:
      
      int foo1() noexcept {
        try {
          throw 0;
        } catch (int i) {
          return 0;
        }
        return 1;
      }
      
      int main() {
        return foo1();
      }
      
      rdar://problem/32411865
      
      Differential Revision: https://reviews.llvm.org/D35693
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310677
      6257aa2a
    • Hans Wennborg's avatar
      Merging r309633, r309636 and r309640: · 5b60b618
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309633 | ahatanak | 2017-07-31 15:19:34 -0700 (Mon, 31 Jul 2017) | 6 lines
      
      [Driver] Make sure the deployment target is earlier than iOS 11 when
      it is inferred from -isysroot.
      
      This fixes a change that was inadvertently introduced in r309607.
      
      rdar://problem/32230613
      ```
      
      ---------------------------------------------------------------------
      
      ------------------------------------------------------------------------
      r309636 | ahatanak | 2017-07-31 15:46:00 -0700 (Mon, 31 Jul 2017) | 1 line
      
      Silence warning -Wmissing-sysroot.
      ------------------------------------------------------------------------
      
      ------------------------------------------------------------------------
      r309640 | ahatanak | 2017-07-31 16:08:52 -0700 (Mon, 31 Jul 2017) | 1 line
      
      Use -target instead of -arch in test case.
      ------------------------------------------------------------------------
      
      llvm-svn: 310676
      5b60b618
    • Hans Wennborg's avatar
      Merging r309607: · 8765e1e3
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309607 | ahatanak | 2017-07-31 12:16:40 -0700 (Mon, 31 Jul 2017) | 6 lines
      
      [Driver] Allow users to silence the warning that is issued when the
      deployment target is earlier than iOS 11 and the target is 32-bit.
      
      This is a follow-up to r306922.
      
      rdar://problem/32230613
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310675
      8765e1e3
    • Hans Wennborg's avatar
      Merging r309569: · d17519a7
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309569 | alexfh | 2017-07-31 08:21:26 -0700 (Mon, 31 Jul 2017) | 39 lines
      
      Fix -Wshadow false positives with function-local classes.
      
      Summary:
      Fixes http://llvm.org/PR33947.
      
      https://godbolt.org/g/54XRMT
      
      void f(int a) {
        struct A {
          void g(int a) {}
          A() { int a; }
        };
      }
      
      3 : <source>:3:16: warning: declaration shadows a local variable [-Wshadow]
          void g(int a) {}
                     ^
      1 : <source>:1:12: note: previous declaration is here
      void f(int a) {
                 ^
      4 : <source>:4:15: warning: declaration shadows a local variable [-Wshadow]
          A() { int a; }
                    ^
      1 : <source>:1:12: note: previous declaration is here
      void f(int a) {
                 ^
      2 warnings generated.
      
      The local variable `a` of the function `f` can't be accessed from a method of
      the function-local class A, thus no shadowing occurs and no diagnostic is
      needed.
      
      Reviewers: rnk, rsmith, arphaman, Quuxplusone
      
      Reviewed By: rnk, Quuxplusone
      
      Subscribers: Quuxplusone, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D35941
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310674
      d17519a7
    • Hans Wennborg's avatar
      Merging r309614: · 2ab63b13
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309614 | kbelochapka | 2017-07-31 13:11:49 -0700 (Mon, 31 Jul 2017) | 7 lines
      
      [X86][MMX] Added custom lowering action for MMX SELECT (PR30418)
      Fix for pr30418 - error in backend: Cannot select: t17: x86mmx = select_cc t2, Constant:i64<0>, t7, t8, seteq:ch
      Differential Revision: https://reviews.llvm.org/D34661
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310673
      2ab63b13
  2. 10 Aug, 2017 5 commits
    • Hans Wennborg's avatar
      Merging r310526: · dddd37d9
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310526 | ruiu | 2017-08-09 14:32:38 -0700 (Wed, 09 Aug 2017) | 3 lines
      
      Add --icf=none option.
      
      --icf=none negates --icf=all.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310656
      dddd37d9
    • Hans Wennborg's avatar
      Merging r310552: · cdfccb83
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310552 | eladcohen | 2017-08-10 00:44:23 -0700 (Thu, 10 Aug 2017) | 19 lines
      
      [SelectionDAG] When scalarizing vselect, don't assert on
      a legal cond operand.
      
      When scalarizing the result of a vselect, the legalizer currently expects
      to already have scalarized the operands. While this is true for the true/false
      operands (which have the same type as the result), it is not case for the
      condition operand. On X86 AVX512, v1i1 is legal - this leads to operations such
      as '< N x type> vselect < N x i1> < N x type> < N x type>' where < N x type > is
      illegal to hit an assertion during the scalarization.
      
      The handling is similar to r205625.
      This also exposes the fact that (v1i1 extract_subvector) should be legal
      and selectable on AVX512 - We do this by custom lowering to vector_extract_elt.
      This still leaves us in some cases with redundant dag nodes which will be
      combined in a separate soon to come patch.
      
      This fixes pr33349.
      
      Differential revision: https://reviews.llvm.org/D36511
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310635
      cdfccb83
    • Hans Wennborg's avatar
      Merging r310481, r310492 and r310510: · 1d6f2b30
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310481 | davide | 2017-08-09 08:13:50 -0700 (Wed, 09 Aug 2017) | 8 lines
      
      [ValueTracking] Honour recursion limit.
      
      The recently improved support for `icmp` in ValueTracking
      (r307304) exposes the fact that `isImplied` condition doesn't
      really bail out if we hit the recursion limit (and calls
      `computeKnownBits` which increases the depth and asserts).
      
      Differential Revision:  https://reviews.llvm.org/D36512
      ```
      
      ---------------------------------------------------------------------
      
      ------------------------------------------------------------------------
      r310492 | davide | 2017-08-09 09:06:04 -0700 (Wed, 09 Aug 2017) | 1 line
      
      [ValueTracking] Update tests to unbreak the bots.
      ------------------------------------------------------------------------
      
      ------------------------------------------------------------------------
      r310510 | spatel | 2017-08-09 11:56:26 -0700 (Wed, 09 Aug 2017) | 6 lines
      
      [SimplifyCFG] remove checks for crasher test from r310481
      
      Not sure why the earlier version would fail, but trying to get the bots
      (and my local machine) to pass again.
      
      
      ------------------------------------------------------------------------
      
      llvm-svn: 310634
      1d6f2b30
    • Hans Wennborg's avatar
      Merging r308847: · 2ef80ce8
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r308847 | mkazantsev | 2017-07-23 08:40:19 -0700 (Sun, 23 Jul 2017) | 24 lines
      
      [SCEV] Limit max size of AddRecExpr during evolving
      
      When SCEV calculates product of two SCEVAddRecs from the same loop, it
      tries to combine them into one big AddRecExpr. If the sizes of the initial
      SCEVs were `S1` and `S2`, the size of their product is `S1 + S2 - 1`, and every
      operand of the resulting SCEV is combined from operands of initial SCEV and
      has much higher complexity than they have.
      
      As result, if we try to calculate something like:
        %x1 = {a,+,b}
        %x2 = mul i32 %x1, %x1
        %x3 = mul i32 %x2, %x1
        %x4 = mul i32 %x3, %x2
        ...
      The size of such SCEVs grows as `2^N`, and the arguments
      become more and more complex as we go forth. This leads
      to long compilation and huge memory consumption.
      
      This patch sets a limit after which we don't try to combine two
      `SCEVAddRecExpr`s into one. By default, max allowed size of the
      resulting AddRecExpr is set to 16.
      
      Differential Revision: https://reviews.llvm.org/D35664
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310629
      2ef80ce8
    • Hans Wennborg's avatar
      Merging r310534: · 375efaaa
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310534 | matze | 2017-08-09 15:22:05 -0700 (Wed, 09 Aug 2017) | 20 lines
      
      ARM: Fix CMP_SWAP expansion
      
      Clean up after my misguided attempt in r304267 to "fix" CMP_SWAP
      returning an uninitialized status value.
      
      - I was always using tMOVi8 to zero the status register which cannot
        encode higher register numbers and llvm would silently miscompile)
      
      - Nobody was ever looking at that status value outside the expansion.
        ARMDAGToDAGISel::SelectCMP_SWAP() the only place creating CMP_SWAP
        instructions was not mapping anything to it. (The cmpxchg status value
        from llvm IR is lowered to a manual comparison after the CMP_SWAP)
      
      So this:
      - Renames the register from "status" to "temp" it make it obvious that
        it isn't used outside the expansion.
      - Remove the zeroing status/temp register.
      - Keep the live-in list improvements from r304267
      
      Fixes http://llvm.org/PR34056
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310628
      375efaaa
  3. 09 Aug, 2017 3 commits
    • Hans Wennborg's avatar
      Merging r309758: · 9364e3bf
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309758 | sanjoy | 2017-08-01 15:37:58 -0700 (Tue, 01 Aug 2017) | 6 lines
      
      [SCEV/IndVars] Always compute loop exiting values if the backedge count is 0
      
      If SCEV can prove that the backedge taken count for a loop is zero, it does not
      need to "understand" a recursive PHI to compute its exiting value.
      
      This should fix PR33885.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310538
      9364e3bf
    • Craig Topper's avatar
      More x86 release notes. · 92f3b69a
      Craig Topper authored
      llvm-svn: 310501
      92f3b69a
    • Hans Wennborg's avatar
      ReleaseNotes: Zig · d55dcea6
      Hans Wennborg authored
      llvm-svn: 310500
      d55dcea6
  4. 08 Aug, 2017 5 commits
    • Hans Wennborg's avatar
      Merging r310253 and r310267: · 1baca789
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310253 | sdardis | 2017-08-07 06:30:03 -0700 (Mon, 07 Aug 2017) | 2 lines
      
      [DebugInfo][DWARF] Use PRIx64 explicitly in output.
      ```
      
      ---------------------------------------------------------------------
      
      ------------------------------------------------------------------------
      r310267 | sdardis | 2017-08-07 09:08:11 -0700 (Mon, 07 Aug 2017) | 2 lines
      
      [DebugInfo][DWARF] Address paulr's comment on rL310253.
      
      ------------------------------------------------------------------------
      
      llvm-svn: 310398
      1baca789
    • Hans Wennborg's avatar
      Merging r310250: · 62940d57
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310250 | sdardis | 2017-08-07 05:29:38 -0700 (Mon, 07 Aug 2017) | 2 lines
      
      [llvm-objdump] Use PRIx64 for output of ARM64_RELOC_ADDEND
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310396
      62940d57
    • Hans Wennborg's avatar
      Merging r308722: · dda69b2e
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r308722 | ibiryukov | 2017-07-21 02:24:00 -0700 (Fri, 21 Jul 2017) | 13 lines
      
      Fixed failing assert in code completion.
      
      Summary:
      The code was accessing uninstantiated default argument.
      This resulted in failing assertion at ParmVarDecl::getDefaultArg().
      
      Reviewers: erikjv, klimek, bkramer, krasimir
      
      Reviewed By: krasimir
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D35682
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310395
      dda69b2e
    • Hans Wennborg's avatar
      Merging r309263: · 91d29e79
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309263 | psmith | 2017-07-27 03:43:53 -0700 (Thu, 27 Jul 2017) | 6 lines
      
      [CodeGen][ARM] ARM runtime helper functions are not always soft-fp
      
      Re-commit r309257 with less precise register checks in arm-float-helpers.c
      test.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310393
      91d29e79
    • Hans Wennborg's avatar
      Merging r310359: · f475f73d
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310359 | n.bozhenov | 2017-08-08 07:13:50 -0700 (Tue, 08 Aug 2017) | 4 lines
      
      [libclang] Fix PR34055 (incompatible update of clang-c/Index.h)
      
      Fixes a regression introduced by r308218.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310390
      f475f73d
  5. 07 Aug, 2017 9 commits
    • Hans Wennborg's avatar
      Merging r310240: · d95203ba
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310240 | vitalybuka | 2017-08-07 00:12:33 -0700 (Mon, 07 Aug 2017) | 1 line
      
      Add -asan-force-dynamic-shadow test
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310316
      d95203ba
    • Hans Wennborg's avatar
      Merging r310241 and r310242: · f8f93f84
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310241 | vitalybuka | 2017-08-07 00:12:34 -0700 (Mon, 07 Aug 2017) | 3 lines
      
      [asan] Disable checking of arguments passed by value for --asan-force-dynamic-shadow
      
      Fails with "Instruction does not dominate all uses!"
      ```
      
      ---------------------------------------------------------------------
      
      ------------------------------------------------------------------------
      r310242 | vitalybuka | 2017-08-07 00:35:33 -0700 (Mon, 07 Aug 2017) | 1 line
      
      [asan] Fix asan dynamic shadow check before copyArgsPassedByValToAllocas
      ------------------------------------------------------------------------
      
      llvm-svn: 310309
      f8f93f84
    • Hans Wennborg's avatar
      Merging r310158: · c8a6ff51
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310158 | rtrieu | 2017-08-04 17:54:19 -0700 (Fri, 04 Aug 2017) | 8 lines
      
      [ODRHash] Treat some non-templated classes as templated.
      
      When using nested classes, if the inner class is not templated, but the outer
      class is templated, the inner class will not be templated, but may have some
      traits as if it were.  This is particularly evident if the inner class
      refers to the outer class in some fashion.  Treat any class that is in the
      context of a templated class as also a templated class.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310302
      c8a6ff51
    • Hans Wennborg's avatar
      Merging r310191: · 6f335f8b
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310191 | ctopper | 2017-08-05 16:35:54 -0700 (Sat, 05 Aug 2017) | 18 lines
      
      [X86] Enable isel to use the PAUSE instruction even when SSE2 is disabled. Clang part
      
      Summary:
      On older processors this instruction encoding is treated as a NOP.
      
      MSVC doesn't disable intrinsics based on features the way clang/gcc does. Because the PAUSE instruction encoding doesn't crash older processors, some software out there uses these intrinsics without checking for SSE2.
      
      This change also seems to also be consistent with gcc behavior.
      
      Fixes PR34079
      
      Reviewers: RKSimon, zvi
      
      Reviewed By: RKSimon
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D36362
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310294
      6f335f8b
    • Hans Wennborg's avatar
      Merging r310190: · 03a96f4e
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310190 | ctopper | 2017-08-05 16:34:44 -0700 (Sat, 05 Aug 2017) | 18 lines
      
      [X86] Enable isel to use the PAUSE instruction even when SSE2 is disabled
      
      Summary:
      On older processors this instruction encoding is treated as a NOP.
      
      MSVC doesn't disable intrinsics based on features the way clang/gcc does. Because the PAUSE instruction encoding doesn't crash older processors, some software out there uses these intrinsics without checking for SSE2.
      
      This change also seems to also be consistent with gcc behavior.
      
      Fixes PR34079
      
      Reviewers: RKSimon, zvi
      
      Reviewed By: RKSimon
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D36361
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310293
      03a96f4e
    • Hans Wennborg's avatar
      Merging r310071: · 6e83d91d
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310071 | rnk | 2017-08-04 10:09:11 -0700 (Fri, 04 Aug 2017) | 8 lines
      
      [ArgPromotion] Preserve alignment of byval argument in new alloca
      
      The frontend may have requested a higher alignment for any reason, and
      downstream optimizations may already have taken advantage of it.  We
      should keep the same alignment when moving the allocation from the
      parameter area to the local variable area.
      
      Fixes PR34038
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310292
      6e83d91d
    • Hans Wennborg's avatar
      Merging r309851: · 8bfea7d1
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309851 | marshall | 2017-08-02 11:21:34 -0700 (Wed, 02 Aug 2017) | 1 line
      
      Fix shadowing warning
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310288
      8bfea7d1
    • Hans Wennborg's avatar
      Merging r309838: · c4081cdc
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309838 | marshall | 2017-08-02 10:31:09 -0700 (Wed, 02 Aug 2017) | 1 line
      
      Fix PR33727: std::basic_stringbuf only works with DefaultConstructible allocators. Thanks to Jonathan Wakely for the report and suggested fix
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310287
      c4081cdc
    • Hans Wennborg's avatar
      Merging r309296 and r309307: · c57773fe
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309296 | marshall | 2017-07-27 10:44:03 -0700 (Thu, 27 Jul 2017) | 1 line
      
      Implement P0739R0: 'Some improvements to class template argument deduction integration into the standard library' This is an API change (not ABI change) due to a late change in the c++17 standard
      ```
      
      ---------------------------------------------------------------------
      
      ------------------------------------------------------------------------
      r309307 | marshall | 2017-07-27 11:47:35 -0700 (Thu, 27 Jul 2017) | 1 line
      
      Disable the deduction guide test I added in 309296 for the moment, while I figure out which compilers don't support deduction guides
      ------------------------------------------------------------------------
      
      llvm-svn: 310286
      c57773fe
  6. 04 Aug, 2017 3 commits
    • Hans Wennborg's avatar
      Merging r310057: · cec266a0
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r310057 | smaksimovic | 2017-08-04 05:37:34 -0700 (Fri, 04 Aug 2017) | 8 lines
      
      Revert r304953 for release 5.0.0
      
      This is causing failures when compiling clang with -O3
      as one of the structures used by clang is passed by
      value and uses the fastcc calling convention.
      
      Faliures manifest for stage2 mips build.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310074
      cec266a0
    • Hans Wennborg's avatar
      Merging r309920: · 63657a11
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309920 | ericwf | 2017-08-02 21:28:10 -0700 (Wed, 02 Aug 2017) | 5 lines
      
      Fix libcxx build with glibc 2.26+ by removing xlocale.h include.
      
      Patch by Khem Raj. Reviewed as D35697. Also see PR33729.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310068
      63657a11
    • Hans Wennborg's avatar
      Merging r309975: (except the docs/ part) · b3e50e6a
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309975 | rsmith | 2017-08-03 12:24:27 -0700 (Thu, 03 Aug 2017) | 4 lines
      
      Don't emit undefined-internal warnings for CXXDeductionGuideDecls.
      
      Patch by ~paul (cynecx on phabricator)! Some test massaging by me.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 310067
      b3e50e6a
  7. 03 Aug, 2017 5 commits
    • Hans Wennborg's avatar
      Merging r309928: · 335fe85c
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309928 | ewancrawford | 2017-08-03 02:23:03 -0700 (Thu, 03 Aug 2017) | 56 lines
      
      [Cloning] Move distinct GlobalVariable debug info metadata in CloneModule
      
      Duplicating the distinct Subprogram and CU metadata nodes seems like the incorrect thing to do in CloneModule for GlobalVariable debug info. As it results in the scope of the GlobalVariable DI no longer being consistent with the rest of the module, and the new CU is absent from llvm.dbg.cu.
      
      Fixed by adding RF_MoveDistinctMDs to MapMetadata flags for GlobalVariables.
      
      Current unit test IR after clone:
      ```
      @gv = global i32 1, comdat($comdat), !dbg !0, !type !5
      
      define private void @f() comdat($comdat) personality void ()* @persfn !dbg !14 {
      
      !llvm.dbg.cu = !{!10}
      
      !0 = !DIGlobalVariableExpression(var: !1)
      !1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
      !2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
      !3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
      !4 = !DISubroutineType(types: !5)
      !5 = !{}
      !6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
      !7 = !DIFile(filename: "filename.c", directory: "/file/dir")
      !8 = !{!0}
      !9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
      !10 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !11)
      !11 = !{!12}
      !12 = !DIGlobalVariableExpression(var: !13)
      !13 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !14, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
      !14 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !10, variables: !5)
      ```
      
      Patched IR after clone:
      ```
      @gv = global i32 1, comdat($comdat), !dbg !0, !type !5
      
      define private void @f() comdat($comdat) personality void ()* @persfn !dbg !2 {
      
      !llvm.dbg.cu = !{!6}
      
      !0 = !DIGlobalVariableExpression(var: !1)
      !1 = distinct !DIGlobalVariable(name: "gv", linkageName: "gv", scope: !2, file: !3, line: 1, type: !9, isLocal: false, isDefinition: true)
      !2 = distinct !DISubprogram(name: "f", linkageName: "f", scope: null, file: !3, line: 4, type: !4, isLocal: true, isDefinition: true, scopeLine: 3, isOptimized: false, unit: !6, variables: !5)
      !3 = !DIFile(filename: "filename.c", directory: "/file/dir/")
      !4 = !DISubroutineType(types: !5)
      !5 = !{}
      !6 = distinct !DICompileUnit(language: DW_LANG_C99, file: !7, producer: "CloneModule", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, globals: !8)
      !7 = !DIFile(filename: "filename.c", directory: "/file/dir")
      !8 = !{!0}
      !9 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "decltype(nullptr)")
      ```
      
      Reviewers: aprantl, probinson, dblaikie, echristo, loladiro
      Reviewed By: aprantl
      Subscribers: llvm-commits
      Differential Revision: https://reviews.llvm.org/D36082
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 309965
      335fe85c
    • Hans Wennborg's avatar
      Merging r309917: · add6d42a
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309917 | ericwf | 2017-08-02 19:50:43 -0700 (Wed, 02 Aug 2017) | 4 lines
      
      Add system header pragma to BSD locale fallback headers.
      
      This prevent leaking warnings to the user about use of C++11
      extensions in C++03.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 309958
      add6d42a
    • Hans Wennborg's avatar
      Merging r309651 and r309849: · 5341de3a
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309651 | inouehrs | 2017-07-31 20:32:15 -0700 (Mon, 31 Jul 2017) | 16 lines
      
      [StackColoring] Update AliasAnalysis information in stack coloring pass
      
      Stack coloring pass need to maintain AliasAnalysis information when merging stack slots of different types.
      Actually, there is a FIXME comment in StackColoring.cpp
      
      // FIXME: In order to enable the use of TBAA when using AA in CodeGen,
      // we'll also need to update the TBAA nodes in MMOs with values
      // derived from the merged allocas.
      
      But, TBAA has been already enabled in CodeGen without fixing this pass.
      The incorrect TBAA metadata results in recent failures in bootstrap test on ppc64le (PR33928) by allowing unsafe instruction scheduling.
      Although we observed the problem on ppc64le, this is a platform neutral issue.
      
      This patch makes the stack coloring pass maintains AliasAnalysis information when merging multiple stack slots.
      ```
      
      ---------------------------------------------------------------------
      
      ------------------------------------------------------------------------
      r309849 | inouehrs | 2017-08-02 11:16:32 -0700 (Wed, 02 Aug 2017) | 19 lines
      
      [StackColoring] Update AliasAnalysis information in stack coloring pass (part 2)
      
      This patch is update after the first patch (https://reviews.llvm.org/rL309651) based on the post-commit comments.
      
      Stack coloring pass need to maintain AliasAnalysis information when merging stack slots of different types.
      Actually, there is a FIXME comment in StackColoring.cpp
      
      // FIXME: In order to enable the use of TBAA when using AA in CodeGen,
      // we'll also need to update the TBAA nodes in MMOs with values
      // derived from the merged allocas.
      
      But, TBAA has been already enabled in CodeGen without fixing this pass.
      The incorrect TBAA metadata results in recent failures in bootstrap test on ppc64le (PR33928) by allowing unsafe instruction scheduling.
      Although we observed the problem on ppc64le, this is a platform neutral issue.
      
      This patch makes the stack coloring pass maintains AliasAnalysis information when merging multiple stack slots.
      
      This patch fixes PR33928.
      ------------------------------------------------------------------------
      
      llvm-svn: 309957
      5341de3a
    • Hans Wennborg's avatar
      Merging r309930: · 6df79000
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309930 | sdardis | 2017-08-03 02:38:46 -0700 (Thu, 03 Aug 2017) | 19 lines
      
      [SelectionDAG] Resolve PR33978.
      
      rL306209 taught SelectionDAG how to add the dereferenceable flag when
      expanding memcpy and memmove. The fix however contained a nit where
      the offset + size was constructed as an APInt of PointerSize rather
      than PointerSizeInBits.
      
      This lead to isDereferenceableAndAlignedPointer() get truncated values or
      values which would be sign extended within that function leading to
      incorrect results.
      
      Thanks to Alex Crichton for reporting the issue!
      
      This resolves PR33978.
      
      Reviewers: inouehrs
      
      Differential Revision: https://reviews.llvm.org/D36236
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 309956
      6df79000
    • Hans Wennborg's avatar
      Merging r308996: · db948f87
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r308996 | gornishanov | 2017-07-25 11:01:49 -0700 (Tue, 25 Jul 2017) | 9 lines
      
      [coroutines] Add serialization/deserialization of coroutines
      
      Reviewers: rsmith
      
      Reviewed By: rsmith
      
      Subscribers: EricWF, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D35383
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 309954
      db948f87
  8. 02 Aug, 2017 4 commits
    • Hans Wennborg's avatar
      Merging r309523: · 4a02632d
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309523 | brad | 2017-07-30 14:13:59 -0700 (Sun, 30 Jul 2017) | 2 lines
      
      Also pass -pie back to the linker when linking on OpenBSD.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 309844
      4a02632d
    • Hans Wennborg's avatar
      Merging r309744: · 44b69d03
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309744 | mstorsjo | 2017-08-01 14:13:54 -0700 (Tue, 01 Aug 2017) | 29 lines
      
      [AArch64] Rewrite stack frame handling for win64 vararg functions
      
      The previous attempt, which made do with a single offset in
      computeCalleeSaveRegisterPairs, wasn't quite enough. The previous
      attempt only worked as long as CombineSPBump == true (since the
      offset would be adjusted later in fixupCalleeSaveRestoreStackOffset).
      
      Instead include the size for the fixed stack area used for win64
      varargs in calculations in emitPrologue/emitEpilogue. The stack
      consists of mainly three parts;
      - AFI->getLocalStackSize()
      - AFI->getCalleeSavedStackSize()
      - FixedObject
      
      Most of the places in the code which previously used the CSStackSize
      now use PrologueSaveSize instead, which is the sum of the latter
      two, while some cases which need exactly the middle one use
      AFI->getCalleeSavedStackSize() explicitly instead of a local variable.
      
      In addition to moving the offsetting into emitPrologue/emitEpilogue
      (which fixes functions with CombineSPBump == false), also set the
      frame pointer to point to the right location, where the frame pointer
      and link register actually are stored. In addition to the prologue/epilogue,
      this also requires changes to resolveFrameIndexReference.
      
      Add tests for a function that keeps a frame pointer and another one
      that uses a VLA.
      
      Differential Revision: https://reviews.llvm.org/D35919
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 309843
      44b69d03
    • Hans Wennborg's avatar
      Merging r309555: · de7a97cd
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309555 | mstorsjo | 2017-07-31 04:18:41 -0700 (Mon, 31 Jul 2017) | 10 lines
      
      [llvm-dlltool] Write correct weak externals
      
      Previously, the created object files for the import library were broken.
      Write the symbol table before the string table. Simplify the code by
      using a separate variable Prefix instead of duplicating a few lines.
      
      Also update the coff-weak-exports to actually check that the generated
      weak symbols can be found as intended.
      
      Differential Revision: https://reviews.llvm.org/D36065
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 309837
      de7a97cd
    • Hans Wennborg's avatar
      Merging r309594: · cfa7f080
      Hans Wennborg authored
      ```---------------------------------------------------------------------
      r309594 | majnemer | 2017-07-31 10:47:07 -0700 (Mon, 31 Jul 2017) | 4 lines
      
      [IPSCCP] Guard a user of getInitializer with hasDefinitiveInitializer
      
      We are not allowed to reason about an initializer value without first
      consulting hasDefinitiveInitializer.
      ```
      
      ---------------------------------------------------------------------
      
      llvm-svn: 309827
      cfa7f080