[llvm-branch-commits] [llvm] [llvm-exegesis] Minor changes for downstream consumers (PR #74211)

2023-12-07 Thread Aiden Grossman via llvm-branch-commits

boomanaiden154 wrote:

Bump on this when reviewers have a chance. Thanks!

https://github.com/llvm/llvm-project/pull/74211
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [llvm-exegesis] Minor changes for downstream consumers (PR #74211)

2023-12-07 Thread Aiden Grossman via llvm-branch-commits

boomanaiden154 wrote:

Closed in favor of #74711. Will add the getter as part of #74210.

https://github.com/llvm/llvm-project/pull/74211
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [llvm-exegesis] Minor changes for downstream consumers (PR #74211)

2023-12-07 Thread Aiden Grossman via llvm-branch-commits

https://github.com/boomanaiden154 closed 
https://github.com/llvm/llvm-project/pull/74211
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [VPlan] Initial modeling of runtime VF * UF as VPValue. (PR #74761)

2023-12-07 Thread Florian Hahn via llvm-branch-commits

https://github.com/fhahn created https://github.com/llvm/llvm-project/pull/74761

This patch starts initial modeling of runtime VF * UF in VPlan.
Initially, introduce a dedicated RuntimeVFxUF VPValue, which is then
populated during VPlan::prepareToExecute. Initially, the runtime
VF * UF applies only to the main vector loop region. Once we extend the
scope of VPlan in the future, we may want to associate different VFxUFs
with different vector loop regions (e.g. the epilogue vector loop)

This allows explicitly parameterizing recipes that rely on the runtime
VF * UF, like the canonical induction increment. At the moment, this
mainly helps to avoid generating some duplicated calls to vscale with
scalable vectors. It should also allow using EVL as induction increments
explicitly in D99750. Referring to VF * UF is also needed in other
places that we plan to migrate to VPlan, like the minimum trip count
check during skeleton creation.

The first version creates the value for VF * UF directly in
prepareToExecute to limit the scope of the patch. A follow-on patch will
model VF * UF computation explicitly in VPlan using recipes.

Moved from Phabricator (https://reviews.llvm.org/D157322)



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [VPlan] Initial modeling of runtime VF * UF as VPValue. (PR #74761)

2023-12-07 Thread via llvm-branch-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-risc-v

Author: Florian Hahn (fhahn)


Changes

This patch starts initial modeling of runtime VF * UF in VPlan.
Initially, introduce a dedicated RuntimeVFxUF VPValue, which is then
populated during VPlan::prepareToExecute. Initially, the runtime
VF * UF applies only to the main vector loop region. Once we extend the
scope of VPlan in the future, we may want to associate different VFxUFs
with different vector loop regions (e.g. the epilogue vector loop)

This allows explicitly parameterizing recipes that rely on the runtime
VF * UF, like the canonical induction increment. At the moment, this
mainly helps to avoid generating some duplicated calls to vscale with
scalable vectors. It should also allow using EVL as induction increments
explicitly in D99750. Referring to VF * UF is also needed in other
places that we plan to migrate to VPlan, like the minimum trip count
check during skeleton creation.

The first version creates the value for VF * UF directly in
prepareToExecute to limit the scope of the patch. A follow-on patch will
model VF * UF computation explicitly in VPlan using recipes.

Moved from Phabricator (https://reviews.llvm.org/D157322)


---

Patch is 308.19 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/74761.diff


53 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+3-3) 
- (modified) llvm/lib/Transforms/Vectorize/VPlan.cpp (+21-1) 
- (modified) llvm/lib/Transforms/Vectorize/VPlan.h (+30-4) 
- (modified) llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp (+8-23) 
- (modified) llvm/lib/Transforms/Vectorize/VPlanValue.h (+6) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/masked-call.ll (+11-11) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/outer_loop_prefer_scalable.ll (+2-2) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/scalable-avoid-scalarization.ll 
(+2-2) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/scalable-strict-fadd.ll 
(+16-16) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/sve-cond-inv-loads.ll 
(+4-4) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/sve-gather-scatter.ll 
(+6-6) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/sve-inductions-unusual-types.ll 
(+4-6) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/sve-inductions.ll 
(+2-2) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/sve-interleaved-accesses.ll (+26-26) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/sve-interleaved-masked-accesses.ll 
(+12-12) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/sve-inv-store.ll (+2-2) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-forced.ll (+4-3) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-optsize.ll (+1-1) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-overflow-checks.ll 
(+3-3) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-reductions.ll 
(+12-12) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-unroll.ll (+4-4) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding.ll 
(+20-20) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/sve-vfabi.ll (+2-2) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-gep.ll (+2-1) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/synthesize-mask-for-call.ll (+12-6) 
- (modified) llvm/test/Transforms/LoopVectorize/AArch64/tail-folding-styles.ll 
(+10-10) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/uniform-args-call-variants.ll (+4-4) 
- (modified) 
llvm/test/Transforms/LoopVectorize/AArch64/widen-call-with-intrinsic-or-libfunc.ll
 (+5-2) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/defaults.ll (+2-2) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/divrem.ll (+12-12) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/interleaved-accesses.ll 
(+4-4) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/mask-index-type.ll (+2-2) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/masked_gather_scatter.ll 
(+4-4) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll 
(+8-6) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/scalable-basics.ll 
(+20-20) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/scalable-tailfold.ll 
(+10-10) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/select-cmp-reduction.ll 
(+6-6) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/strided-accesses.ll 
(+6-6) 
- (modified) llvm/test/Transforms/LoopVectorize/RISCV/uniform-load-store.ll 
(+20-20) 
- (modified) 
llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains-vplan.ll 
(+4-2) 
- (modified) 
llvm/test/Transforms/LoopVectorize/first-order-recurrence-sink-replicate-region.ll
 (+12-6) 
- (modified) llvm/test/Transforms/LoopVectorize/icmp-uniforms.ll (+2-1) 
- (modified) 
l

[llvm-branch-commits] [llvm] [VPlan] Initial modeling of runtime VF * UF as VPValue. (PR #74761)

2023-12-07 Thread via llvm-branch-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 f7aef976460187cf1c851e359f3fe46ab0ba6527 
9421037da2ec22ec345216e5b8f3c3108926adbe -- 
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp 
llvm/lib/Transforms/Vectorize/VPlan.cpp llvm/lib/Transforms/Vectorize/VPlan.h 
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp 
llvm/lib/Transforms/Vectorize/VPlanValue.h
``





View the diff from clang-format here.


``diff
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp 
b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index c06698765c..32e86d811a 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -8620,9 +8620,9 @@ static void addCanonicalIVRecipes(VPlan &Plan, Type 
*IdxTy, bool HasNUW,
 
   // Add a CanonicalIVIncrement{NUW} VPInstruction to increment the scalar
   // IV by VF * UF.
-  auto *CanonicalIVIncrement = new VPInstruction(
-  Instruction::Add, {CanonicalIVPHI, &Plan.getVFxUF()},
-  {HasNUW, false}, DL, "index.next");
+  auto *CanonicalIVIncrement =
+  new VPInstruction(Instruction::Add, {CanonicalIVPHI, &Plan.getVFxUF()},
+{HasNUW, false}, DL, "index.next");
   CanonicalIVPHI->addOperand(CanonicalIVIncrement);
 
   VPBasicBlock *EB = TopRegion->getExitingBasicBlock();

``




https://github.com/llvm/llvm-project/pull/74761
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [VPlan] Initial modeling of runtime VF * UF as VPValue. (PR #74761)

2023-12-07 Thread via llvm-branch-commits


@@ -1168,13 +1166,26 @@ class VPInstruction : public VPRecipeWithIRFlags, 
public VPValue {
   return false;
 case VPInstruction::ActiveLaneMask:
 case VPInstruction::CalculateTripCountMinusVF:
-case VPInstruction::CanonicalIVIncrement:
 case VPInstruction::CanonicalIVIncrementForPart:
 case VPInstruction::BranchOnCount:
   return true;
 };
 llvm_unreachable("switch should return");
   }
+

ayalz wrote:

/// Returns true if the recipe only uses the first part of operand \p Op.

https://github.com/llvm/llvm-project/pull/74761
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [VPlan] Initial modeling of runtime VF * UF as VPValue. (PR #74761)

2023-12-07 Thread via llvm-branch-commits

https://github.com/ayalz edited https://github.com/llvm/llvm-project/pull/74761
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [VPlan] Initial modeling of runtime VF * UF as VPValue. (PR #74761)

2023-12-07 Thread via llvm-branch-commits


@@ -2624,6 +2644,9 @@ class VPlan {
   /// The vector trip count.
   VPValue &getVectorTripCount() { return VectorTripCount; }
 
+  /// Returns runtime VF * UF for the vector loop region.

ayalz wrote:

```suggestion
  /// Returns the VF * UF of the vector loop region.
```

https://github.com/llvm/llvm-project/pull/74761
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [VPlan] Initial modeling of runtime VF * UF as VPValue. (PR #74761)

2023-12-07 Thread via llvm-branch-commits

https://github.com/ayalz approved this pull request.

LGTM, couple of minor nits.

https://github.com/llvm/llvm-project/pull/74761
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [llvm] [clang] [HLSL] Add helpers to simplify HLSL resource type declarations. NFC (PR #73967)

2023-12-07 Thread Justin Bogner via llvm-branch-commits

https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/73967
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] 0e0ab31 - Revert "[OpenMP][Fix] Fix test array initialization. (#74799)"

2023-12-07 Thread via llvm-branch-commits

Author: Gheorghe-Teodor Bercea
Date: 2023-12-07T22:12:18-05:00
New Revision: 0e0ab31f0ab8b3cda2cd8005bdb54be931463405

URL: 
https://github.com/llvm/llvm-project/commit/0e0ab31f0ab8b3cda2cd8005bdb54be931463405
DIFF: 
https://github.com/llvm/llvm-project/commit/0e0ab31f0ab8b3cda2cd8005bdb54be931463405.diff

LOG: Revert "[OpenMP][Fix] Fix test array initialization. (#74799)"

This reverts commit d41368134478d1d41726aa85ba82f49b5bce130c.

Added: 


Modified: 
openmp/libomptarget/test/offloading/back2back_distribute.c

Removed: 




diff  --git a/openmp/libomptarget/test/offloading/back2back_distribute.c 
b/openmp/libomptarget/test/offloading/back2back_distribute.c
index 4910d4181739c..750e39061974a 100644
--- a/openmp/libomptarget/test/offloading/back2back_distribute.c
+++ b/openmp/libomptarget/test/offloading/back2back_distribute.c
@@ -15,12 +15,12 @@ void reset_input(double *a, double *a_h, double *b, double 
*c) {
 }
 
 int main(int argc, char *argv[]) {
-  double *a = (double *)calloc(MAX_N * sizeof(double));
-  double *a_h = (double *)calloc(MAX_N * sizeof(double));
-  double *d = (double *)calloc(MAX_N * sizeof(double));
-  double *d_h = (double *)calloc(MAX_N * sizeof(double));
-  double *b = (double *)calloc(MAX_N * sizeof(double));
-  double *c = (double *)calloc(MAX_N * sizeof(double));
+  double * a = (double *) malloc(MAX_N * sizeof(double));
+  double * a_h = (double *) malloc(MAX_N * sizeof(double));
+  double * d = (double *) malloc(MAX_N * sizeof(double));
+  double * d_h = (double *) malloc(MAX_N * sizeof(double));
+  double * b = (double *) malloc(MAX_N * sizeof(double));
+  double * c = (double *) malloc(MAX_N * sizeof(double));
 
 #pragma omp target enter data map(to:a[:MAX_N],b[:MAX_N],c[:MAX_N],d[:MAX_N])
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits