From 2255136428b1e5fea5185c490e901c7d2ffee4a6 Mon Sep 17 00:00:00 2001 From: Sven Tennie <sven.tennie@gmail.com> Date: Sat, 4 Nov 2023 16:02:24 +0100 Subject: [PATCH] AArch64: Delete unused LDATA pseudo-instruction Though there were consuming functions for LDATA, there were no producers. Thus, the removed code was "dead". --- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs | 7 +++---- compiler/GHC/CmmToAsm/AArch64/Instr.hs | 7 ------- compiler/GHC/CmmToAsm/AArch64/Ppr.hs | 1 - 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs b/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs index 868e59314917..598d478715bd 100644 --- a/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/AArch64/CodeGen.hs @@ -162,8 +162,9 @@ basicBlockCodeGen block = do -- unwinding info. See Ticket 19913 -- code generation may introduce new basic block boundaries, which -- are indicated by the NEWBLOCK instruction. We must split up the - -- instruction stream into basic blocks again. Also, we extract - -- LDATAs here too. + -- instruction stream into basic blocks again. Also, we may extract + -- LDATAs here too (if they are implemented by AArch64 again - See + -- PPC how to do that.) let (top,other_blocks,statics) = foldrOL mkBlocks ([],[],[]) instrs @@ -174,8 +175,6 @@ mkBlocks :: Instr -> ([Instr], [GenBasicBlock Instr], [GenCmmDecl RawCmmStatics h g]) mkBlocks (NEWBLOCK id) (instrs,blocks,statics) = ([], BasicBlock id instrs : blocks, statics) -mkBlocks (LDATA sec dat) (instrs,blocks,statics) - = (instrs, blocks, CmmData sec dat:statics) mkBlocks instr (instrs,blocks,statics) = (instr:instrs, blocks, statics) -- ----------------------------------------------------------------------------- diff --git a/compiler/GHC/CmmToAsm/AArch64/Instr.hs b/compiler/GHC/CmmToAsm/AArch64/Instr.hs index 2e730916c305..bf179015eb6e 100644 --- a/compiler/GHC/CmmToAsm/AArch64/Instr.hs +++ b/compiler/GHC/CmmToAsm/AArch64/Instr.hs @@ -432,7 +432,6 @@ isMetaInstr instr COMMENT{} -> True MULTILINE_COMMENT{} -> True LOCATION{} -> True - LDATA{} -> True NEWBLOCK{} -> True DELTA{} -> True PUSH_STACK_FRAME -> True @@ -535,11 +534,6 @@ data Instr -- location pseudo-op (file, line, col, name) | LOCATION Int Int Int String - -- some static data spat out during code - -- generation. Will be extracted before - -- pretty-printing. - | LDATA Section RawCmmStatics - -- start a new basic block. Useful during -- codegen, removed later. Preceding -- instruction should be a jump, as per the @@ -672,7 +666,6 @@ instrCon i = MULTILINE_COMMENT{} -> "COMMENT" ANN{} -> "ANN" LOCATION{} -> "LOCATION" - LDATA{} -> "LDATA" NEWBLOCK{} -> "NEWBLOCK" DELTA{} -> "DELTA" SXTB{} -> "SXTB" diff --git a/compiler/GHC/CmmToAsm/AArch64/Ppr.hs b/compiler/GHC/CmmToAsm/AArch64/Ppr.hs index 0ed9266c4f55..05941fc4c12a 100644 --- a/compiler/GHC/CmmToAsm/AArch64/Ppr.hs +++ b/compiler/GHC/CmmToAsm/AArch64/Ppr.hs @@ -357,7 +357,6 @@ pprInstr platform instr = case instr of -- in the final instruction stream. But we still want to be able to -- print it for debugging purposes. line (text "BLOCK " <> pprAsmLabel platform (blockLbl blockid)) - LDATA _ _ -> panic "pprInstr: LDATA" -- Pseudo Instructions ------------------------------------------------------- -- GitLab