1. May 03, 2022
    • Alexey Bataev's avatar
      [SLP]Improve reductions analysis and emission, part 1. · 7ea03f0b
      Alexey Bataev authored
      Currently SLP vectorizer walks through the instructions and selects
      3 main classes of values: 1) reduction operations - instructions with same
      reduction opcode (add, mul, min/max, etc.), which build the reduction,
      2) reduced values - instructions with the same opcodes, but different
      from the reduction opcode, 3) extra arguments - all other values,
      instructions from the different basic block rather than the root node,
      instructions with to many/less uses.
      
      This scheme is not very efficient. It excludes some instructions and all
      non-instruction values from the reductions (constants, proficient
      gathers), to many possibly reduced values are marked as extra arguments.
      Patch improves this process by introducing a bit extended analysis
      stage. During this stage, we still try to select 3 classes of the
      values: 1) reduction operations - same as before, 2) possibly reduced
      values - all instructions from the current block/non-instructions, which
      may build a vectorization tree, 3) extra arguments - instructions from
      the different basic blocks. Additionally, an extra sorting of the
      possibly reduced values occurs to build the scalar sequences which
      highly likely will bed vectorized, e.g. loads are grouped by the
      distance between them, constants are grouped together, cmp instructions
      are sorted by their compare types and predicates, extractelement
      instructions are sorted by the vector operand, etc. Also, these groups
      are reordered by their length so the longest group is the first in the
      list of the possibly reduced values.
      
      The vectorization process tries to emit the reductions for all these
      groups. These reductions, remaining non-vectorized possible reduced
      values and extra arguments are then combined into the final expression
      just like it was before.
      
      Differential Revision: https://reviews.llvm.org/D114171
      7ea03f0b
    • Ilya Leoshkevich's avatar
      [SystemZ] Accept (. - 0x100000000) PCRel32 constants · 7070c6a9
      Ilya Leoshkevich authored
      Clang does not accept instructions like brasl %r0,.-0x100000000,
      because the second operand's right-hand-side (0x100000000) barely
      misses the acceptable range. However, since it's being subtracted, it
      makes sense to perform the range check on the negated value.
      
      Reviewed By: uweigand
      
      Differential Revision: https://reviews.llvm.org/D124780
      7070c6a9
    • Sanjay Patel's avatar
      [SDAG] fix miscompile when casting int->FP->int · 747c6a0c
      Sanjay Patel authored
      This is the codegen equivalent of D124692.
      
      As shown in https://github.com/llvm/llvm-project/issues/55150 -
      the existing fold may be wrong when converting to a signed value.
      This is a quick fix to avoid the miscompile.
      https://alive2.llvm.org/ce/z/KtaDmd
      
      Differential Revision: https://reviews.llvm.org/D124771
      747c6a0c
    • Chris Bieneman's avatar
      [Object][DX] Initial DXContainer parsing support · 4070aa01
      Chris Bieneman authored
      This patch begins adding DXContainer parsing support to libObject.
      Following the pattern used by ELFFile my goal here is to write a
      standalone DXContainer parser and later write an adapter interface to
      support a subset of the ObjectFile interfaces so that we can add
      limited objdump support. I will also be adding ObjectYAML support to
      help drive testing of the object tools and MC-level object writers as
      those come together.
      
      DXContainer is a slightly odd format. It is arranged in "parts" that
      are semantically similar to sections, but it doesn't support symbol
      listing.
      
      Reviewed By: MaskRay
      
      Differential Revision: https://reviews.llvm.org/D124643
      4070aa01
    • Amaury Séchet's avatar
      Update movmsk-cmp.ll to match improvements made to InstCombine · b6beb590
      Amaury Séchet authored
      This reflects the changes in the IR generated by InstCombine as pointed out by @RKSimon in https://reviews.llvm.org/D124743#3485199
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D124756
      b6beb590
    • Florian Hahn's avatar
      [VPlan] Do not create VPWidenCall recipes for scalar vector factors. · 0ef8ca6d
      Florian Hahn authored
      'Widen' recipe are only used when actual vector values are generated.
      Fix tryToWidenCall to do not create VPWidenCallRecipes for scalar vector
      factors.
      
      This was exposed by D123720, because the widened recipes are considered
      vector users.
      
      Reviewed By: Ayal
      
      Differential Revision: https://reviews.llvm.org/D124718
      0ef8ca6d
    • Quentin Colombet's avatar
      [DeadArgElim] Set unused arguments for internal functions · e547a333
      Quentin Colombet authored
      Prior to this patch we would only set to undef the unused arguments of the
      external functions. The rationale was that unused arguments of internal
      functions wouldn't need to be turned into undef arguments because they
      should have been simply eliminated by the time we reach that code.
      
      This is actually not true because there are plenty of cases where we can't
      remove unused arguments. For instance, if the internal function is used in
      an indirect call, it may not be possible to change the function signature.
      Yet, for statically known call-sites we would still like to mark the unused
      arguments as undef.
      
      This patch enables the "set undef arguments" optimization on internal
      functions when we encounter cases where internal functions cannot be
      optimized. I.e., whenever an internal function is marked "live".
      
      Differential Revision: https://reviews.llvm.org/D124699
      e547a333
    • Erich Keane's avatar
      Revert "Re-apply 4b6c2cd642 "Deferred Concept Instantiation Implementation""" · 45c07db3
      Erich Keane authored
      This reverts commit a9789910.
      
      The patch caused some problems with the libc++ `__range_adaptor_closure`
      that I haven't been able to figure out the cause of, so I am reverting
      while I figure out whether this is a solvable problem/issue with the
        CFE, or libc++ depending on an older 'incorrect' behavior.
      45c07db3
    • Paul Robinson's avatar
      [PS5] Check for HasNativeLLVMSupport · 2ed0123b
      Paul Robinson authored
      2ed0123b
    • Paul Robinson's avatar
      [NFC] Add test for HasNativeLLVMSupport · 214265bc
      Paul Robinson authored
      It looks like there used to be a test for this, but the test evolved
      in a way that caused the check for the diagnostic to be eliminated.
      Add a test that is obviously and specifically for that diagnostic.
      214265bc
    • Fangrui Song's avatar
      [Driver][test] Remove clang{{.*}} when testing -cc1 command lines · 98067998
      Fangrui Song authored
      The majority of tests omit testing "clang" for -cc1 command lines. In addition,
      some distributions symlink %clang to an executable with a content hash based
      filename so clang{{.*}} check won't work.
      
      With this change, we can remove many -no-canonical-prefixes whose purpose was to
      make the tests pass on such distributions.
      98067998
    • Alex Brachet's avatar
      [ifs] Fix bug where exclude only excluded when outputting ifs files · 7aaad7b1
      Alex Brachet authored
      Now output elf files will also have excluded symbols removed.
      
      Reviewed By: haowei
      
      Differential Revision: https://reviews.llvm.org/D124781
      7aaad7b1
    • Jonas Paulsson's avatar
      Reapply "[BuildLibCalls] Introduce getOrInsertLibFunc() for use when building · 304378fd
      Jonas Paulsson authored
      libcalls." (was 0f8c6267). This reverts commit 14d93907.
      
      The patch previously failed to recognize cases where user had defined a
      function alias with an identical name as that of the library
      function. Module::getFunction() would then return nullptr which is what the
      sanitizer discovered.
      
      In this updated version a new function isLibFuncEmittable() has as well been
      introduced which is now used instead of TLI->has() anytime a library function
      is to be emitted . It additionally also makes sure there is e.g. no function
      alias with the same name in the module.
      
      Reviewed By: Eli Friedman
      
      Differential Revision: https://reviews.llvm.org/D123198
      304378fd
    • Raghu Maddhipatla's avatar
      [mlir][OpenMP] Add omp.cancel and omp.cancellationpoint. · c685f821
      Raghu Maddhipatla authored
      Reviewed By: kiranchandramohan, peixin, shraiysh
      
      Differential Revision: https://reviews.llvm.org/D123828
      c685f821
    • Eugene Zhulenev's avatar
      [mlir] CRunnerUtils: qualify UnrankedMemRefType to avoid collisions with mlir::UnrankedMemRefType · 38d0df55
      Eugene Zhulenev authored
      When CRunnerUtils included together with MLIR IR headers, it can lead to compilation errors.
      
      Reviewed By: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D124744
      38d0df55
    • Harald van Dijk's avatar
      Mark identifier prefixes as substitutable · fed7be09
      Harald van Dijk authored
      The Itanium C++ ABI says prefixes are substitutable. For most prefixes
      we already handle this: the manglePrefix(const DeclContext *, bool) and
      manglePrefix(QualType) overloads explicitly handles substitutions or
      defer to functions that handle substitutions on their behalf. The
      manglePrefix(NestedNameSpecifier *) overload, however, is different and
      handles some cases implicitly, but not all. The Identifier case was not
      handled; this change adds handling for it, as well as a test case.
      
      Reviewed By: erichkeane
      
      Differential Revision: https://reviews.llvm.org/D122663
      fed7be09
    • Amy Kwan's avatar
      [PowerPC] Enable CR bits support for Power8 and above. · 2534dc12
      Amy Kwan authored
      This patch turns on support for CR bit accesses for Power8 and above. The reason
      why CR bits are turned on as the default for Power8 and above is that because
      later architectures make use of builtins and instructions that require CR bit
      accesses (such as the use of setbc in the vector string isolate predicate
      and bcd builtins on Power10).
      
      This patch also adds the clang portion to allow for turning on CR bits in the
      front end if the user so desires to.
      
      Differential Revision: https://reviews.llvm.org/D124060
      2534dc12
    • Fangrui Song's avatar
    • Arthur Eubanks's avatar
      [GlobalOpt] Iterate over replaced values deterministically to constprop · b07aab8f
      Arthur Eubanks authored
      If there are pre-existing dead instructions, the order we visit replaced
      values can cause us sometimes to not delete dead instructions.
      
      The added test non-deterministically failed without the change.
      b07aab8f
    • Fangrui Song's avatar
      [Driver][test] Add back some -no-canonical-prefixes · 46cc04de
      Fangrui Song authored
      To make them meaningful, it's useful to check "clang". Use
      -no-canonical-prefixes to support distributions that symlink %clang to an
      executable with a filename not ending in "clang".
      46cc04de
  2. May 02, 2022