[llvm] [SelectionDAG] Use uintptr_t for ResNo in SDValue. (PR #104660)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 19:47:38 PDT 2024


https://github.com/topperc created https://github.com/llvm/llvm-project/pull/104660

This uses up the padding bytes at the end of SDValue on 64-bit hosts.

This reduces compile and binary size according to these results https://llvm-compile-time-tracker.com/compare.php?from=6e0fc155782ff5307245a85c7b037a2998ec6c86&to=75ea202907d75e9e5362c487466e956036beeefc&stat=instructions:u

>From 6c8520777908667de7d430cede28cc79ed973dde Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Fri, 16 Aug 2024 19:10:06 -0700
Subject: [PATCH] [SelectionDAG] Use uintptr_t for ResNo in SDValue.

This uses up the padding bytes at the end of SDValue.

This reduces compile and binary size.

compiler time result https://llvm-compile-time-tracker.com/compare.php?from=6e0fc155782ff5307245a85c7b037a2998ec6c86&to=75ea202907d75e9e5362c487466e956036beeefc&stat=instructions:u
---
 llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
index 2f36c2e86b1c3a..dc3bb63580bd2d 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -146,7 +146,7 @@ class SDValue {
   friend struct DenseMapInfo<SDValue>;
 
   SDNode *Node = nullptr; // The node defining the value we are using.
-  unsigned ResNo = 0;     // Which return value of the node we are using.
+  uintptr_t ResNo = 0;       // Which return value of the node we are using.
 
 public:
   SDValue() = default;



More information about the llvm-commits mailing list