[llvm] 649bde4 - [AMDGPU] Simplify S_SETREG_B32 case in EmitInstrWithCustomInserter

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 07:18:48 PDT 2020


Author: Jay Foad
Date: 2020-09-09T15:18:31+01:00
New Revision: 649bde488ce9b5c1143e718247f0eda461300a77

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

LOG: [AMDGPU] Simplify S_SETREG_B32 case in EmitInstrWithCustomInserter

NFC.

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 26fbab63e1ca..d88ad58d3ab4 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -4263,21 +4263,16 @@ MachineBasicBlock *SITargetLowering::EmitInstrWithCustomInserter(
 
     // The dedicated instructions can only set the whole denorm or round mode at
     // once, not a subset of bits in either.
-    if (Width == 8 && (SetMask & (AMDGPU::Hwreg::FP_ROUND_MASK |
-                                  AMDGPU::Hwreg::FP_DENORM_MASK)) == SetMask) {
+    if (SetMask ==
+        (AMDGPU::Hwreg::FP_ROUND_MASK | AMDGPU::Hwreg::FP_DENORM_MASK)) {
       // If this fully sets both the round and denorm mode, emit the two
       // dedicated instructions for these.
-      assert(Offset == 0);
       SetRoundOp = AMDGPU::S_ROUND_MODE;
       SetDenormOp = AMDGPU::S_DENORM_MODE;
-    } else if (Width == 4) {
-      if ((SetMask & AMDGPU::Hwreg::FP_ROUND_MASK) == SetMask) {
-        SetRoundOp = AMDGPU::S_ROUND_MODE;
-        assert(Offset == 0);
-      } else if ((SetMask & AMDGPU::Hwreg::FP_DENORM_MASK) == SetMask) {
-        SetDenormOp = AMDGPU::S_DENORM_MODE;
-        assert(Offset == 4);
-      }
+    } else if (SetMask == AMDGPU::Hwreg::FP_ROUND_MASK) {
+      SetRoundOp = AMDGPU::S_ROUND_MODE;
+    } else if (SetMask == AMDGPU::Hwreg::FP_DENORM_MASK) {
+      SetDenormOp = AMDGPU::S_DENORM_MODE;
     }
 
     if (SetRoundOp || SetDenormOp) {


        


More information about the llvm-commits mailing list