[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2024-01-10 Thread Jannik Silvanus via cfe-commits
jasilvanus wrote: Interesting, here it is online: https://alive2.llvm.org/ce/z/Bm5gP2 The complaint goes away if `half` is naturally aligned (`f16:16`). Looks like an Alive2 bug with respect to vector bit layout? https://github.com/llvm/llvm-project/pull/75448 ___

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2024-01-10 Thread Nuno Lopes via cfe-commits
nunoplopes wrote: Alive2 is complaining about one of the tests: ```llvm @Global = global 10 bytes, align 1 define void @test_overaligned_vec(i8 %B) { %A = gep ptr @Global, 4 x i64 0, 4 x i64 1 store i8 %B, ptr %A, align 1 ret void } => @Global = global 10 bytes, align 1 define void @test_

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2024-01-04 Thread Jannik Silvanus via cfe-commits
https://github.com/jasilvanus closed https://github.com/llvm/llvm-project/pull/75448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-22 Thread Nikita Popov via cfe-commits
nikic wrote: > > Alternative would be to forbid GEP indexing into vectors entirely. > > I agree that it would be better if there just were no vector GEPs, but that > breaks importing older modules, and that cannot be easily auto-upgraded > (convert to byte-GEPs?). Yes, upgrade would be to byt

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-19 Thread Jannik Silvanus via cfe-commits
jasilvanus wrote: I'm now on vacation for two weeks, returning Jan 4th. I'll merge the PR then (if it is approved by then). https://github.com/llvm/llvm-project/pull/75448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Jannik Silvanus via cfe-commits
jasilvanus wrote: > Alternative would be to forbid GEP indexing into vectors entirely. I agree that it would be better if there just were no vector GEPs, but that breaks importing older modules, and that cannot be easily auto-upgraded (convert to byte-GEPs?). Even worse, DXIL uses different ve

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Jannik Silvanus via cfe-commits
@@ -111,6 +111,20 @@ define void @test_evaluate_gep_as_ptrs_array(ptr addrspace(2) %B) { ret void } +define void @test_overaligned_vec(i8 %B) { +; This should be turned into a constexpr instead of being an instruction +; CHECK-LABEL: @test_overaligned_vec( +; TODO:

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Jannik Silvanus via cfe-commits
https://github.com/jasilvanus updated https://github.com/llvm/llvm-project/pull/75448 >From 2c367fba42b716d803ee088af45c1b57fe4bcbcd Mon Sep 17 00:00:00 2001 From: Jannik Silvanus Date: Thu, 14 Dec 2023 09:24:51 +0100 Subject: [PATCH 1/5] [InstCombine] Precommit test exhibiting miscompile Inst

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Jannik Silvanus via cfe-commits
@@ -108,7 +143,23 @@ class generic_gep_type_iterator { // that. bool isStruct() const { return isa(CurTy); } - bool isSequential() const { return isa(CurTy); } + bool isVector() const { return isa(CurTy); } + bool isSequential() const { return !isStruct(); } + + // For

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Jannik Silvanus via cfe-commits
https://github.com/jasilvanus updated https://github.com/llvm/llvm-project/pull/75448 >From 2c367fba42b716d803ee088af45c1b57fe4bcbcd Mon Sep 17 00:00:00 2001 From: Jannik Silvanus Date: Thu, 14 Dec 2023 09:24:51 +0100 Subject: [PATCH 1/4] [InstCombine] Precommit test exhibiting miscompile Inst

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Nikita Popov via cfe-commits
@@ -108,7 +143,23 @@ class generic_gep_type_iterator { // that. bool isStruct() const { return isa(CurTy); } - bool isSequential() const { return isa(CurTy); } + bool isVector() const { return isa(CurTy); } + bool isSequential() const { return !isStruct(); } + + // For

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/75448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Jannik Silvanus via cfe-commits
jasilvanus wrote: > Can this solve #68566 too? I don't think it solves it, as it only fixes offset computations within GEPs and doesn't teach code in general about the correct vector layout. However, it is reducing the amount of code assuming the wrong layout. There seem to be some clang test

[llvm] [clang] [IR] Fix GEP offset computations for vector GEPs (PR #75448)

2023-12-14 Thread Phoebe Wang via cfe-commits
phoebewang wrote: Can this solve https://github.com/llvm/llvm-project/issues/68566 too? https://github.com/llvm/llvm-project/pull/75448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits