[llvm] [TargetInstrInfo][NFC] Don't restrict isAddImmediate description to physical registers (PR #72357)

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 23:06:47 PST 2023


https://github.com/asb created https://github.com/llvm/llvm-project/pull/72357

None of the in-tree implementations have different behaviour for physical vs virtual registers, and it seems would work equally well if used with virtual registers. As such, perhaps it's simplest to just drop that part of the doc comment.

>From 18a07d5c1702b661da76f5a4a9629971193872be Mon Sep 17 00:00:00 2001
From: Alex Bradbury <asb at igalia.com>
Date: Wed, 15 Nov 2023 07:02:03 +0000
Subject: [PATCH] [TargetInstrInfo][NFC] Don't restrict isAddImmediate
 description to physical registers

None of the in-tree implementations have different behaviour for
physical vs virtual registers, and it seems would work equally well if
used with virtual registers. As such, perhaps it's simplest to just drop
that part of the doc comment.
---
 llvm/include/llvm/CodeGen/TargetInstrInfo.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/include/llvm/CodeGen/TargetInstrInfo.h b/llvm/include/llvm/CodeGen/TargetInstrInfo.h
index 8e7499ac626a747..e188f226ac9f491 100644
--- a/llvm/include/llvm/CodeGen/TargetInstrInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetInstrInfo.h
@@ -1060,9 +1060,9 @@ class TargetInstrInfo : public MCInstrInfo {
   }
 
   /// If the specific machine instruction is an instruction that adds an
-  /// immediate value and a physical register, and stores the result in
-  /// the given physical register \c Reg, return a pair of the source
-  /// register and the offset which has been added.
+  /// immediate value and a register, and stores the result in the given
+  /// register \c Reg, return a pair of the source register and the offset
+  /// which has been added.
   virtual std::optional<RegImmPair> isAddImmediate(const MachineInstr &MI,
                                                    Register Reg) const {
     return std::nullopt;



More information about the llvm-commits mailing list