[llvm-branch-commits] [llvm] [AMDGPU] Enable atomic optimizer for divergent i64 and double values (PR #96934)

2024-07-01 Thread Pravin Jagtap via llvm-branch-commits


@@ -178,6 +178,21 @@ bool AMDGPUAtomicOptimizerImpl::run(Function &F) {
   return Changed;
 }
 
+static bool isOptimizableAtomic(Type *Ty) {
+  switch (Ty->getTypeID()) {
+  case Type::FloatTyID:
+  case Type::DoubleTyID:
+return true;
+  case Type::IntegerTyID: {
+unsigned size = Ty->getIntegerBitWidth();
+if (size == 32 || size == 64)

pravinjagtap wrote:

just 
```
return (TyBitWidth == 32 || TyBitWidth == 64)
```
?

https://github.com/llvm/llvm-project/pull/96934
___
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] [CodeGen][NewPM] Port RegUsageInfoCollector pass to NPM (PR #113874)

2024-10-28 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM, wait for others

https://github.com/llvm/llvm-project/pull/113874
___
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] AMDGPU: Migrate some tests away from undef (PR #131277)

2025-03-14 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131277
___
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] AMDGPU: Use generated checks in coalescer_distribute.ll (PR #131276)

2025-03-14 Thread Pravin Jagtap via llvm-branch-commits

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


https://github.com/llvm/llvm-project/pull/131276
___
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] AMDGPU: Migrate some tests away from undef (PR #131277)

2025-03-14 Thread Pravin Jagtap via llvm-branch-commits

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


https://github.com/llvm/llvm-project/pull/131277
___
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] AMDGPU: Use generated checks in coalescer_distribute.ll (PR #131276)

2025-03-14 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131276
___
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] AMDGPU: Replace some test i32 undef uses with poison (PR #131092)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131092
___
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] AMDGPU: Fix broken negative test from ancient times (PR #131106)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits


@@ -1,12 +1,22 @@
-; RUN: llc -mtriple=amdgcn -verify-machineinstrs %s -o - | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 
UTC_ARGS: --version 5
+; RUN: llc -mtriple=amdgcn -mcpu=tahiti %s -o - | FileCheck %s
 
-; CHECK-LABEL: foo
-; CHECK-NOT: BUFFER_LOAD_DWORDX2_OFFSET
 ; After dead code elimination, that buffer load should be eliminated finally
 ; after dead lane detection.
 define amdgpu_kernel void @foo() {
+; CHECK-LABEL: foo:
+; CHECK:   ; %bb.0: ; %entry
+; CHECK-NEXT:s_cbranch_execnz .LBB0_2
+; CHECK-NEXT:  ; %bb.1: ; %LeafBlock1
+; CHECK-NEXT:  .LBB0_2: ; %foo.exit
+; CHECK-NEXT:s_mov_b32 s3, 0xf000
+; CHECK-NEXT:s_mov_b32 s2, -1
+; CHECK-NEXT:v_mov_b32_e32 v0, 0
+; CHECK-NEXT:buffer_store_dword v0, off, s[0:3], 0
+; CHECK-NEXT:s_endpgm
+; CHECK-NEXT:  ; %bb.3: ; %sw.bb10
 entry:
-  switch i8 undef, label %foo.exit [
+  switch i8 poison, label %foo.exit [

pravinjagtap wrote:

In one of the prev. PR github actions suggested following:

In tests, avoid using undef and having tests that trigger undefined behavior. 
If you need an operand with some unimportant value, you can add a new argument 
to the function and use that instead.


https://github.com/llvm/llvm-project/pull/131106
___
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] AMDGPU: Replace some test undef uses with poison (PR #131103)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131103
___
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] AMDGPU: Replace some test undef uses with poison (PR #131103)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131103
___
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] AMDGPU: Replace test uses of ptr addrspace(5) undef with poison (PR #131101)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131101
___
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] AMDGPU: Replace ptr addrspace(4) undef uses with poison in tests (PR #131095)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131095
___
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] AMDGPU: Replace test uses of ptr addrspace(5) undef with poison (PR #131101)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131101
___
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] AMDGPU: Use generated checks in test missing checks (PR #131110)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131110
___
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] AMDGPU: Use generated checks in test missing checks (PR #131110)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131110
___
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] AMDGPU: Replace i16 undefs with poison in tests (PR #131084)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131084
___
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] AMDGPU: Replace more undef test pointer uses with poison (PR #131102)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131102
___
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] AMDGPU: Replace more undef test pointer uses with poison (PR #131102)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131102
___
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] AMDGPU: Replace ptr addrspace(4) undef uses with poison in tests (PR #131095)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131095
___
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] AMDGPU: Replace some test i32 undef uses with poison (PR #131092)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131092
___
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] AMDGPU: Replace i16 undefs with poison in tests (PR #131084)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131084
___
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] AMDGPU: Make ballot intrinsic propagate poison (PR #131061)

2025-03-12 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131061
___
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] AMDGPU: Make fmed3 intrinsic propagate poison (PR #131060)

2025-03-12 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM

https://github.com/llvm/llvm-project/pull/131060
___
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] AMDGPU: Make fmed3 intrinsic propagate poison (PR #131060)

2025-03-12 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131060
___
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] AMDGPU: Make ballot intrinsic propagate poison (PR #131061)

2025-03-12 Thread Pravin Jagtap via llvm-branch-commits

https://github.com/pravinjagtap edited 
https://github.com/llvm/llvm-project/pull/131061
___
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] AMDGPU: Replace some float undef test uses with poison (PR #131090)

2025-03-13 Thread Pravin Jagtap via llvm-branch-commits


@@ -37,7 +37,7 @@ bb2:
 define amdgpu_kernel void @preserve_condition_undef_flag(float %arg, i32 
%arg1, float %arg2) {
 bb0:
   %tmp = icmp sgt i32 %arg1, 4
-  %undef = call i1 @llvm.amdgcn.class.f32(float undef, i32 undef)
+  %undef = call i1 @llvm.amdgcn.class.f32(float poison, i32 undef)

pravinjagtap wrote:

second undef is needed here?

https://github.com/llvm/llvm-project/pull/131090
___
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] AMDGPU: Fold bitcasts into readfirstlane, readlane, and permlane64 (PR #128494)

2025-02-24 Thread Pravin Jagtap via llvm-branch-commits

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

LGTM, I think, its worth adding few neg test points for div values

https://github.com/llvm/llvm-project/pull/128494
___
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] AMDGPU: Fold bitcasts into readfirstlane, readlane, and permlane64 (PR #128494)

2025-02-24 Thread Pravin Jagtap via llvm-branch-commits

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