[clang] [llvm] Reapply "[AArch64][SVE] Improve fixed-length addressing modes. (#130263)" (PR #130625)

2025-03-12 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Thank you very much for the explanation, @paulwalker-arm - that makes a lot of sense! I'll try your suggestion tomorrow. I'll let you know how it goes. :) https://github.com/llvm/llvm-project/pull/130625 ___ cfe-commits mailing list c

[clang] [llvm] Reapply "[AArch64][SVE] Improve fixed-length addressing modes. (#130263)" (PR #130625)

2025-03-11 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus created https://github.com/llvm/llvm-project/pull/130625 This restores commit f01e760c08365426de95f02dc2c2dc670eb47352. The original patch from #129732 exposed what seems to be a bug in `SelectAddrModeIndexedSVE`. Currently, the offset returned by `SelectAddrModeIn

[clang] [llvm] Reapply "[AArch64][SVE] Improve fixed-length addressing modes. (#130263)" (PR #130625)

2025-03-11 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus edited https://github.com/llvm/llvm-project/pull/130625 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-08 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus closed https://github.com/llvm/llvm-project/pull/129732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Revert "[AArch64][SVE] Improve fixed-length addressing modes." (PR #130263)

2025-03-07 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus created https://github.com/llvm/llvm-project/pull/130263 Reverts llvm/llvm-project#129732. I'll look into what's causing the buildbot reported in https://github.com/llvm/llvm-project/pull/129732#issuecomment-2705062636 to fail offline. >From 5a71fab0067bae0f532a62

[clang] [llvm] Revert "[AArch64][SVE] Improve fixed-length addressing modes." (PR #130263)

2025-03-07 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: I'll commit this to get the bot back to green while I look into it offline. https://github.com/llvm/llvm-project/pull/130263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [llvm] Revert "[AArch64][SVE] Improve fixed-length addressing modes." (PR #130263)

2025-03-07 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus closed https://github.com/llvm/llvm-project/pull/130263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus edited https://github.com/llvm/llvm-project/pull/129732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus edited https://github.com/llvm/llvm-project/pull/129732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
@@ -405,6 +405,17 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo { return MinSVEVectorSizeInBits; } + // Return the known bit length of SVE data registers. A value of 0 means the + // length is unkown beyond what's implied by the architecture. + uns

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
@@ -7380,12 +7380,26 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexedSVE(SDNode *Root, SDValue N, return false; SDValue VScale = N.getOperand(1); - if (VScale.getOpcode() != ISD::VSCALE) + int64_t MulImm = std::numeric_limits::max(); + if (VScale.getOpcode() == ISD

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus updated https://github.com/llvm/llvm-project/pull/129732 >From 624d1e924aa130eea2a8ddaefaeb587aab642f2f Mon Sep 17 00:00:00 2001 From: Ricardo Jesus Date: Tue, 4 Mar 2025 02:36:06 -0800 Subject: [PATCH 1/8] Precommit tests --- .../AArch64/sve-fixed-length-offsets.l

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
@@ -405,6 +405,17 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo { return MinSVEVectorSizeInBits; } + // Return the known bit length of SVE data registers. A value of 0 means the + // length is unkown beyond what's implied by the architecture. + uns

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
@@ -7380,17 +7380,31 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexedSVE(SDNode *Root, SDValue N, return false; SDValue VScale = N.getOperand(1); - if (VScale.getOpcode() != ISD::VSCALE) + std::optional MulImm; + if (VScale.getOpcode() == ISD::VSCALE) { +MulImm

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus updated https://github.com/llvm/llvm-project/pull/129732 >From 624d1e924aa130eea2a8ddaefaeb587aab642f2f Mon Sep 17 00:00:00 2001 From: Ricardo Jesus Date: Tue, 4 Mar 2025 02:36:06 -0800 Subject: [PATCH 1/7] Precommit tests --- .../AArch64/sve-fixed-length-offsets.l

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
@@ -7380,17 +7380,31 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexedSVE(SDNode *Root, SDValue N, return false; SDValue VScale = N.getOperand(1); - if (VScale.getOpcode() != ISD::VSCALE) + std::optional MulImm; + if (VScale.getOpcode() == ISD::VSCALE) { +MulImm

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
@@ -0,0 +1,362 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -aarch64-sve-vector-bits-min=128 -aarc

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus edited https://github.com/llvm/llvm-project/pull/129732 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
@@ -0,0 +1,362 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s +; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -aarch64-sve-vector-bits-min=128 -aarc

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
@@ -7380,12 +7380,27 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexedSVE(SDNode *Root, SDValue N, return false; SDValue VScale = N.getOperand(1); - if (VScale.getOpcode() != ISD::VSCALE) + int64_t MulImm = std::numeric_limits::max(); + if (VScale.getOpcode() == ISD

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus updated https://github.com/llvm/llvm-project/pull/129732 >From 624d1e924aa130eea2a8ddaefaeb587aab642f2f Mon Sep 17 00:00:00 2001 From: Ricardo Jesus Date: Tue, 4 Mar 2025 02:36:06 -0800 Subject: [PATCH 1/5] Precommit tests --- .../AArch64/sve-fixed-length-offsets.l

[clang] [llvm] [AArch64][SVE] Improve fixed-length addressing modes. (PR #129732)

2025-03-05 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus updated https://github.com/llvm/llvm-project/pull/129732 >From 624d1e924aa130eea2a8ddaefaeb587aab642f2f Mon Sep 17 00:00:00 2001 From: Ricardo Jesus Date: Tue, 4 Mar 2025 02:36:06 -0800 Subject: [PATCH 1/4] Precommit tests --- .../AArch64/sve-fixed-length-offsets.l

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-26 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus closed https://github.com/llvm/llvm-project/pull/127837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-26 Thread Ricardo Jesus via cfe-commits
@@ -2993,6 +2993,22 @@ let Predicates = [HasSVE_or_SME] in { defm : unpred_loadstore_bitcast; defm : unpred_loadstore_bitcast; + // Allow using LDR/STR to avoid the predicate dependence. + let Predicates = [IsLE, AllowMisalignedMemAccesses] in rj-jesus w

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-26 Thread Ricardo Jesus via cfe-commits
@@ -2993,6 +2993,22 @@ let Predicates = [HasSVE_or_SME] in { defm : unpred_loadstore_bitcast; defm : unpred_loadstore_bitcast; + // Allow using LDR/STR to avoid the predicate dependence. + let Predicates = [IsLE, AllowMisalignedMemAccesses] in +foreach Ty = [ nxv16i8

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-26 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus edited https://github.com/llvm/llvm-project/pull/127837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-26 Thread Ricardo Jesus via cfe-commits
https://github.com/rj-jesus edited https://github.com/llvm/llvm-project/pull/127837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-26 Thread Ricardo Jesus via cfe-commits
@@ -2993,6 +2993,22 @@ let Predicates = [HasSVE_or_SME] in { defm : unpred_loadstore_bitcast; defm : unpred_loadstore_bitcast; + // Allow using LDR/STR to avoid the predicate dependence. + let Predicates = [IsLE, AllowMisalignedMemAccesses] in +foreach Ty = [ nxv16i8

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-21 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Thanks for the pointer, @davemgreen. You're right, with `+strict-align` this has to be 16B aligned. This is also only valid for LE, but this should already be enforced. https://github.com/llvm/llvm-project/pull/127837 ___ cfe-commits m

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-21 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Thank you very much for checking! If you have any other comments please let me know. https://github.com/llvm/llvm-project/pull/127837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [llvm] [AArch64][SVE] Lower unpredicated loads/stores as LDR/STR. (PR #127837)

2025-02-20 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Hi @paulwalker-arm, I think the alignment requirements of LD1 and LDR are indeed different, but this only matters if `AlignmentEnforced()` is enabled, right? I thought `AlignmentEnforced` wasn't generally a concern, otherwise even the current lowering we have for `vld1q_u8(uint

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-13 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Sounds good, thanks! :) https://github.com/llvm/llvm-project/pull/126945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Should this be given a more general name, now that it also includes Neon types? There are also a few comments right at the start that could be extended for Neon. https://github.com/llvm/llvm-project/pull/126945

[clang] [ARM][AArch64] Add missing Neon Types (PR #126945)

2025-02-12 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: I believe this fixes #113297, right? https://github.com/llvm/llvm-project/pull/126945 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-08 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: > The solution is to add `-fno-fortran-main` to the linker options via > `CMAKE_SHARED_LINKER_FLAGS`. This will need PR #74139 land first. But this > option will be a good way to control if the flang compiler should attempt > linking in the `main` stub from its library. > > It

[flang] [clang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-07 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: > > Chipping into the discussion, since this patch I can also no longer build > > OpenBLAS or PETSc. OpenBLAS for example fails with > > ``` > > $ clang -v -O3 -mcpu=native -DHAVE_C11 -Wall -DF_INTERFACE_GFORT -fPIC > > -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=72 -DMAX_PARALLE

[clang] [flang] [flang][Driver] Let the linker fail on multiple definitions of main() (PR #73124)

2023-12-06 Thread Ricardo Jesus via cfe-commits
rj-jesus wrote: Chipping into the discussion, since this patch I can also no longer build OpenBLAS or PETSc. OpenBLAS for example fails with ``` $ clang -v -O3 -mcpu=native -DHAVE_C11 -Wall -DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=72 -DMAX_PARALLEL_NUMBER=1 -DMAX_ST