[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-02-22 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis updated https://github.com/llvm/llvm-project/pull/78432 >From 869079fa57b3a8da9b9f9ea541f7d542be1bb8bc Mon Sep 17 00:00:00 2001 From: Paschalis Mpeis Date: Tue, 16 Jan 2024 10:53:09 + Subject: [PATCH 1/5] LAA cannot vectorize lib calls like modf/modff Fun

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-02-22 Thread Paschalis Mpeis via cfe-commits
paschalis-mpeis wrote: Rebased to main after a couple of weeks of inactivity. Note: windows x64 build failure seems unrelated; more likely a wide problem, failing at cmake configure. https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mai

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-02-22 Thread Nikita Popov via cfe-commits
@@ -0,0 +1,52 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --filter "call.*(frexp|modf)" --version 4 +// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve -O3 -isystem %S/../Headers/Inputs/include -mllvm -vector-library=ArmP

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-02-22 Thread Paschalis Mpeis via cfe-commits
@@ -0,0 +1,52 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --filter "call.*(frexp|modf)" --version 4 +// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve -O3 -isystem %S/../Headers/Inputs/include -mllvm -vector-library=ArmP

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-02-22 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis converted_to_draft https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-02-23 Thread Maciej Gabka via cfe-commits
@@ -2405,6 +2421,11 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI, // Save 'store' instructions. Abort if other instructions write to memory. if (I.mayWriteToMemory()) { +// We can safety handle math functions that have vectorized +

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-02-27 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis updated https://github.com/llvm/llvm-project/pull/78432 >From a74ba110994e4535cd6c9206aa02d50503fb5577 Mon Sep 17 00:00:00 2001 From: Paschalis Mpeis Date: Tue, 27 Feb 2024 15:00:28 + Subject: [PATCH 1/7] [AArch64][TLI] Add TLI mappings for ArmPL modf, sin

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-11 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis edited https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-11 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis edited https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-11 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis ready_for_review https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-11 Thread Paschalis Mpeis via cfe-commits
paschalis-mpeis wrote: Rebased to main after #80296 was merged: - #80296 https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-02-06 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis updated https://github.com/llvm/llvm-project/pull/78432 >From fbe30cfa2e9474241be71f334228bb811678d0a2 Mon Sep 17 00:00:00 2001 From: Paschalis Mpeis Date: Tue, 16 Jan 2024 10:53:09 + Subject: [PATCH 1/5] LAA cannot vectorize lib calls like modf/modff Fun

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-01-22 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis converted_to_draft https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-01-23 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis updated https://github.com/llvm/llvm-project/pull/78432 >From 9e6020071d90decae5d61eced320a3f114b9d2a1 Mon Sep 17 00:00:00 2001 From: Paschalis Mpeis Date: Tue, 16 Jan 2024 10:53:09 + Subject: [PATCH 1/4] LAA cannot vectorize lib calls like modf/modff Fun

[clang] [llvm] LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-01-17 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis created https://github.com/llvm/llvm-project/pull/78432 Teach LAA to consider safe specific math lib calls which are known to have set the memory write-only attribute. Those attributes are set to calls by `inferNonMandatoryLibFuncAttrs`, in BuildLibCalls.cpp,

[clang] [llvm] LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-01-17 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-llvm-analysis Author: Paschalis Mpeis (paschalis-mpeis) Changes Teach LAA to consider safe specific math lib calls which are known to have set the memory write-only attribute. Those attributes are set to calls by `inferNonMandatoryLibFuncAttrs`, in Bui

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-01-19 Thread Paschalis Mpeis via cfe-commits
@@ -2274,6 +2274,26 @@ bool LoopAccessInfo::canAnalyzeLoop() { return true; } +/// Returns whether \p I is a known math library call that has attribute +/// 'memory(argmem: write)' set. +static bool isMathLibCallMemWriteOnly(const TargetLibraryInfo *TLI, +

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-26 Thread Maciej Gabka via cfe-commits
@@ -0,0 +1,132 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "call.*(frexp|modf)" --version 4 +; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -force-vector-interleave=1 -prefer-pred

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-26 Thread Maciej Gabka via cfe-commits
@@ -2422,6 +2438,15 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI, // Save 'store' instructions. Abort if other instructions write to memory. if (I.mayWriteToMemory()) { +// We can safety handle math functions that have vectorized +

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-26 Thread Maciej Gabka via cfe-commits
@@ -0,0 +1,117 @@ +; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s + +; REQUIRES: asserts + +target triple = "aarch64-unknown-linux-gnu" + +; TODO: add mappings for frexp/f

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-26 Thread Maciej Gabka via cfe-commits
@@ -0,0 +1,117 @@ +; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s mgabka wrote: I think you should only be calling here : "-passes='print' -debug-only=l

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-26 Thread Maciej Gabka via cfe-commits
@@ -2422,6 +2438,15 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI, // Save 'store' instructions. Abort if other instructions write to memory. if (I.mayWriteToMemory()) { +// We can safety handle math functions that have vectorized +

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
@@ -0,0 +1,117 @@ +; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s + +; REQUIRES: asserts + +target triple = "aarch64-unknown-linux-gnu" + +; TODO: add mappings for frexp/f

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis converted_to_draft https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis updated https://github.com/llvm/llvm-project/pull/78432 >From d3ca209a7690d9ecbe188d8a2145177f43ed1951 Mon Sep 17 00:00:00 2001 From: Paschalis Mpeis Date: Tue, 16 Jan 2024 10:53:09 + Subject: [PATCH 1/7] LAA cannot vectorize lib calls like modf/modff Fun

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis ready_for_review https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
@@ -0,0 +1,117 @@ +; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s paschalis-mpeis wrote: Indeed, using `-passes='print'` is a better option here: - it al

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis edited https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis updated https://github.com/llvm/llvm-project/pull/78432 >From d3ca209a7690d9ecbe188d8a2145177f43ed1951 Mon Sep 17 00:00:00 2001 From: Paschalis Mpeis Date: Tue, 16 Jan 2024 10:53:09 + Subject: [PATCH 1/7] LAA cannot vectorize lib calls like modf/modff Fun

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,117 @@ +; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s + +; REQUIRES: asserts + +target triple = "aarch64-unknown-linux-gnu" + +; TODO: add mappings for frexp/f

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis edited https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis edited https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
@@ -0,0 +1,117 @@ +; RUN: opt < %s -mattr=+sve -vector-library=ArmPL -passes=inject-tli-mappings,loop-vectorize -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s + +; REQUIRES: asserts + +target triple = "aarch64-unknown-linux-gnu" + +; TODO: add mappings for frexp/f

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-04-30 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis edited https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-02 Thread Maciej Gabka via cfe-commits
@@ -0,0 +1,134 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "call.*(frexp|modf)" --version 4 mgabka wrote: sincos (which also takes linear pointers) has tests inside veclib-function-calls.ll, so I would sugges

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Maciej Gabka via cfe-commits
https://github.com/mgabka approved this pull request. https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
https://github.com/fhahn requested changes to this pull request. https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
https://github.com/fhahn edited https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
@@ -2477,6 +2493,15 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI, // Save 'store' instructions. Abort if other instructions write to memory. fhahn wrote: comment out of date https://github.com/llvm/llvm-project/pull/78432 _

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
@@ -2477,6 +2493,15 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI, // Save 'store' instructions. Abort if other instructions write to memory. if (I.mayWriteToMemory()) { +// We can safety handle math functions that have vectorized --

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,116 @@ +; RUN: opt < %s -passes='print' -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s + +; REQUIRES: asserts + + +define void @frexp_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) { +; CHECK: LAA: Allow to vectorize math function with write-only attribute:

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
@@ -2477,6 +2493,15 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI, // Save 'store' instructions. Abort if other instructions write to memory. if (I.mayWriteToMemory()) { +// We can safety handle math functions that have vectorized +

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,116 @@ +; RUN: opt < %s -passes='print' -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s + +; REQUIRES: asserts + + +define void @frexp_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) { +; CHECK: LAA: Allow to vectorize math function with write-only attribute:

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,116 @@ +; RUN: opt < %s -passes='print' -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s + +; REQUIRES: asserts + + +define void @frexp_f64(ptr %in, ptr %out1, ptr %out2, i32 %N) { +; CHECK: LAA: Allow to vectorize math function with write-only attribute:

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-14 Thread Florian Hahn via cfe-commits
@@ -0,0 +1,116 @@ +; RUN: opt < %s -passes='print' -debug-only=loop-accesses -disable-output 2>&1 | FileCheck %s fhahn wrote: Please also check the `access-info` report. https://github.com/llvm/llvm-project/pull/78432 ___

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-15 Thread Maciej Gabka via cfe-commits
@@ -2477,6 +2493,15 @@ void LoopAccessInfo::analyzeLoop(AAResults *AA, LoopInfo *LI, // Save 'store' instructions. Abort if other instructions write to memory. if (I.mayWriteToMemory()) { +// We can safety handle math functions that have vectorized +

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-05-09 Thread Paschalis Mpeis via cfe-commits
paschalis-mpeis wrote: ### Rebased to: 1. Update to latest main 2. Amend commits for doing tests in veclib-function-calls.ll. For (2), the commit history were modified as follows: - The initial commit (that showcases what was missing) was amended to add the tests in veclib-function-calls.ll. -

[clang] [llvm] [LV][LAA] Vectorize math lib calls with mem write-only attribute (PR #78432)

2024-06-25 Thread Paschalis Mpeis via cfe-commits
https://github.com/paschalis-mpeis converted_to_draft https://github.com/llvm/llvm-project/pull/78432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits