[Git][ghc/ghc][wip/supersven/riscv64-ncg] Fix type of makeFarBranches

Sven Tennie (@supersven) gitlab at gitlab.haskell.org
Sun May 26 14:55:25 UTC 2024



Sven Tennie pushed to branch wip/supersven/riscv64-ncg at Glasgow Haskell Compiler / GHC


Commits:
be0415d7 by Sven Tennie at 2024-05-26T16:54:50+02:00
Fix type of makeFarBranches

It changed during releases

- - - - -


1 changed file:

- compiler/GHC/CmmToAsm/RV64/Instr.hs


Changes:

=====================================
compiler/GHC/CmmToAsm/RV64/Instr.hs
=====================================
@@ -828,12 +828,13 @@ isFloatReg _ = False
 -- condition, do a far jump in the fall-through case or a short jump when the
 -- (inverted) condition is true.
 makeFarBranches ::
+  Platform ->
   LabelMap RawCmmStatics ->
   [NatBasicBlock Instr] ->
-  [NatBasicBlock Instr]
-makeFarBranches info_env blocks
-  | NE.last blockAddresses < nearLimit = blocks
-  | otherwise = zipWith handleBlock blockAddressList blocks
+  UniqSM [NatBasicBlock Instr]
+makeFarBranches _platform info_env blocks
+  | NE.last blockAddresses < nearLimit = pure blocks
+  | otherwise = pure $ zipWith handleBlock blockAddressList blocks
   where
     blockAddresses = NE.scanl (+) 0 $ map blockLen blocks
     blockAddressList = toList blockAddresses
@@ -842,6 +843,7 @@ makeFarBranches info_env blocks
     handleBlock addr (BasicBlock id instrs) =
       BasicBlock id (zipWith (makeFar id) [addr ..] instrs)
 
+    -- TODO: Use UniqSM to generate unique block ids.
     makeFar :: BlockId -> Int -> Instr -> Instr
     makeFar bid addr orig@(BCOND cond op1 op2 tgt@(TBlock tgtBid))
       | abs (addr - targetAddr) >= nearLimit =



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/be0415d77a2d7eda67cd6d3f909d97af669ace46

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/be0415d77a2d7eda67cd6d3f909d97af669ace46
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240526/be5424f8/attachment-0001.html>


More information about the ghc-commits mailing list