1. Mar 15, 2021
  2. Mar 14, 2021
  3. Mar 13, 2021
    • Stefan Gränitz's avatar
    • kuterd's avatar
      [Attributor][fix] Remove problematic EXPENSIVE_CHECK · 44c1425c
      kuterd authored
      Remove the check that is causing compilation issues in
      some build configurations.
      44c1425c
    • Sanjay Patel's avatar
      [InstCombine] avoid creating an extra instruction in zext fold and possible inf-loop · 4224a369
      Sanjay Patel authored
      The structure of this fold is suspect vs. most of instcombine
      because it creates instructions and tries to delete them
      immediately after.
      
      If we don't have the operand types for the icmps, then we are
      not behaving as assumed. And as shown in PR49475, we can inf-loop.
      4224a369
    • Roman Lebedev's avatar
      Reland [SCEV] Improve modelling for (null) pointer constants · 78b8ce40
      Roman Lebedev authored
      This reverts commit 329aeb5d,
      and relands commit 61f006ac.
      
      This is a continuation of D89456.
      
      As it was suggested there, now that SCEV models `PtrToInt`,
      we can try to improve SCEV's pointer handling.
      In particular, i believe, i will need this in the future
      to further fix `SCEVAddExpr`operation type handling.
      
      This removes special handling of `ConstantPointerNull`
      from `ScalarEvolution::createSCEV()`, and add constant folding
      into `ScalarEvolution::getPtrToIntExpr()`.
      This way, `null` constants stay as such in SCEV's,
      but gracefully become zero integers when asked.
      
      Reviewed By: Meinersbur
      
      Differential Revision: https://reviews.llvm.org/D98147
      78b8ce40
    • Roman Lebedev's avatar
      [LSR] Don't try to fixup uses in 'EH pad' instructions · 6e9b9978
      Roman Lebedev authored
      The added test case crashes before this fix:
      ```
      opt: /repositories/llvm-project/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5172: BasicBlock::iterator (anonymous namespace)::LSRInstance::AdjustInsertPositionForExpand(BasicBlock::iterator, const (anonymous namespace)::LSRFixup &, const (anonymous namespace)::LSRUse &, llvm::SCEVExpander &) const: Assertion `!isa<PHINode>(LowestIP) && !LowestIP->isEHPad() && !isa<DbgInfoIntrinsic>(LowestIP) && "Insertion point must be a normal instruction"' failed.
      ```
      This is fully analogous to the previous commit,
      with the pointer constant replaced to be something non-null.
      
      The comparison here can be strength-reduced,
      but the second operand of the comparison happens to be identical
      to the constant pointer in the `catch` case of `landingpad`.
      
      While LSRInstance::CollectLoopInvariantFixupsAndFormulae()
      already gave up on uses in blocks ending up with EH pads,
      it didn't consider this case.
      
      Eventually, `LSRInstance::AdjustInsertPositionForExpand()`
      will be called, but the original insertion point it will get
      is the user instruction itself, and it doesn't want to
      deal with EH pads, and asserts as much.
      
      It would seem that this basically never happens in-the-wild,
      otherwise it would have been reported already,
      so it seems safe to take the cautious approach,
      and just not deal with such users.
      6e9b9978
    • Roman Lebedev's avatar
      [NFC][LSR] Add test case that from https://reviews.llvm.org/D98147#2623549 · 23d591ef
      Roman Lebedev authored
      With that patch, this test fails with an assertion
      ```
      opt: /repositories/llvm-project/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5169: BasicBlock::iterator (anonymous namespace)::LSRInstance::AdjustInsertPositionForExpand(BasicBlock::iterator, const (anonymous namespace)::LSRFixup &, const (anonymous namespace)::LSRUse &, llvm::SCEVExpander &) const: Assertion `!isa<PHINode>(LowestIP) && !LowestIP->isEHPad() && !isa<DbgInfoIntrinsic>(LowestIP) && "Insertion point must be a normal instruction"' failed.
      ```
      23d591ef
    • George Rokos's avatar
      [libomptarget] Add allocator support for target memory · 2468fdd9
      George Rokos authored
      This patch adds the infrastructure for allocator support for target memory.
      Three allocators are introduced for device, host and shared memory.
      The corresponding API functions have the llvm_ prefix temporarily, until they become part of the OpenMP standard.
      
      Differential Revision: https://reviews.llvm.org/D97883
      2468fdd9
    • Nikita Popov's avatar
      [MemCpyOpt] Use AA to check for MustAlias between memset and memcpy · 2902bdee
      Nikita Popov authored
      Rather than checking for simple equality, check for MustAlias, as
      we do in other transforms. This catches equivalent GEPs.
      2902bdee
    • Nikita Popov's avatar
      [MemCpyOpt] Don't generate zero-size memset · 9080444f
      Nikita Popov authored
      If a memset destination is overwritten by a memcpy and the sizes
      are exactly the same, then the memset is simply dead. We can
      directly drop it, instead of replacing it with a memset of zero
      size, which is particularly ugly for the case of a dynamic size.
      9080444f
    • Nikita Popov's avatar