Skip to content
  1. Nov 30, 2021
    • Jeremy Morse's avatar
      [DebugInfo][InstrRef] Terminate overlapping variable fragments · 0eee8445
      Jeremy Morse authored
      If we have a variable where its fragments are split into overlapping
      segments:
      
          DBG_VALUE $ax, $noreg, !123, !DIExpression(DW_OP_LLVM_fragment_0, 16)
          ...
          DBG_VALUE $eax, $noreg, !123, !DIExpression(DW_OP_LLVM_fragment_0, 32)
      
      we should only propagate the most recently assigned fragment out of a
      block. LiveDebugValues only deals with live-in variable locations, as
      overlaps within blocks is DbgEntityHistoryCalculators domain.
      
      InstrRefBasedLDV has kept the accumulateFragmentMap method from
      VarLocBasedLDV, we just need it to recognise DBG_INSTR_REFs. Once it's
      produced a mapping of variable / fragments to the overlapped variable /
      fragments, VLocTracker uses it to identify when a debug instruction needs
      to terminate the other parts it overlaps with. The test is updated for
      some standard "InstrRef picks different registers" variation, and the
      order of some unrelated DBG_VALUEs changes.
      
      Differential Revision: https://reviews.llvm.org/D114603
      0eee8445
    • Fabian Wolff's avatar
      [CVP] Remove ashr of -1 or 0 · 45ecfed6
      Fabian Wolff authored
      Fixes PR#52190. There is already a check for converting ashr instructions with non-negative left-hand sides into lshr; this patch adds an optimization to remove ashr altogether if the left-hand side is known to be in the range [-1, 1).
      
      Differential Revision: https://reviews.llvm.org/D113835
      45ecfed6
    • Philip Reames's avatar
      [SCEVExpander] Drop poison generating flags when reusing instructions · 8906a0fe
      Philip Reames authored
      The basic problem we have is that we're trying to reuse an instruction which is mapped to some SCEV. Since we can have multiple such instructions (potentially with different flags), this is analogous to our need to drop flags when performing CSE. A trivial implementation would simply drop flags on any instruction we decided to reuse, and that would be correct.
      
      This patch is almost that trivial patch except that we preserve flags on the reused instruction when existing users would imply UB on overflow already. Adding new users can, at most, refine this program to one which doesn't execute UB which is valid.
      
      In practice, this fixes two conceptual problems with the previous code: 1) a binop could have been canonicalized into a form with different opcode or operands, or 2) the inbounds GEP case which was simply unhandled.
      
      On the test changes, most are pretty straight forward. We loose some flags (in some cases, they'd have been dropped on the next CSE pass anyways). The one that took me the longest to understand was the ashr-expansion test. What's happening there is that we're considering reuse of the mul, previously we disallowed it entirely, now we allow it with no flags. The surrounding diffs are all effects of generating the same mul with a different operand order, and then doing simple DCE.
      
      The loss of the inbounds is unfortunate, but even there, we can recover most of those once we actually treat branch-on-poison as immediate UB.
      
      Differential Revision: https://reviews.llvm.org/D112734
      8906a0fe
  2. Nov 29, 2021
Loading