diff options
| author | sewardj <unknown> | 2000-08-21 15:40:15 +0000 |
|---|---|---|
| committer | sewardj <unknown> | 2000-08-21 15:40:15 +0000 |
| commit | b71148fc3dc7f89c92c144c8e2c30c3eada8a83d (patch) | |
| tree | 3a823c0ffa76a4bc45ef8dce8181fc20eb45e066 /ghc/compiler/nativeGen/MachMisc.lhs | |
| parent | 4e477c5857d64a10fd9701da3208102cb1b2e1f4 (diff) | |
| download | haskell-b71148fc3dc7f89c92c144c8e2c30c3eada8a83d.tar.gz | |
[project @ 2000-08-21 15:40:14 by sewardj]
Make the register allocator deal properly with switch tables.
Previously, it didn't calculate the correct flow edges away from the
indirect jump (in fact it didn't reckon there were any flow edges
leaving it :) which makes a nonsense of the live variable analysis in
the branches.
A jump insn can now optionally be annotated with a list of destination
labels, and if so, the register allocator creates flow edges to all of
them.
Jump tables are now re-enabled. They remain disabled for 4.08.1,
since we aren't fixing the problem properly on that branch.
I assume this problem wasn't exposed by the old register allocator
because of the live-range-approximation hacks used in it. Since it
was undocumented, we'll never know.
Sparc builds will now break until I fix them.
Diffstat (limited to 'ghc/compiler/nativeGen/MachMisc.lhs')
| -rw-r--r-- | ghc/compiler/nativeGen/MachMisc.lhs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ghc/compiler/nativeGen/MachMisc.lhs b/ghc/compiler/nativeGen/MachMisc.lhs index 8f5c168ce3..116b8f94f0 100644 --- a/ghc/compiler/nativeGen/MachMisc.lhs +++ b/ghc/compiler/nativeGen/MachMisc.lhs @@ -50,7 +50,7 @@ import MachRegs ( stgReg, callerSaves, RegLoc(..), # endif ) import PrimRep ( PrimRep(..) ) -import Stix ( StixTree(..), StixReg(..), CodeSegment ) +import Stix ( StixTree(..), StixReg(..), CodeSegment, DestInfo(..) ) import Panic ( panic ) import GlaExts ( word2Int#, int2Word#, shiftRL#, and#, (/=#) ) import Outputable ( pprPanic, ppr ) @@ -529,7 +529,7 @@ Hence GLDZ and GLD1. Bwahahahahahahaha! -- Jumping around. - | JMP Operand -- target + | JMP DestInfo Operand -- possible dests, target | JXX Cond CLabel -- target | CALL Imm @@ -552,10 +552,14 @@ i386_insert_ffrees insns ffree_before_nonlocal_transfers insn = case insn of - CALL _ -> [GFREE, insn] - JMP (OpImm (ImmCLbl clbl)) | isAsmTemp clbl -> [insn] - JMP _ -> [GFREE, insn] - other -> [insn] + CALL _ -> [GFREE, insn] + -- Jumps to immediate labels are local + JMP _ (OpImm (ImmCLbl clbl)) | isAsmTemp clbl -> [insn] + -- If a jump mentions dests, it is a local jump thru + -- a case table. + JMP (DestInfo _) _ -> [insn] + JMP _ _ -> [GFREE, insn] + other -> [insn] -- if you ever add a new FP insn to the fake x86 FP insn set, |
