[llvm] 9786e75 - Revert "[AMDGPU] NFC target dependent requiresUniformRegister refactored out"

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 10:00:57 PDT 2020


Author: Matt Arsenault
Date: 2020-05-26T12:58:18-04:00
New Revision: 9786e7552d5564268484357866088d0a054bccaf

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

LOG: Revert "[AMDGPU] NFC target dependent requiresUniformRegister refactored out"

This reverts commit fb38b98338cc87442e3451665e82bf1c8ef9388f.

This will regress compile time.

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/TargetLowering.h
    llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
    llvm/lib/Target/AMDGPU/SIISelLowering.cpp
    llvm/lib/Target/AMDGPU/SIISelLowering.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h
index 70bc6b986d3c..2689838b3e7c 100644
--- a/llvm/include/llvm/CodeGen/TargetLowering.h
+++ b/llvm/include/llvm/CodeGen/TargetLowering.h
@@ -28,7 +28,6 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Analysis/LegacyDivergenceAnalysis.h"
 #include "llvm/CodeGen/DAGCombine.h"
 #include "llvm/CodeGen/ISDOpcodes.h"
 #include "llvm/CodeGen/RuntimeLibcalls.h"
@@ -822,12 +821,12 @@ class TargetLoweringBase {
     return RC;
   }
 
-  /// Allows target to decide about the divergence of the
-  /// specific value. Base class implementation returns true
-  /// if the Divergece Analysis exists and reports value as divergent.
-  virtual bool isDivergent(const LegacyDivergenceAnalysis *DA,
-                           MachineFunction &MF, const Value *V) const {
-    return DA && DA->isDivergent(V);
+  /// Allows target to decide about the register class of the
+  /// specific value that is live outside the defining block.
+  /// Returns true if the value needs uniform register class.
+  virtual bool requiresUniformRegister(MachineFunction &MF,
+                                       const Value *) const {
+    return false;
   }
 
   /// Return the 'representative' register class for the specified value

diff  --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 36e9ea538b6b..7a5fd7d24c68 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -398,7 +398,8 @@ Register FunctionLoweringInfo::CreateRegs(Type *Ty, bool isDivergent) {
 }
 
 Register FunctionLoweringInfo::CreateRegs(const Value *V) {
-  return CreateRegs(V->getType(), TLI->isDivergent(DA, *MF, V));
+  return CreateRegs(V->getType(), DA && DA->isDivergent(V) &&
+                    !TLI->requiresUniformRegister(*MF, V));
 }
 
 /// GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the

diff  --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 722275e00a13..2c147fa8947c 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -11226,12 +11226,6 @@ SITargetLowering::getRegClassFor(MVT VT, bool isDivergent) const {
   return RC;
 }
 
-bool SITargetLowering::isDivergent(const LegacyDivergenceAnalysis *DA,
-                                   MachineFunction &MF, const Value *V) const {
-  return !requiresUniformRegister(MF, V) &&
-         TargetLoweringBase::isDivergent(DA, MF, V);
-}
-
 // FIXME: This is a workaround for DivergenceAnalysis not understanding always
 // uniform values (as produced by the mask results of control flow intrinsics)
 // used outside of divergent blocks. The phi users need to also be treated as

diff  --git a/llvm/lib/Target/AMDGPU/SIISelLowering.h b/llvm/lib/Target/AMDGPU/SIISelLowering.h
index 80f3a87ce0fa..7ef11eba4f9c 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.h
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.h
@@ -416,9 +416,8 @@ class SITargetLowering final : public AMDGPUTargetLowering {
 
   virtual const TargetRegisterClass *
   getRegClassFor(MVT VT, bool isDivergent) const override;
-  virtual bool isDivergent(const LegacyDivergenceAnalysis *DA,
-                           MachineFunction &MF, const Value *V) const override;
-  bool requiresUniformRegister(MachineFunction &MF, const Value *V) const;
+  virtual bool requiresUniformRegister(MachineFunction &MF,
+                                       const Value *V) const override;
   Align getPrefLoopAlignment(MachineLoop *ML) const override;
 
   void allocateHSAUserSGPRs(CCState &CCInfo,


        


More information about the llvm-commits mailing list