[clang] [llvm] [OpenMP] Replace nvvm.annotation usage with kernel calling conventions (PR #122320)

2025-01-15 Thread Alex MacLean via cfe-commits
AlexMaclean wrote: @jdoerfert / @arsenm ping for review when you have a moment https://github.com/llvm/llvm-project/pull/122320 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP] Replace nvvm.annotation usage with kernel calling conventions (PR #122320)

2025-01-09 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean edited https://github.com/llvm/llvm-project/pull/122320 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2025-01-07 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean closed https://github.com/llvm/llvm-project/pull/120806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2025-01-07 Thread Alex MacLean via cfe-commits
@@ -10,8 +10,14 @@ // CHECK-NEXT:[[TMP0:%.*]] = load ptr, ptr [[RET_ADDR]], align 8 // CHECK-NEXT:store i32 1, ptr [[TMP0]], align 4 // CHECK-NEXT:ret void +// __attribute__((nvptx_kernel)) void foo(int *ret) { *ret = 1; } -// CHECK: !0 = !{ptr @foo, !"kernel

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2025-01-07 Thread Alex MacLean via cfe-commits
AlexMaclean wrote: @Artem-B ping for review https://github.com/llvm/llvm-project/pull/120806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-23 Thread Alex MacLean via cfe-commits
AlexMaclean wrote: > In MLIR, we also have other NVVM metadata such as `reqntid` and `maxntid`, > among others. What is the plan for these? Will they remain as metadata, or > will they be expressed differently? Eventually, I hope to migrate all !nvvm.annotations, including `reqntid` and `maxn

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-23 Thread Alex MacLean via cfe-commits
@@ -556,19 +556,16 @@ llvm.func @kernel_func() attributes {nvvm.kernel} { llvm.return } -// CHECK: !nvvm.annotations = -// CHECK-NOT: {ptr @nvvm_special_regs, !"kernel", i32 1} -// CHECK: {ptr @kernel_func, !"kernel", i32 1} +// CHECK: ptx_kernel void @kernel_func --

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-20 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean edited https://github.com/llvm/llvm-project/pull/120806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-20 Thread Alex MacLean via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-20 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean edited https://github.com/llvm/llvm-project/pull/120806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-20 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean ready_for_review https://github.com/llvm/llvm-project/pull/120806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [mlir] [NVPTX] Switch front-ends and tests to ptx_kernel cc (PR #120806)

2024-12-20 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean edited https://github.com/llvm/llvm-project/pull/120806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-13 Thread Alex MacLean via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-13 Thread Alex MacLean via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-12 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean edited https://github.com/llvm/llvm-project/pull/119261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Auto-Upgrade some nvvm.annotations to attributes (PR #119261)

2024-12-12 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean edited https://github.com/llvm/llvm-project/pull/119261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -324,14 +326,15 @@ MaybeAlign getAlign(const Function &F, unsigned Index) { F.getAttributes().getAttributes(Index).getStackAlignment()) return StackAlign; - // If that is missing, check the legacy nvvm metadata - std::vector Vs; - bool retval = findAllNVVMA

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -10,7 +10,7 @@ extern "C" __device__ void device_function() {} -// CHECK-LABEL: define{{.*}} void @global_function +// CHECK: define{{.*}} void @global_function{{.*}} #[[ATTR0:[0-9]+]] AlexMaclean wrote: Fixed https://github.com/llvm/llvm-project/pull/119

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -324,14 +326,17 @@ MaybeAlign getAlign(const Function &F, unsigned Index) { F.getAttributes().getAttributes(Index).getStackAlignment()) return StackAlign; - // If that is missing, check the legacy nvvm metadata - std::vector Vs; - bool retval = findAllNVVMA

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -5911,31 +5911,21 @@ bool llvm::omp::isOpenMPKernel(Function &Fn) { KernelSet llvm::omp::getDeviceKernels(Module &M) { // TODO: Create a more cross-platform way of determining device kernels. - NamedMDNode *MD = M.getNamedMetadata("nvvm.annotations"); KernelSet Kernel

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -5022,6 +5022,69 @@ bool llvm::UpgradeDebugInfo(Module &M) { return Modified; } +bool static upgradeSingleNVVMAnnotation(GlobalValue *GV, StringRef K, +const Metadata *V) { + if (K == "kernel") { +assert(mdconst::extract(V)->ge

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -5022,6 +5022,69 @@ bool llvm::UpgradeDebugInfo(Module &M) { return Modified; } +bool static upgradeSingleNVVMAnnotation(GlobalValue *GV, StringRef K, +const Metadata *V) { + if (K == "kernel") { +assert(mdconst::extract(V)->ge

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -5022,6 +5022,69 @@ bool llvm::UpgradeDebugInfo(Module &M) { return Modified; } +bool static upgradeSingleNVVMAnnotation(GlobalValue *GV, StringRef K, +const Metadata *V) { + if (K == "kernel") { +assert(mdconst::extract(V)->ge

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -5022,6 +5022,69 @@ bool llvm::UpgradeDebugInfo(Module &M) { return Modified; } +bool static upgradeSingleNVVMAnnotation(GlobalValue *GV, StringRef K, +const Metadata *V) { + if (K == "kernel") { +assert(mdconst::extract(V)->ge

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean edited https://github.com/llvm/llvm-project/pull/119261 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -5022,6 +5022,69 @@ bool llvm::UpgradeDebugInfo(Module &M) { return Modified; } +bool static upgradeSingleNVVMAnnotation(GlobalValue *GV, StringRef K, +const Metadata *V) { + if (K == "kernel") { +assert(mdconst::extract(V)->ge

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-10 Thread Alex MacLean via cfe-commits
@@ -1270,77 +1270,21 @@ exit: ; MODULE: attributes #[[ATTR1:[0-9]+]] = { convergent nocallback nounwind } ; MODULE: attributes #[[ATTR2:[0-9]+]] = { convergent nocallback nofree nounwind willreturn } ; MODULE: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nosync nounwind

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-09 Thread Alex MacLean via cfe-commits
@@ -302,6 +299,19 @@ void NVPTXTargetCodeGenInfo::addNVVMMetadata( llvm::ConstantAsMetadata::get(GV), llvm::MDString::get(Ctx, Name), llvm::ConstantAsMetadata::get( llvm::ConstantInt::get(llvm::Type::getInt32Ty(Ctx), Operand))}; + // Append metadata to nv

[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

2024-12-09 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/119261 >From f9f30a77f5e7232f968a3063c34338c9dfc7bac5 Mon Sep 17 00:00:00 2001 From: Alex Maclean Date: Fri, 8 Nov 2024 22:39:34 + Subject: [PATCH 1/3] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy

[clang] [llvm] [NVPTX] Remove nvvm.ldg.global.* intrinsics (PR #112834)

2024-10-27 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean closed https://github.com/llvm/llvm-project/pull/112834 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Remove nvvm.ldg.global.* intrinsics (PR #112834)

2024-10-21 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/112834 >From 3c21269ad0b7be617b06cde5debe405f99ef17ef Mon Sep 17 00:00:00 2001 From: Alex Maclean Date: Thu, 17 Oct 2024 16:49:24 + Subject: [PATCH 1/2] [NVPTX] Remove nvvm.ldg.global.* intrinsics --- clang/l

[clang] [llvm] [NVPTX] Remove nvvm.ldg.global.* intrinsics (PR #112834)

2024-10-19 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/112834 >From 0b43fa7364bf45515905d98cd0731c5509de5196 Mon Sep 17 00:00:00 2001 From: Alex Maclean Date: Thu, 17 Oct 2024 16:49:24 + Subject: [PATCH 1/2] [NVPTX] Remove nvvm.ldg.global.* intrinsics --- clang/l

[clang] [llvm] [NVPTX] Remove nvvm.ldg.global.* intrinsics (PR #112834)

2024-10-17 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean created https://github.com/llvm/llvm-project/pull/112834 Remove these intrinsics which can be better represented by load instructions with `!invariant.load` metadata: - llvm.nvvm.ldg.global.i - llvm.nvvm.ldg.global.f - llvm.nvvm.ldg.global.p >From 0b43fa7364bf45

[clang] [llvm] [NVPTX] Remove nvvm.bitcast.* intrinsics (PR #107936)

2024-09-23 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean closed https://github.com/llvm/llvm-project/pull/107936 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Remove nvvm.bitcast.* intrinsics (PR #107936)

2024-09-23 Thread Alex MacLean via cfe-commits
@@ -599,14 +599,6 @@ TARGET_BUILTIN(__nvvm_e4m3x2_to_f16x2_rn_relu, "V2hs", "", AND(SM_89,PTX81)) TARGET_BUILTIN(__nvvm_e5m2x2_to_f16x2_rn, "V2hs", "", AND(SM_89,PTX81)) TARGET_BUILTIN(__nvvm_e5m2x2_to_f16x2_rn_relu, "V2hs", "", AND(SM_89,PTX81)) -// Bitcast

[clang] [llvm] [NVPTX] Remove nvvm.bitcast.* intrinsics (PR #107936)

2024-09-23 Thread Alex MacLean via cfe-commits
@@ -599,14 +599,6 @@ TARGET_BUILTIN(__nvvm_e4m3x2_to_f16x2_rn_relu, "V2hs", "", AND(SM_89,PTX81)) TARGET_BUILTIN(__nvvm_e5m2x2_to_f16x2_rn, "V2hs", "", AND(SM_89,PTX81)) TARGET_BUILTIN(__nvvm_e5m2x2_to_f16x2_rn_relu, "V2hs", "", AND(SM_89,PTX81)) -// Bitcast

[clang] [llvm] [NVPTX] Remove nvvm.bitcast.* intrinsics (PR #107936)

2024-09-11 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/107936 >From ff978f81e0eedbc5e7547acabe414f2f1b0fd31a Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Fri, 6 Sep 2024 18:35:20 + Subject: [PATCH 1/2] [NVPTX] Remove nvvm.bitcast.* intrinsics --- clang/inclu

[clang] [llvm] [NVPTX] Remove nvvm.bitcast.* intrinsics (PR #107936)

2024-09-11 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/107936 >From ff978f81e0eedbc5e7547acabe414f2f1b0fd31a Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Fri, 6 Sep 2024 18:35:20 + Subject: [PATCH 1/2] [NVPTX] Remove nvvm.bitcast.* intrinsics --- clang/inclu

[clang] [llvm] [NVPTX] Remove nvvm.bitcast.* intrinsics (PR #107936)

2024-09-09 Thread Alex MacLean via cfe-commits
AlexMaclean wrote: > It may be worth adding a note about this in the release notes. I'm not familiar with these, can you point me to an analogous change I could use as an example? https://github.com/llvm/llvm-project/pull/107936 ___ cfe-commits maili

[clang] [llvm] [NVPTX] Remove nvvm.bitcast.* intrinsics (PR #107936)

2024-09-09 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean created https://github.com/llvm/llvm-project/pull/107936 Remove the following intrinsics which correspond directly to a bitcast: - llvm.nvvm.bitcast.f2i - llvm.nvvm.bitcast.i2f - llvm.nvvm.bitcast.d2ll - llvm.nvvm.bitcast.ll2d >From ff978f81e0eedbc5e7547acabe414f2

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-30 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean closed https://github.com/llvm/llvm-project/pull/97762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-29 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/97762 >From 0477447f29b2889f92abf44cacd5e0f2c4e7f387 Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 1 Jul 2024 17:06:56 + Subject: [PATCH 1/6] [ValueTracking] use KnownBits to compute fpclass from bitc

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-29 Thread Alex MacLean via cfe-commits
@@ -5921,6 +5921,61 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts, break; } + case Instruction::BitCast: { +const Value *Src; +if (!match(Op, m_ElementWiseBitCast(m_Value(Src))) || +!Src->getType()->isIntOrIntVectorTy()) + b

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-28 Thread Alex MacLean via cfe-commits
@@ -5921,6 +5921,61 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts, break; } + case Instruction::BitCast: { +const Value *Src; +if (!match(Op, m_ElementWiseBitCast(m_Value(Src))) || +!Src->getType()->isIntOrIntVectorTy()) + b

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-27 Thread Alex MacLean via cfe-commits
AlexMaclean wrote: @arsenm, @goldsteinn when you have a minute could you take another look at this? I think I've addressed all the issues you've raised. https://github.com/llvm/llvm-project/pull/97762 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-27 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/97762 >From ddb38bd6c86e36ab8b46a4fb5f97390d140f4aa1 Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 1 Jul 2024 17:06:56 + Subject: [PATCH 1/6] [ValueTracking] use KnownBits to compute fpclass from bitc

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-27 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/97762 >From ce146e18f74e8e984ef83d152f3a5fe88e56f287 Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 1 Jul 2024 17:06:56 + Subject: [PATCH 1/6] [ValueTracking] use KnownBits to compute fpclass from bitc

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-27 Thread Alex MacLean via cfe-commits
@@ -1549,30 +1549,10 @@ define amdgpu_kernel void @multiple_uses_fneg_select_f64(double %x, double %y, i define amdgpu_kernel void @fnge_select_f32_multi_use_regression(float %.i2369) { ; GCN-LABEL: fnge_select_f32_multi_use_regression: ; GCN: ; %bb.0: ; %.entry -; GCN-

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-26 Thread Alex MacLean via cfe-commits
@@ -2690,6 +2690,163 @@ entry: ret double %abs } +define float @bitcast_to_float_sign_0(i32 %arg) { +; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) +; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @bitcast_to_flo

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-26 Thread Alex MacLean via cfe-commits
@@ -5805,6 +5805,37 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts, break; } + case Instruction::BitCast: { +const Value *Src; +if (!match(Op, m_ElementWiseBitCast(m_Value(Src))) || +!Src->getType()->isIntOrIntVectorTy()) + b

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-08-26 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/97762 >From 2dc91ada9078e5c7344e74d5b549e896056f89ad Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 1 Jul 2024 17:06:56 + Subject: [PATCH 1/5] [ValueTracking] use KnownBits to compute fpclass from bitc

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-07-06 Thread Alex MacLean via cfe-commits
AlexMaclean wrote: > Can you add some tests to demonstrate that this patch will enable more > optimizations in some real-world applications? I can extend the existing test cases to make them more elaborate/real-looking, but I'm guessing that would not qualify as "real-world". This patch is mo

[clang] [llvm] [ValueTracking] use KnownBits to compute fpclass from bitcast (PR #97762)

2024-07-05 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/97762 >From c2913d1074c5bfa771379d68e9ba728a3d1d1ce5 Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 1 Jul 2024 17:06:56 + Subject: [PATCH 1/4] [ValueTracking] use KnownBits to compute fpclass from bitc

[clang] [llvm] [NVPTX] Support inline asm with 128-bit operand in NVPTX backend (PR #97113)

2024-07-01 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean closed https://github.com/llvm/llvm-project/pull/97113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fixup cuda-builtin-vars.cu broken in IntrRange change (PR #94639)

2024-06-06 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean closed https://github.com/llvm/llvm-project/pull/94639 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-06 Thread Alex MacLean via cfe-commits
@@ -6,21 +6,21 @@ __attribute__((global)) void kernel(int *out) { int i = 0; - out[i++] = threadIdx.x; // CHECK: call noundef i32 @llvm.nvvm.read.ptx.sreg.tid.x() - out[i++] = threadIdx.y; // CHECK: call noundef i32 @llvm.nvvm.read.ptx.sreg.tid.y() - out[i++] = threadIdx

[clang] fixup cuda-builtin-vars.cu broken in IntrRange change (PR #94639)

2024-06-06 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean created https://github.com/llvm/llvm-project/pull/94639 None >From 227c36f7261854a1b6f8fb12fd902ffa7380be0d Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Thu, 6 Jun 2024 16:36:19 + Subject: [PATCH] fixup cuda-builtin-vars.cu broken in IntrRange change --

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Alex MacLean via cfe-commits
@@ -139,24 +138,23 @@ define ptx_device i32 @test_ctaid_w() { define ptx_device i32 @test_nctaid_y() { ; CHECK: mov.u32 %r{{[0-9]+}}, %nctaid.y; -; RANGE: call i32 @llvm.nvvm.read.ptx.sreg.nctaid.y(), !range ![[GRID_SIZE_YZ:[0-9]+]] +; RANGE: call range(i32 1, 65536) i32 @llv

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/94422 >From 708374e03f1bf70006f2472f19edad1bd621e2d6 Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 3 Jun 2024 16:46:36 + Subject: [PATCH 1/4] [NVPTX] Revamp NVVMIntrRange pass --- clang/test/CodeGenC

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Alex MacLean via cfe-commits
@@ -0,0 +1,60 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --version 5 +; RUN: opt < %s -S -mtriple=nvptx-nvidia-cuda -mcpu=sm_20 -passes=nvvm-intr-range | FileCheck %s + +define i32 @test_maxntid() { +; CHECK-LABEL:

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Alex MacLean via cfe-commits
@@ -128,6 +128,15 @@ bool findOneNVVMAnnotation(const GlobalValue *gv, const std::string &prop, return true; } +static std::optional +findOneNVVMAnnotation(const GlobalValue &GV, const std::string &PropName) { + unsigned RetVal; + bool Found = findOneNVVMAnnotation(&GV, P

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/94422 >From 708374e03f1bf70006f2472f19edad1bd621e2d6 Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 3 Jun 2024 16:46:36 + Subject: [PATCH 1/3] [NVPTX] Revamp NVVMIntrRange pass --- clang/test/CodeGenC

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Alex MacLean via cfe-commits
@@ -1,50 +1,51 @@ -//===- NVVMIntrRange.cpp - Set !range metadata for NVVM intrinsics ===// +//===- NVVMIntrRange.cpp - Set range attributes for NVVM intrinsics ---===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See ht

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/94422 >From 708374e03f1bf70006f2472f19edad1bd621e2d6 Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 3 Jun 2024 16:46:36 + Subject: [PATCH 1/2] [NVPTX] Revamp NVVMIntrRange pass --- clang/test/CodeGenC

[clang] [llvm] [NVPTX] Revamp NVVMIntrRange pass (PR #94422)

2024-06-05 Thread Alex MacLean via cfe-commits
https://github.com/AlexMaclean updated https://github.com/llvm/llvm-project/pull/94422 >From 708374e03f1bf70006f2472f19edad1bd621e2d6 Mon Sep 17 00:00:00 2001 From: Alex MacLean Date: Mon, 3 Jun 2024 16:46:36 + Subject: [PATCH] [NVPTX] Revamp NVVMIntrRange pass --- clang/test/CodeGenCUDA/