[llvm] [DirectX] add GEP i8 legalization (PR #142475)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 3 17:03:49 PDT 2025
================
@@ -110,8 +110,8 @@ define i32 @all_imm() {
define i32 @scalar_i8_geps() {
; CHECK-LABEL: define i32 @scalar_i8_geps(
; CHECK-NEXT: [[ALLOCA:%.*]] = alloca i32, align 4
- ; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds nuw i32, ptr [[ALLOCA]], i32 0
- ; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr [[GEP]], align 4
+ ; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds nuw [1 x i32], ptr [[ALLOCA]], i32 0, i32 0
----------------
farzonl wrote:
I can make the scalars be scalar It just requires more code that is more than just checking type. you have to create an array of indicies or use a scalar int for index and they can't share the same variable name so you are either creating two cases of gep builders or you are creating both index types so you can use a terinary to feed it into the gep builder. If the validator can accept this then it would make the code cleaner if not we can always do the alternative.
https://github.com/llvm/llvm-project/pull/142475
More information about the llvm-commits
mailing list