[all-commits] [llvm/llvm-project] 5ac624: [DirectX] Flatten arrays (#114332)

Farzon Lotfi via All-commits all-commits at lists.llvm.org
Wed Nov 13 13:36:46 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ac624c8234fe0a62cbf0447dbf7035ea29d062e
      https://github.com/llvm/llvm-project/commit/5ac624c8234fe0a62cbf0447dbf7035ea29d062e
  Author: Farzon Lotfi <1802579+farzonl at users.noreply.github.com>
  Date:   2024-11-13 (Wed, 13 Nov 2024)

  Changed paths:
    M llvm/lib/Target/DirectX/CMakeLists.txt
    A llvm/lib/Target/DirectX/DXILFlattenArrays.cpp
    A llvm/lib/Target/DirectX/DXILFlattenArrays.h
    M llvm/lib/Target/DirectX/DirectX.h
    M llvm/lib/Target/DirectX/DirectXPassRegistry.def
    M llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
    A llvm/test/CodeGen/DirectX/flatten-array.ll
    M llvm/test/CodeGen/DirectX/llc-pipeline.ll
    A llvm/test/CodeGen/DirectX/llc-vector-load-scalarize.ll
    A llvm/test/CodeGen/DirectX/llc-vector-store-scalarize.ll
    M llvm/test/CodeGen/DirectX/scalar-data.ll
    M llvm/test/CodeGen/DirectX/scalar-load.ll
    M llvm/test/CodeGen/DirectX/scalar-store.ll

  Log Message:
  -----------
  [DirectX] Flatten arrays (#114332)

-  Relevant piece is `DXILFlattenArrays.cpp`
- Loads and Store Instruction visits are just for finding
GetElementPtrConstantExpr and splitting them.
-  Allocas needed to be replaced with flattened allocas.
- Global arrays were similar to allocas. Only interesting piece here is
around initializers.
- Most of the work went into building correct GEP chains. The approach
here was a recursive strategy via `recursivelyCollectGEPs`.
- All intermediary GEPs get marked for deletion and only the leaf GEPs
get updated with the new index.

fixes [89646](https://github.com/llvm/llvm-project/issues/89646)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list