[llvm] b3db7dd - [TargetInstrInfo][PowerPC] Remove virtual function that is only called from PPC specific code.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 12:51:35 PST 2021


Author: Craig Topper
Date: 2021-12-09T12:51:27-08:00
New Revision: b3db7dde79ea146136a9fe1408e8a55f678b6458

URL: https://github.com/llvm/llvm-project/commit/b3db7dde79ea146136a9fe1408e8a55f678b6458
DIFF: https://github.com/llvm/llvm-project/commit/b3db7dde79ea146136a9fe1408e8a55f678b6458.diff

LOG: [TargetInstrInfo][PowerPC] Remove virtual function that is only called from PPC specific code.

There are two signatures of setSpecialOperandAttr in TargetInstrInfo.
One of them is only called from PPCInstrInfo which has an override
of it.

Remove it from TargetInstrInfo and make it a non-virtual method in
PPCInstrInfo.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D115404

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/TargetInstrInfo.h
    llvm/lib/Target/PowerPC/PPCInstrInfo.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/TargetInstrInfo.h b/llvm/include/llvm/CodeGen/TargetInstrInfo.h
index d43dd9fac85d6..aefdbad79adaf 100644
--- a/llvm/include/llvm/CodeGen/TargetInstrInfo.h
+++ b/llvm/include/llvm/CodeGen/TargetInstrInfo.h
@@ -1190,8 +1190,6 @@ class TargetInstrInfo : public MCInstrInfo {
                                      MachineInstr &NewMI1,
                                      MachineInstr &NewMI2) const {}
 
-  virtual void setSpecialOperandAttr(MachineInstr &MI, uint16_t Flags) const {}
-
   /// Return true when a target supports MachineCombiner.
   virtual bool useMachineCombiner() const { return false; }
 

diff  --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.h b/llvm/lib/Target/PowerPC/PPCInstrInfo.h
index 2cfd53de3290a..c16e146da2471 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.h
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.h
@@ -393,7 +393,9 @@ class PPCInstrInfo : public PPCGenInstrInfo {
                              MachineInstr &NewMI1,
                              MachineInstr &NewMI2) const override;
 
-  void setSpecialOperandAttr(MachineInstr &MI, uint16_t Flags) const override;
+  // PowerPC specific version of setSpecialOperandAttr that copies Flags to MI
+  // and clears nuw, nsw, and exact flags.
+  void setSpecialOperandAttr(MachineInstr &MI, uint16_t Flags) const;
 
   bool isCoalescableExtInstr(const MachineInstr &MI,
                              Register &SrcReg, Register &DstReg,


        


More information about the llvm-commits mailing list