1. Apr 08, 2020
  2. Apr 07, 2020
    • Nikita Popov's avatar
      [RDA] Avoid full reprocessing of blocks in loops (NFCI) · 259649a5
      Nikita Popov authored
      RDA sometimes needs to visit blocks twice, to take into account
      reaching defs coming in along loop back edges. Currently it handles
      repeated visitation the same way as usual, which means that it will
      scan through all instructions and their reg unit defs again. Not
      only is this very inefficient, it also means that all reaching defs
      in loops are going to be inserted twice.
      
      We can do much better than this. The only thing we need to handle
      is a new reaching def from a predecessor, which either needs to be
      prepended to the reaching definitions (if there was no reaching def
      from a predecessor), or needs to replace an existing predecessor
      reaching def, if it is more recent. Since D77508 we only store the
      most recent predecessor reaching def, so that's the only one that
      may need updating.
      
      This also has the nice side-effect that reaching definitions are
      now automatically sorted and unique, so drop the llvm::sort() call
      in favor of an assertion.
      
      Differential Revision: https://reviews.llvm.org/D77511
      259649a5
    • Nikita Popov's avatar
      [RDA] Don't pass down TraversedMBB (NFC) · 76e987b3
      Nikita Popov authored
      Only pass the MachineBasicBlock itself down to helper methods,
      they don't need to know about traversal. Move the debug print
      into the main method.
      76e987b3
    • Nikita Popov's avatar
      [RDA] Avoid inserting duplicate reaching defs (NFCI) · 361c29d7
      Nikita Popov authored
      An instruction may define the same reg unit multiple times,
      avoid inserting the same reaching def multiple times in that case.
      
      Also print the reg unit, rather than the super-register, in the
      debug code.
      361c29d7
    • David Tenty's avatar
      [NFC][PowerPC] Cleanup 64-bit and Darwin CalleeSavedRegs · b9245f14
      David Tenty authored
      Summary:
      - Remove the no longer used Darwin CalleeSavedRegs
      - Combine the SVR464 callee saved regs and AIX64 since the two are (and should be) identical into PPC64
      - Update tests for 64-bit CSR change
      
      Reviewers: sfertile, ZarkoCA, cebowleratibm, jasonliu, #powerpc
      
      Reviewed By: sfertile
      
      Subscribers: wuzish, nemanjai, hiraditya, kbarton, shchenz, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77235
      b9245f14
    • diggerlin's avatar
      [NFC][XCOFF] refactor readobj/XCOFFDumper.cpp · 3aa08494
      diggerlin authored
      SUMMARY:
      
      refactor readobj/XCOFFDumper.cpp with helper function getAlignmentLog2() , getSymbolType(), isLabel().
      
      Reviewers: Hubert Tong, James Henderson
      Subscribers: rupprecht, seiyai,hiradityu
      
      Differential Revision: https://reviews.llvm.org/D77562
      3aa08494
    • Dmitry Vyukov's avatar
      tsan: fix Go/ppc build · 2db63723
      Dmitry Vyukov authored
      PPC now requires ReExec due to ASLR.
      Pull in more functions for Go build.
      
      Suggested-by: Keith Randall (khr)
      2db63723
    • Raphael Isemann's avatar
    • Sriraman Tallam's avatar
      LLD Support for Basic Block Sections · 94317878
      Sriraman Tallam authored
      This is part of the Propeller framework to do post link code layout
      optimizations. Please see the RFC here:
      https://groups.google.com/forum/#!msg/llvm-dev/ef3mKzAdJ7U/1shV64BYBAAJ and the
      detailed RFC doc here:
      https://github.com/google/llvm-propeller/blob/plo-dev/Propeller_RFC.pdf
      
      This patch adds lld support for basic block sections and performs relaxations
      after the basic blocks have been reordered.
      
      After the linker has reordered the basic block sections according to the
      desired sequence, it runs a relaxation pass to optimize jump instructions.
      Currently, the compiler emits the long form of all jump instructions. AMD64 ISA
      supports variants of jump instructions with one byte offset or a four byte
      offset. The compiler generates jump instructions with R_X86_64 32-bit PC
      relative relocations. We would like to use a new relocation type for these jump
      instructions as it makes it easy and accurate while relaxing these instructions.
      
      The relaxation pass does two things:
      
      First, it deletes all explicit fall-through direct jump instructions between
      adjacent basic blocks. This is done by discarding the tail of the basic block
      section.
      
      Second, If there are consecutive jump instructions, it checks if the first
      conditional jump can be inverted to convert the second into a fall through and
      delete the second.
      
      The jump instructions are relaxed by using jump instruction mods, something
      like relocations. These are used to modify the opcode of the jump instruction.
      Jump instruction mods contain three values, instruction offset, jump type and
      size. While writing this jump instruction out to the final binary, the linker
      uses the jump instruction mod to determine the opcode and the size of the
      modified jump instruction. These mods are required because the input object
      files are memory-mapped without write permissions and directly modifying the
      object files requires copying these sections. Copying a large number of basic
      block sections significantly bloats memory.
      
      Differential Revision: https://reviews.llvm.org/D68065
      94317878
    • Michael Liao's avatar
      [hip] Remove `hip_pinned_shadow`. · c97be2c3
      Michael Liao authored
      Summary:
      - Use `device_builtin_surface` and `device_builtin_texture` for
        surface/texture reference support. So far, both the host and device
        use the same reference type, which could be revised later when
        interface/implementation is stablized.
      
      Reviewers: yaxunl
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D77583
      c97be2c3
    • Simon Pilgrim's avatar
      [X86][SSE] combineX86ShufflesConstants - early out for zeroable vectors (PR45443) · e3b60597
      Simon Pilgrim authored
      Shuffle combining can insert zero byte sized elements into the shuffle mask, which combineX86ShufflesConstants will attempt to fold without taking into account whether the byte-sized type is legal (e.g. AVX512F only targets).
      
      If we have a full-zeroable vector then we should just return a zero version of the root type, otherwise if the type isn't valid we should bail.
      
      Fixes PR45443
      e3b60597
    • Artem Dergachev's avatar
      6b3353e8
    • Louis Dionne's avatar
      [libc++abi] Enable the new libc++ testing format by default · 2eb8864b
      Louis Dionne authored
      The new format should be equivalent to the old format, and it is now the
      default format when running the libc++ tests. This commit changes the
      libc++abi tests to use the new format by default too. If unexpected failures
      are discovered, it should be fine to revert this commit until they are
      addressed.
      
      Also note that it is still possible to use the old format by passing
      `--param=use_old_format=True` when running Lit for the time being.
      2eb8864b
    • Louis Dionne's avatar
      [libc++] Support .sh.s tests in the new format · f75ebe1a
      Louis Dionne authored
      libc++abi has two of these tests.
      f75ebe1a
    • Marcel Hlopko's avatar
      [Syntax] Add mapping from spelled to expanded tokens for TokenBuffer · 1bf055c9
      Marcel Hlopko authored
      Summary:
      Same restrictions apply as in the other direction: macro arguments are
      not supported yet, only full macro expansions can be mapped.
      
      Taking over from https://reviews.llvm.org/D72581.
      
      Reviewers: gribozavr2, sammccall
      
      Reviewed By: gribozavr2
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D77209
      1bf055c9
    • Sam McCall's avatar
      [Syntax] Merge overlapping top-level macros in TokenBuffer · d66afd6d
      Sam McCall authored
      Summary:
      Our previous definition of "top-level" was too informal, and didn't
      allow for overlapping macros that each directly produce expanded tokens.
      See D77507 for previous discussion.
      
      Fixes http://bugs.llvm.org/show_bug.cgi?id=45428
      
      Reviewers: kadircet, vabridgers
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D77615
      d66afd6d
    • Florian Hahn's avatar
      [Clang] Add llvm.loop.unroll.disable to loops with -fno-unroll-loops. · 338be9c5
      Florian Hahn authored
      Currently Clang does not respect -fno-unroll-loops during LTO. During
      D76916 it was suggested to respect -fno-unroll-loops on a TU basis.
      
      This patch uses the existing llvm.loop.unroll.disable metadata to
      disable loop unrolling explicitly for each loop in the TU if
      unrolling is disabled. This should ensure that loops from TUs compiled
      with -fno-unroll-loops are skipped by the unroller during LTO.
      
      This also means that if a loop from a TU with -fno-unroll-loops
      gets inlined into a TU without this option, the loop won't be
      unrolled.
      
      Due to the fact that some transforms might drop loop metadata, there
      potentially are cases in which we still unroll loops from TUs with
      -fno-unroll-loops. I think we should fix those issues rather than
      introducing a function attribute to disable loop unrolling during LTO.
      Improving the metadata handling will benefit other use cases, like
      various loop pragmas, too. And it is an improvement to clang completely
      ignoring -fno-unroll-loops during LTO.
      
      If that direction looks good, we can use a similar approach to also
      respect -fno-vectorize during LTO, at least for LoopVectorize.
      
      In the future, this might also allow us to remove the UnrollLoops option
      LLVM's PassManagerBuilder.
      
      Reviewers: Meinersbur, hfinkel, dexonsmith, tejohnson
      
      Reviewed By: Meinersbur, tejohnson
      
      Differential Revision: https://reviews.llvm.org/D77058
      338be9c5