1. Aug 25, 2022
    • Tyker's avatar
      [NFC][mlir] Add support for llvm style casting for mlir types · bb63d249
      Tyker authored
      Note:
      when operating on a Type hierarchy with LeafType inheriting from MiddleType which inherits from mlir::Type.
      calling LeafType::classof(MiddleType) will always return false.
      because classof call the static getTypeID from its parent instead of the dynamic Type::getTypeID
      so classof in this context will check if the TypeID of LeafType is the same as the TypeID of MiddleType which is always false.
      It is bypassed in this commit inside CastInfo<To, From>::isPossible by calling classof with an mlir::Type.
      but other unsuspecting users of LeafType::classof(MiddleType) would still get an incorrect result.
      bb63d249
    • Prabhdeep Singh Soni's avatar
      [MLIR][OpenMP] Add support for safelen clause · b8055c51
      Prabhdeep Singh Soni authored
      This supports translation from MLIR to LLVM IR using OMPIRBuilder for
      OpenMP safelen clause in SIMD construct.
      
      Reviewed By: ftynse
      
      Differential Revision: https://reviews.llvm.org/D132245
      b8055c51
    • Prabhdeep Singh Soni's avatar
      Revert "[MLIR][OpenMP] Add support for safelen clause" · 4fce38cd
      Prabhdeep Singh Soni authored
      This reverts commit 172fe170.
      4fce38cd
    • Simon Pilgrim's avatar
      [X86] Promote i8/i16 CTTZ (BSF) instructions and remove speculation branch · f9de1323
      Simon Pilgrim authored
      This patch adds a Type operand to the TLI isCheapToSpeculateCttz/isCheapToSpeculateCtlz callbacks, allowing targets to decide whether branches should occur on a type-by-type/legality basis.
      
      For X86, this patch proposes to allow CTTZ speculation for i8/i16 types that will lower to promoted i32 BSF instructions by masking the operand above the msb (we already do something similar for i8/i16 TZCNT). This required a minor tweak to CTTZ lowering - if the src operand is known never zero (i.e. due to the promotion masking) we can remove the CMOV zero src handling.
      
      Although BSF isn't very fast, most CPUs from the last 20 years don't do that bad a job with it, although there are some annoying passthrough EFLAGS dependencies. Additionally, now that we emit 'REP BSF' in most cases, we are tending towards assuming this will most likely be executed as a TZCNT instruction on any semi-modern CPU.
      
      Differential Revision: https://reviews.llvm.org/D132520
      f9de1323
    • Prabhdeep Singh Soni's avatar
      [MLIR][OpenMP] Add support for safelen clause · 172fe170
      Prabhdeep Singh Soni authored
      This supports translation from MLIR to LLVM IR using OMPIRBuilder for
      OpenMP safelen clause in SIMD construct.
      172fe170
    • Prabhdeep Singh Soni's avatar
      Revert "Add support for safelen clause" · cfef6561
      Prabhdeep Singh Soni authored
      This reverts commit 3dd4d6a0.
      cfef6561
    • Sanjay Patel's avatar
      [InstCombine] ease use constraint in tryFactorization() · 0cfc6510
      Sanjay Patel authored
      The stronger one-use checks prevented transforms like this:
      (x * y) + x --> x * (y + 1)
      (x * y) - x --> x * (y - 1)
      
      https://alive2.llvm.org/ce/z/eMhvQa
      
      This is one of the IR transforms suggested in issue #57255.
      
      This should be better in IR because it removes a use of a
      variable operand (we already fold the case with a constant
      multiply operand).
      The backend should be able to re-distribute the multiply if
      that's better for the target.
      
      Differential Revision: https://reviews.llvm.org/D132412
      0cfc6510
    • Prabhdeep Singh Soni's avatar
      Add support for safelen clause · 3dd4d6a0
      Prabhdeep Singh Soni authored
      This supports translation from MLIR to LLVM IR using OMPIRBuilder for
      OpenMP safelen clause in SIMD construct.
      3dd4d6a0
  2. Aug 24, 2022