1. Jun 11, 2023
  2. Jun 10, 2023
    • Matt Arsenault's avatar
    • Matt Arsenault's avatar
    • Tom Eccles's avatar
      [flang][hlfir] allow recursive intrinsic lowering · 7c8ef818
      Tom Eccles authored
      We need to allow recursive application of intrinsic lowering patterns,
      otherwise we cannot lower nested calls of the same intrinsic e.g.
      matmul(matmul(a, b), c).
      
      matmul(matmul(a, b), matmul(c, d)) requires hlfir.associate of hlfir
      expr with more than one use (TODO).
      
      Differential Revision: https://reviews.llvm.org/D152284
      7c8ef818
    • Vikram's avatar
      [AMDGPU] Non hostcall printf support for HIP · 631c9654
      Vikram authored
      This is an alternative to currently existing hostcall implementation and uses printf buffer similar to OpenCL,
      The data stored in the buffer (i.e the data frame) for each printf call are as follows,
      1. Control DWord - contains info regarding stream, format string constness and size of data frame
      2. Hash of the format string (if constant) else the format string itself
      3. Printf arguments (each aligned to 8 byte boundary)
      
      The format string Hash is generated using LLVM's MD5 Message-Digest Algorithm implementation and only low 64 bits are used.
      The implementation still uses amdhsa metadata and hash is stored as part of format string itself to ensure
      minimal changes in runtime.
      
      Differential Revision: https://reviews.llvm.org/D150427
      631c9654
    • Paulo Matos's avatar
      [clang][WebAssembly] Implement support for table types and builtins · 55aeb23f
      Paulo Matos authored
      This commit implements support for WebAssembly table types and
      respective builtins. Table tables are WebAssembly objects to store
      reference types. They have a large amount of semantic restrictions
      including, but not limited to, only being allowed to be declared
      at the top-level as static arrays of zero-length. Not being arguments
      or result of functions, not being stored ot memory, etc.
      
      This commit introduces the __attribute__((wasm_table)) to attach to
      arrays of WebAssembly reference types. And the following builtins to
      manage tables:
      
      * ref   __builtin_wasm_table_get(table, idx)
      * void  __builtin_wasm_table_set(table, idx, ref)
      * uint  __builtin_wasm_table_size(table)
      * uint  __builtin_wasm_table_grow(table, ref, uint)
      * void  __builtin_wasm_table_fill(table, idx, ref, uint)
      * void  __builtin_wasm_table_copy(table, table, uint, uint, uint)
      
      This commit also enables reference-types feature at bleeding-edge.
      
      This is joint work with Alex Bradbury (@asb).
      
      Reviewed By: aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D139010
      55aeb23f
    • Matt Arsenault's avatar
      AMDGPU: Move LICM after AMDGPUCodeGenPrepare · 5b657f50
      Matt Arsenault authored
      The commit that added the run says it's to hoist uniform parts of
      integer division expansion. That expansion is performed later, so this
      didn't do anything in that case. Move this later so the original test
      shows the improvement.
      
      This also saves a run of "Canonicalize natural loops". Not sure why
      this appears to be still getting a separate loop PM run. Also feels a
      bit heavy to run this just for divide. Is there a way to specifically
      hoist the divide sequence when it expands?
      5b657f50
    • Piotr Zegar's avatar
      [clang-tidy] Optimize misc-confusable-identifiers · 8fdedcd1
      Piotr Zegar authored
      This is final optimization for this check. Main
      improvements comes from changing a logic order
      in mayShadow function, to first validate result
      of mayShadowImpl, then search primary context in
      a vectors. Secondary improvement comes from excluding
      all implicit code by using TK_IgnoreUnlessSpelledInSource.
      All other changes are just cosmetic improvements.
      
      Tested on Cataclysm-DDA open source project, result in
      check execution time reduction from 3682 seconds to
      100 seconds (~0.25s per TU). That's 97.2% reduction for
      this change alone. Resulting in cumulative improvement for
      this check around -99.6%, finally bringing this check
      into a cheap category.
      
      Reviewed By: serge-sans-paille
      
      Differential Revision: https://reviews.llvm.org/D151594
      8fdedcd1