[llvm] [DirectX] Scalarize `extractelement` and `insertelement` with dynamic indices (PR #141676)
Finn Plummer via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 6 15:54:37 PDT 2025
================
@@ -1,25 +1,76 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes='dxil-data-scalarization' -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+; Allocas should be placed in the entry block.
+; Allocas should also be reused across multiple insertelement and extractelement instructions for the same vector
+define void @alloca_placement_and_reuse(<3 x i32> %v1, <3 x i32> %v2, i32 %a, i32 %i, i32 %j) {
----------------
inbelic wrote:
nit: it might be easier to read if this was split out into two tests to test the independent things here
https://github.com/llvm/llvm-project/pull/141676
More information about the llvm-commits
mailing list