From f06e87e4a5b25285f99cad2c2d6b92260d289c1d Mon Sep 17 00:00:00 2001
From: Sebastian Graf <sebastian.graf@kit.edu>
Date: Thu, 27 Apr 2023 15:38:35 +0200
Subject: [PATCH] Inlining literals into boring contexts is OK

---
 compiler/GHC/Core/Unfold.hs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs
index 293fbd22fdaa..ec75efa7d3f1 100644
--- a/compiler/GHC/Core/Unfold.hs
+++ b/compiler/GHC/Core/Unfold.hs
@@ -234,6 +234,7 @@ inlineBoringOk e
     go credit (Case scrut _ _ [Alt _ _ rhs]) -- See Note [Inline unsafeCoerce]
       | isUnsafeEqualityProof scrut        = go credit rhs
     go _      (Var {})                     = boringCxtOk
+    go _      (Lit l)                      = litIsTrivial l && boringCxtOk
     go _      _                            = boringCxtNotOk
 
 calcUnfoldingGuidance
-- 
GitLab