X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2FnativeGen%2FRegAlloc%2FGraph%2FMain.hs;h=5fa771cfb8b97c3332d681c42120c32f43107dc6;hb=703ca1542c8e0983cc9d8eebce6e9f3dd3fd71e2;hp=94b18aeb0a1b7bb0950504b56833001dfb016e7f;hpb=f9288086f935c97812b2d80defcff38baf7b6a6c;p=ghc-hetmet.git diff --git a/compiler/nativeGen/RegAlloc/Graph/Main.hs b/compiler/nativeGen/RegAlloc/Graph/Main.hs index 94b18ae..5fa771c 100644 --- a/compiler/nativeGen/RegAlloc/Graph/Main.hs +++ b/compiler/nativeGen/RegAlloc/Graph/Main.hs @@ -11,7 +11,6 @@ module RegAlloc.Graph.Main ( where import qualified GraphColor as Color -import qualified GraphBase as Color import RegAlloc.Liveness import RegAlloc.Graph.Spill import RegAlloc.Graph.SpillClean @@ -311,9 +310,16 @@ graphAddCoalesce (r1, r2) graph (vr2, classOfVirtualReg vr2) graph - | otherwise - = panic "RegAlloc.Graph.Main.graphAddCoalesce: can't coalesce two real regs" + -- We can't coalesce two real regs, but there could well be existing + -- hreg,hreg moves in the input code. We'll just ignore these + -- for coalescing purposes. + | RegReal _ <- r1 + , RegReal _ <- r2 + = graph +graphAddCoalesce _ _ + = panic "graphAddCoalesce: bogus" + -- | Patch registers in code using the reg -> reg mapping in this graph. patchRegsFromGraph