1. Sep 14, 2022
  2. Sep 13, 2022
    • Alex Bradbury's avatar
      [RISCV] Return true in hasBitTest when Zbs is enabled and update BEXTI pattern... · 54716084
      Alex Bradbury authored
      [RISCV] Return true in hasBitTest when Zbs is enabled and update BEXTI pattern for resulting canonicalisation
      
      As the Zbs extension includes bext[i] for bit extract, we can
      unconditionally return true from this hook. This hook causes the DAG
      combiner to perform the following canonicalisation:
      
        and (not (srl X, C)), 1 --> (and X, 1<<C) == 0
        and (srl (not X), C)), 1 --> (and X, 1<<C) == 0
      
      As simply changing the hook causes a codegen regression, this patch also
      modifies a BEXTI pattern to match this canonicalised form.
      
      As BSETINVMask is now used for BEXT as well as BSET and BINV, it has
      been renamed to the more generic SingleBitSetMask.
      
      There is one codegen change in bittest.ll for bittest_31_i64 (NOT+BEXTI
      rather than NOT+SRLIW). This is neutral in terms of code quality.
      
      Differential Revision: https://reviews.llvm.org/D131482
      54716084
    • Craig Topper's avatar
      [RISCV] Fix a bug in i32 FP_TO_UINT_SAT lowering on RV64. · 5224bae6
      Craig Topper authored
      We use the saturating behavior of fcvt.wu.h/s/d but forgot to
      take into account that fcvt.wu will sign extend the saturated
      result. According to computeKnownBits a promoted FP_TO_UINT_SAT
      is expected to zero extend the saturated value.
      
      In many case the upper bits aren't be demanded so this wouldn't
      be an issue. But if we computeKnownBits caused an AND to be removed
      it would be a bug.
      
      This patch inserts an AND during to zero the upper bits.
      
      Unfortunately, this pessimizes code if we aren't able to tell if
      the upper bits are demanded. To fix that we could custom type
      promote the FP_TO_UINT_SAT with SEXT_INREG after it, but I'll
      leave that for future work.
      
      I haven't found a failure from this, I was revisiting the code to
      add vector support and spotted it.
      
      Differential Revision: https://reviews.llvm.org/D133746
      5224bae6
    • Nicolas Vasilache's avatar
      [mlir][Vector] Support broadcast vector type in distribution of vector.warp_execute_on_lane_0. · 845dc178
      Nicolas Vasilache authored
      This revision significantly improves and tests the broadcast behavior of vector.warp_execute_on_lane_0.
      
      Previously, the implementation of the broadcast behavior of vector.warp_execute_on_lane_0
      assumed that the broadcasted value was always of scalar type.
      
      This is not necessarily the case.
      
      Differential Revision: https://reviews.llvm.org/D133767
      845dc178