1. Sep 20, 2017
    • Shoaib Meenai's avatar
      [COFF] Check for sections larger than 4 GiB · 4aa7f8a3
      Shoaib Meenai authored
      Sections are limited to 4 GiB. Error out early if a section exceeds this
      size, rather than overflowing the section size and getting confusing
      assertion failures/segfaults later.
      
      Differential Revision: https://reviews.llvm.org/D38005
      
      llvm-svn: 313699
      4aa7f8a3
    • Zachary Turner's avatar
      Make lit stop writing pyc files. · d3bb80a1
      Zachary Turner authored
      Many svn-based buildbots seem to be getting stuck continually
      in tree conflicts due to the output of pyc files.  I'm disabling
      these as a temporary measure in an attempt to get everything
      stable again.
      
      I'll try to remove this code once I understand the problem
      better.
      
      llvm-svn: 313698
      d3bb80a1
    • Rui Ueyama's avatar
      Compact EhSectionPiece from 32 bytes to 16 bytes. · 014b0f24
      Rui Ueyama authored
      EhSectionPiece used to have a pointer to a section, but that pointer was
      mostly redundant because we almost always know what the section is without
      using that pointer. This patch removes the pointer from the struct.
      
      This patch also use uint32_t/int32_t instead of size_t to represent
      offsets that are hardly be larger than 4 GiB. At the moment, I think it is
      OK even if we cannot handle .eh_frame sections larger than 4 GiB.
      
      Differential Revision: https://reviews.llvm.org/D38012
      
      llvm-svn: 313697
      014b0f24
    • Quentin Colombet's avatar
      [MIRPrinter] Print empty successor lists when they cannot be guessed · d652aeb1
      Quentin Colombet authored
      This re-applies commit r313685, this time with the proper updates to
      the test cases.
      
      Original commit message:
      Unreachable blocks in the machine instr representation are these
      weird empty blocks with no successors.
      The MIR printer used to not print empty lists of successors. However,
      the MIR parser now treats non-printed list of successors as "please
      guess it for me". As a result, the parser tries to guess the list of
      successors and given the block is empty, just assumes it falls through
      the next block (if any).
      
      For instance, the following test case used to fail the verifier.
      The MIR printer would print
      
               entry
              /      \
         true (def)   false (no list of successors)
             |
       split.true (use)
      
      The MIR parser would understand this:
      
               entry
              /      \
         true (def)   false
             |        /  <-- invalid edge
       split.true (use)
      
      Because of the invalid edge, we get the "def does not
      dominate all uses" error.
      
      The fix consists in printing empty successor lists, so that the parser
      knows what to do for unreachable blocks.
      
      rdar://problem/34022159
      
      llvm-svn: 313696
      d652aeb1
    • Sanjoy Das's avatar
      [LoopInfo] Make LoopBase and Loop destructors non-public · 76ab2323
      Sanjoy Das authored
      Summary:
      See comment for why I think this is a good idea.
      
      This change also:
      
       - Removes an SCEV test case.  The SCEV test was not testing anything useful (most of it was `#if 0` ed out) and it would need to be updated to deal with a private ~Loop::Loop.
       - Updates the loop pass manager test case to deal with a private ~Loop::Loop.
       - Renames markAsRemoved to markAsErased to contrast with removeLoop, via the usual remove vs. erase idiom we already have for instructions and basic blocks.
      
      Reviewers: chandlerc
      
      Subscribers: mehdi_amini, mcrosier, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D37996
      
      llvm-svn: 313695
      76ab2323
    • Weiming Zhao's avatar
      [libc++] Replace __sync_* functions with __libcpp_atomic_* functions · fbfaec70
      Weiming Zhao authored
      Summary:
      This patch replaces __sync_* with __libcpp_atomic_* and adds a wrapper
      function for __atomic_exchange to support _LIBCPP_HAS_NO_THREADS.
      
      Reviewers: EricWF, jroelofs, mclow.lists, compnerd
      
      Reviewed By: EricWF, compnerd
      
      Subscribers: compnerd, efriedma, cfe-commits, joerg, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D35235
      
      llvm-svn: 313694
      fbfaec70
    • Adam Nemet's avatar
      Add override for ClangDiagnosticHandler::isAnyRemarkEnabled() · 3ac802a1
      Adam Nemet authored
      This is used by the new closure-based variant of
      OptimizationRemarkEmitter::emit().
      
      llvm-svn: 313693
      3ac802a1
    • Sam Clegg's avatar
      [WebAssembly] Add support for naming wasm data segments · b292c259
      Sam Clegg authored
      Add adds support for naming data segments.  This is useful
      useful linkers so that they can merge similar sections.
      
      Differential Revision: https://reviews.llvm.org/D37886
      
      llvm-svn: 313692
      b292c259
    • Adam Nemet's avatar
      Allow ORE.emit to take a closure to delay building the remark object · 15fccf00
      Adam Nemet authored
      In the lambda we are now returning the remark by value so we need to preserve
      its type in the insertion operator.  This requires making the insertion
      operator generic.
      
      I've also converted a few cases to use the new API.  It seems to work pretty
      well.  See the LoopUnroller for a slightly more interesting case.
      
      llvm-svn: 313691
      15fccf00
    • Michael Kruse's avatar
      [ForwardOpTree] Allow out-of-quota in examination part of forwardTree. · 89972e21
      Michael Kruse authored
      Computing the reaching definition in forwardTree() can take a long time
      if the coefficients are large. When the forwarding is
      carried-out (doIt==true), forwardTree() must execute entirely or not at
      all to get a consistent output, which means we cannot just allow
      out-of-quota errors to happen in the middle of the processing.
      
      We introduce the class IslQuotaScope which allows to opt-in code that is
      conformant and has been tested with out-of-quota events. In case of
      ForwardOpTree, out-of-quota is allowed during the operand tree
      examination, but not during the transformation. The same forwardTree()
      recursion is used for examination and execution, meaning that the
      reaching definition has already been computed in the examination tree
      walk and cached for reuse in the transformation tree walk.
      
      This should fix the time-out of grtestutils.ll of the asop buildbot. If
      the compilation still takes too long, we can reduce the max-operations
      allows for -polly-optree.
      
      Differential Revision: https://reviews.llvm.org/D37984
      
      llvm-svn: 313690
      89972e21
    • Vlad Tsyrklevich's avatar
      Revert "Introduce the llvm-cfi-verify tool." · 8930f383
      Vlad Tsyrklevich authored
      This reverts commit r313688, it caused build failures for
      llvm-i686-linux-RA
      
      llvm-svn: 313689
      8930f383
    • Vlad Tsyrklevich's avatar
      Introduce the llvm-cfi-verify tool. · 56406019
      Vlad Tsyrklevich authored
      Summary: Introduces the llvm-cfi-verify tool to llvm. Includes the design document (docs/CFIVerify.rst). Current implementation of the tool is simply a disassembler that identifies and prints the indirect control flow instructions.
      
      Reviewers: vlad.tsyrklevich
      
      Reviewed By: vlad.tsyrklevich
      
      Patch by Mitch Phillips
      
      Subscribers: llvm-commits, kcc, pcc, mgorny
      
      Differential Revision: https://reviews.llvm.org/D37937
      
      llvm-svn: 313688
      56406019
    • Saleem Abdulrasool's avatar
      CodeGen: use range based for loops (NFC) · 399a4e9b
      Saleem Abdulrasool authored
      Simplify the RPOT traversal by using a range based for loop for the
      iterator dereference.
      
      llvm-svn: 313687
      399a4e9b
    • Quentin Colombet's avatar
      Revert "[MIRPrinter] Print empty successor lists when they cannot be guessed" · 6888dbcd
      Quentin Colombet authored
      This reverts commit r313685.
      
      I thought I had ran ninja check, but apparently I didn't...
      Need to update a bunch of mir tests.
      
      llvm-svn: 313686
      6888dbcd
    • Quentin Colombet's avatar
      [MIRPrinter] Print empty successor lists when they cannot be guessed · 7fdaa5e6
      Quentin Colombet authored
      Unreachable blocks in the machine instr representation are these
      weird empty blocks with no successors.
      The MIR printer used to not print empty lists of successors. However,
      the MIR parser now treats non-printed list of successors as "please
      guess it for me". As a result, the parser tries to guess the list of
      successors and given the block is empty, just assumes it falls through
      the next block (if any).
      
      For instance, the following test case used to fail the verifier.
      The MIR printer would print
                entry
               /      \
          true (def)   false (no list of successors)
              |
        split.true (use)
      
      The MIR parser would understand this:
                entry
               /      \
          true (def)   false
              |        /  <-- invalid edge
        split.true (use)
      
      Because of the invalid edge, we get the "def does not
      dominate all uses" error.
      
      The fix consists in printing empty successor lists, so that the parser
      knows what to do for unreachable blocks.
      
      rdar://problem/34022159
      
      llvm-svn: 313685
      7fdaa5e6
    • Andrew Kaylor's avatar
      Fix 32-bit buildbots by removing tests that are dependent on pointer-size comparisons. · 21a2aa72
      Andrew Kaylor authored
      The recently behavior in the code that these tests were meant to be checking will be ammended as soon as a suitable change can be properly reviewed.
      
      llvm-svn: 313684
      21a2aa72
    • Roman Lebedev's avatar
      Revert "[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare" · 918eaf95
      Roman Lebedev authored
      This reverts commit r313677.
      
      Buildbots fail with assertion failure
      Failing Tests (7):
          Clang :: Analysis/null-deref-ps.c
          Clang :: CodeGen/enum.c
          Clang :: Sema/compare.c
          Clang :: Sema/outof-range-constant-compare.c
          Clang :: Sema/tautological-unsigned-enum-zero-compare.c
          Clang :: Sema/tautological-unsigned-zero-compare.c
          Clang :: SemaCXX/compare.cpp
      
      llvm-svn: 313683
      918eaf95
    • Jake Ehrlich's avatar
      Reland "[llvm-objcopy] Add support for nested and overlapping segments" · d246b0a2
      Jake Ehrlich authored
      I didn't initialize a pointer to be nullptr that I needed to.
      
      This change adds support for nested and even overlapping segments. This means
      that PT_PHDR, PT_GNU_RELRO, PT_TLS, and PT_DYNAMIC can be supported properly.
      
      Differential Revision: https://reviews.llvm.org/D36558
      
      llvm-svn: 313682
      d246b0a2
    • Rui Ueyama's avatar
      Rename CieRecord instance variables. · 74ea1f09
      Rui Ueyama authored
      CieRecord is a struct containing a CIE and FDEs, but oftentimes the
      struct itself is named `Cie` which caused some confusion. This patch
      renames them `CieRecords` or `Rec`.
      
      llvm-svn: 313681
      74ea1f09
    • Jonathan Roelofs's avatar
      [ARM] Relax 'cpsie'/'cpsid' flag parsing. · 85908aa8
      Jonathan Roelofs authored
      The ARM docs suggest in examples that the flags can have either case, and there
      are applications in the wild that (libopencm3, for example) that expect to be
      able to use the uppercase spelling.
      
      https://reviews.llvm.org/D37953
      
      llvm-svn: 313680
      85908aa8
    • Reid Kleckner's avatar
      Revert "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs" · ffdf0874
      Reid Kleckner authored
      This reverts r313640, originally r313400, one more time for essentially
      the same issue. My BitVector of spilled location numbers isn't working
      because we coalesce identical DBG_VALUE locations as we rewrite them,
      invalidating the location numbers used to index the BitVector.
      
      llvm-svn: 313679
      ffdf0874
    • Dehao Chen's avatar
      Import all inlined indirect call targets for SamplePGO. · 62b9c33e
      Dehao Chen authored
      Summary: In the ThinLTO compilation, if a function is inlined in the profiling binary, we need to inline it before annotation. If the callee is not available in the primary module, a first step is needed to import that callee function. For the current implementation, if the call is an indirect call, which has been promoted to >1 targets and inlined, SamplePGO will only import one target with the largest sample count. This patch fixed the bug to import all targets instead.
      
      Reviewers: tejohnson, davidxl
      
      Reviewed By: tejohnson
      
      Subscribers: sanjoy, llvm-commits, mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D36637
      
      llvm-svn: 313678
      62b9c33e
    • Roman Lebedev's avatar
      [Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare · c9c9748d
      Roman Lebedev authored
      Summary:
      As requested by Sam McCall:
      > Enums (not new I guess). Typical case: if (enum < 0 || enum > MAX)
      > The warning strongly suggests that the enum < 0 check has no effect
      > (for enums with nonnegative ranges).
      > Clang doesn't seem to optimize such checks out though, and they seem
      > likely to catch bugs in some cases. Yes, only if there's UB elsewhere,
      > but I assume not optimizing out these checks indicates a deliberate
      > decision to stay somewhat compatible with a technically-incorrect
      > mental model.
      > If this is the case, should we move these to a
      > -Wtautological-compare-enum subcategory?
      
      Reviewers: rjmccall, rsmith, aaron.ballman, sammccall, bkramer, djasper
      
      Reviewed By: aaron.ballman
      
      Subscribers: jroelofs, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D37629
      
      llvm-svn: 313677
      c9c9748d
    • Vadzim Dambrouski's avatar
      [MSP430] Align functions on 2-byte boundary instead of 4. · 8cc8b63b
      Vadzim Dambrouski authored
      Summary:
      There is no benefit in having the 4-byte alignment, and removing this
      restriction can save a lot of space for some applications.
      
      Reviewers: asl, awygle
      
      Reviewed By: awygle
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D36165
      
      llvm-svn: 313676
      8cc8b63b
    • Rachel Craik's avatar
      [OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) values · 1cf49e4d
      Rachel Craik authored
      When the value specified for n in ordered(n) is larger than the number of loops a segmentation fault can occur in one of two ways when attempting to print out a diagnostic for an associated depend(sink : vec):
      1) The iteration vector vec contains less than n items
      2) The iteration vector vec contains a variable that is not a loop control variable
      This patch addresses both of these issues.
      
      Differential Revision: https://reviews.llvm.org/D38049
      
      llvm-svn: 313675
      1cf49e4d
    • Craig Topper's avatar
      [TableGen] Generate formatted DAGISelEmitter without relying on formatted_raw_ostream. · 7c1ef6cb
      Craig Topper authored
      The generated DAG isel file currently makes use of formatted_raw_ostream primarily for generating a hierarchical representation while also skipping over the initial comment that contains the current index.
      
      It was reported in D37957 that this formatting might be slow due to the need to keep track of column numbers by monitoring all the written data for new lines.
      
      This patch attempts to rewrite the emitter to make use of simpler formatting mechanisms to generate a fairly similar output. The main difference is that the number in the index comment is now right justified and padded with spaces inside the comment. Previously we appended the spaces after the comment.
      
      Differential Revision: https://reviews.llvm.org/D37966
      
      llvm-svn: 313674
      7c1ef6cb
    • Adrian Prantl's avatar
      llvm-dwarfdump: un-hide more command line options · ccc21c45
      Adrian Prantl authored
      llvm-svn: 313673
      ccc21c45
    • Adrian Prantl's avatar
      Move test into non-target-specific directory. · b780d909
      Adrian Prantl authored
      llvm-svn: 313672
      b780d909
    • Sanjay Patel's avatar
      [SimplifyCFG] fix typos/formatting; NFC · ca14697c
      Sanjay Patel authored
      llvm-svn: 313671
      ca14697c
    • Stanislav Mekhanoshin's avatar
      [AMDGPU] Prevent post-RA scheduler from breaking memory clauses · d4ae470d
      Stanislav Mekhanoshin authored
      The pre-RA scheduler does load/store clustering, but post-RA
      scheduler undoes it. Add mutation to prevent it.
      
      Differential Revision: https://reviews.llvm.org/D38014
      
      llvm-svn: 313670
      d4ae470d
    • Ulrich Weigand's avatar
      [SystemZ] Fix truncstore + bswap codegen bug · 59a01a95
      Ulrich Weigand authored
      SystemZTargetLowering::combineSTORE contains code to transform a
      combination of STORE + BSWAP into a STRV type instruction.
      
      This transformation is correct for regular stores, but not for
      truncating stores.  The routine neglected to check for that case.
      
      Fixes a miscompilation of llvm-objcopy with clang, which caused
      test suite failures in the SystemZ multistage build bot.
      
      llvm-svn: 313669
      59a01a95
    • Saleem Abdulrasool's avatar
      Revert "ExecutionEngine: add R_AARCH64_ABS{16,32}" · 5c37d57e
      Saleem Abdulrasool authored
      This reverts commit SVN r313654.  Seems that it is triggering an
      assertion on Windows specifically.  Revert until I can build on Windows
      and look into what is happening there.
      
      llvm-svn: 313668
      5c37d57e
    • Rui Ueyama's avatar
      Simplify. NFC. · faa38029
      Rui Ueyama authored
      llvm-svn: 313667
      faa38029
    • Andrew Kaylor's avatar
      Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc · 3d0a5408
      Andrew Kaylor authored
      Differential Revision: https://reviews.llvm.org/D37042
      
      llvm-svn: 313666
      3d0a5408
    • Jake Ehrlich's avatar
      Revert "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr" · 31778212
      Jake Ehrlich authored
      This reverts commit r313663. Broken because overlapping-sections was
      reverted.
      
      llvm-svn: 313665
      31778212
    • Jake Ehrlich's avatar
      Revert "[llvm-objcopy] Add support for nested and overlapping segments" · 8f108248
      Jake Ehrlich authored
      This reverts commit r313656. Appears to be broken on Windows.
      
      llvm-svn: 313664
      8f108248
    • Jake Ehrlich's avatar
      [llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr · f20c3f43
      Jake Ehrlich authored
      This change adds support for sections involved in dynamic loading such
      as SHT_DYNAMIC, SHT_DYNSYM, and allocated string tables.
      
      The two added binaries used for tests can be downloaded [[
      https://drive.google.com/file/d/0B3gtIAmiMwZXOXE3T0RobFg4ZTg/view?usp=sharing
      | here ]] and [[
      https://drive.google.com/file/d/0B3gtIAmiMwZXTFJSQUJZMGxNSXc/view?usp=sharing
      | here ]]
      
      Differential Revision: https://reviews.llvm.org/D36560
      
      llvm-svn: 313663
      f20c3f43
    • David Blaikie's avatar
      Fix test to not depend on another subdirectories Input directory · 610e03a0
      David Blaikie authored
      Inputs should be placed local to the test (or possibly in a common
      parent? I think we do that in some places - but the only common parent
      between these two directories is 'test' which seems a bit overly broad).
      
      llvm-svn: 313662
      610e03a0
    • Jake Ehrlich's avatar
      [llvm-objcopy] Add test to check that architecture specific values are not... · 523560ef
      Jake Ehrlich authored
      [llvm-objcopy] Add test to check that architecture specific values are not used on wrong architecture.
      
      This change adds a test that checks the an error is produced when a hexagon
      specific reserved section index is used but e_machine is not EM_HEXAGON.
      
      Differential Revision: https://reviews.llvm.org/D38017
      
      llvm-svn: 313661
      523560ef
    • Krzysztof Parzyszek's avatar
      Recommit r313647 now that GCC seems to accept the offering · affd2019
      Krzysztof Parzyszek authored
      Add some member types to MachineValueTypeSet::const_iterator so that
      iterator_traits can work with it.
      
      Improve TableGen performance of -gen-dag-isel (motivated by X86 backend)
      
      The introduction of parameterized register classes in r313271 caused the
      matcher generation code in TableGen to run much slower, particularly so
      in the unoptimized (debug) build. This patch recovers some of the lost
      performance.
      
      Summary of changes:
      - Cache the set of legal types in TypeInfer::getLegalTypes. The contents
        of this set do not change.
      - Add LLVM_ATTRIBUTE_ALWAYS_INLINE to several small functions. Normally
        this would not be necessary, but in the debug build TableGen is not
        optimized, so this helps a little bit.
      - Add an early exit from TypeSetByHwMode::operator== for the case when
        one or both arguments are "simple", i.e. only have one mode. This
        saves some time in GenerateVariants.
      - Finally, replace the underlying storage type in TypeSetByHwMode::SetType
        with MachineValueTypeSet based on std::array instead of std::set.
        This significantly reduces the number of memory allocation calls.
      
      I've done a number of experiments with the underlying type of InfoByHwMode.
      The type is a map, and for targets that do not use the parameterization,
      this map has only one entry. The best (unoptimized) performance, somewhat
      surprisingly came from std::map, followed closely by std::unordered_map.
      DenseMap was the slowest by a large margin.
      Various hand-crafted solutions (emulating enough of the map interface
      not to make sweeping changes to the users) did not yield any observable
      improvements.
      
      llvm-svn: 313660
      affd2019