[PATCH] D101610: [AMDGPU] Tidy up some simple expressions for clarity NFC

David Stuttard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 30 03:15:51 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa67a377014ce: [AMDGPU] Tidy up some simple expressions for clarity NFC (authored by dstuttard).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101610/new/

https://reviews.llvm.org/D101610

Files:
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp


Index: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -4244,7 +4244,7 @@
       unsigned AddrComponents = (BaseOpcode->Coordinates ? Dim->NumCoords : 0) +
                                 (BaseOpcode->LodOrClampOrMip ? 1 : 0);
       if (IsA16)
-        AddrWords += (AddrComponents + 1) / 2;
+        AddrWords += divideCeil(AddrComponents, 2);
       else
         AddrWords += AddrComponents;
 
@@ -4252,7 +4252,7 @@
         if (PackDerivatives)
           // There are two gradients per coordinate, we pack them separately.
           // For the 3d case, we get (dy/du, dx/du) (-, dz/du) (dy/dv, dx/dv) (-, dz/dv)
-          AddrWords += (Dim->NumGradients / 2 + 1) / 2 * 2;
+          AddrWords += alignTo<2>(Dim->NumGradients / 2);
         else
           AddrWords += Dim->NumGradients;
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101610.341828.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210430/a134d241/attachment.bin>


More information about the llvm-commits mailing list