[llvm] [NVPTX] Avoid nonlocal MachineCSE of special register reads. (PR #228303)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 01:12:42 PDT 2026


================
@@ -5778,6 +5779,7 @@ class PTX_READ_SREG_R64<string regname, Intrinsic intop, list<Predicate> Preds=[
               [(set i64:$d, (intop))]>,
     Requires<Preds>;
 
+let isAsCheapAsAMove = true in
----------------
sjoerdmeijer wrote:

This has the potential to have a wider impact than just MachineCSE. I grepped for `TII->isAsCheapAsAMove` in the `llvm-project/llvm/lib/CodeGen` directory, and see a number of occurences in other passes. The idea makes sense to me, so my only high level question is if you have done a large enough performance sweep to double check performance?

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


More information about the llvm-commits mailing list