[llvm] [SDAG] Fix CSE for ADDRSPACECAST nodes (PR #122912)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 22:59:43 PST 2025


================
@@ -0,0 +1,19 @@
+; RUN: llc < %s -mcpu=sm_80 -mattr=+ptx73 -debug-only=isel -o /dev/null 2>&1 | FileCheck %s
+
+; REQUIRES: asserts
+
+target triple = "nvptx64-nvidia-cuda"
+
+;; Selection DAG CSE is hard to test since we run CSE/GVN on the IR before and
+;; after selection DAG ISel so most cases will be handled by one of these.
----------------
AlexMaclean wrote:

I was able to get around the pre-SelectionDAG CSE by using the stackrestore which causes a addrspacecast to be added during DAG legalization, so that isn't a problem. However it seems like there is some post-ISel (perhaps DAG-CSE on the machine nodes?) which is preventing the impact of this change from being easily observed in the final output. That's why I'm using the debug output. 

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


More information about the llvm-commits mailing list