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

2023-12-22 Thread Nikita Popov via cfe-commits
https://github.com/nikic approved this pull request. LGTM I think this is a reasonable change in any case. https://github.com/llvm/llvm-project/pull/75448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

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

2023-12-14 Thread Nikita Popov via cfe-commits
https://github.com/nikic commented: Looks fine to me. Alternative would be to forbid GEP indexing into vectors entirely. https://github.com/llvm/llvm-project/pull/75448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

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

2023-12-14 Thread Nikita Popov 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:

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

2023-12-14 Thread Jannik Silvanus via cfe-commits
jasilvanus wrote: > There seem to be some clang test failures though that I'm currently looking > into. Solved: The clang failures were caused by me having `dxv` in `$PATH`, which implicitly enabled some extra `dxv`-based tests which also fail without this patch for me. Clang was invoking `

[clang] [llvm] [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/3] [InstCombine] Precommit test exhibiting miscompile Inst

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

2023-12-14 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 3e8b175eec6fef1a073fb7d0d867fbc6a7837f57 4649d44cece1db0d38e00425491137c44c3aab8e --

[clang] [llvm] [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/3] [InstCombine] Precommit test exhibiting miscompile Inst

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

2023-12-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-arm Author: Jannik Silvanus (jasilvanus) Changes Vectors are always bit-packed and don't respect the elements' alignment requirements. This is different from arrays. This means offsets of vector GEPs need to be computed differently than offsets o

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

2023-12-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Jannik Silvanus (jasilvanus) Changes Vectors are always bit-packed and don't respect the elements' alignment requirements. This is different from arrays. This means offsets of vector GEPs need to be computed differently than offsets of arra

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

2023-12-14 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-globalisel @llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-backend-aarch64 Author: Jannik Silvanus (jasilvanus) Changes Vectors are always bit-packed and don't respect the elements' alignment requirements. This is different from arrays. This means

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

2023-12-14 Thread Jannik Silvanus via cfe-commits
https://github.com/jasilvanus created https://github.com/llvm/llvm-project/pull/75448 Vectors are always bit-packed and don't respect the elements' alignment requirements. This is different from arrays. This means offsets of vector GEPs need to be computed differently than offsets of array GEPs.