[llvm] [NVPTX] Pull invariant load identification into IR pass (PR #138015)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 14:55:55 PDT 2025


================
@@ -0,0 +1,104 @@
+//===------ NVPTXTagInvariantLoads.cpp - Tag invariant loads --------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements invaraint load tagging. It traverses load instructions
+// in a function, and determines if each load can be tagged as invariant.
+//
+// We currently infer invariance for loads from
+//  - constant global variables, and
+//  - kernel function pointer params that are noalias (i.e. __restrict) and
+//    never written to.
----------------
Artem-B wrote:

We can also consider grid constant arguments.

https://github.com/llvm/llvm-project/pull/138015


More information about the llvm-commits mailing list