[Git][ghc/ghc][wip/gbc-files] Revert "Add a perf test for #26425"
                        
                        
by Matthew Pickering (@mpickering) 10 Oct '25
                    by Matthew Pickering (@mpickering) 10 Oct '25
10 Oct '25
                    
                        
Matthew Pickering pushed to branch wip/gbc-files at Glasgow Haskell Compiler / GHC
Commits:
33732b36 by Matthew Pickering at 2025-10-10T15:39:29+01:00
Revert "Add a perf test for #26425"
This test has a large memory spike currently, which makes the test
sensitive, since if you allocate a little more or less, the precise
location where GC happens shifts and you observe a different part of the
spike.
Andreas told me to revert the patch for now, and he will add it back
when he fixes the memory spike.
This reverts commit 41bdb16fd083110a06507248f648c507a2feb4af.
- - - - -
2 changed files:
- − testsuite/tests/perf/compiler/T26425.hs
- testsuite/tests/perf/compiler/all.T
Changes:
=====================================
testsuite/tests/perf/compiler/T26425.hs deleted
=====================================
@@ -1,664 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-module Reproducer (strToInt) where
-
-import qualified Data.Text as T
-
-{- This program results in a nested chain of join points and cases which tests
-   primarily OccAnal and Unfolding performance.
--}
-
-strToInt :: T.Text -> Maybe Int
-strToInt txt = case txt of
-    "0" -> Just 0
-    "1" -> Just 1
-    "2" -> Just 2
-    "3" -> Just 3
-    "4" -> Just 4
-    "5" -> Just 5
-    "6" -> Just 6
-    "7" -> Just 7
-    "8" -> Just 8
-    "9" -> Just 9
-    "10" -> Just 10
-    "11" -> Just 11
-    "12" -> Just 12
-    "13" -> Just 13
-    "14" -> Just 14
-    "15" -> Just 15
-    "16" -> Just 16
-    "17" -> Just 17
-    "18" -> Just 18
-    "19" -> Just 19
-    "20" -> Just 20
-    "21" -> Just 21
-    "22" -> Just 22
-    "23" -> Just 23
-    "24" -> Just 24
-    "25" -> Just 25
-    "26" -> Just 26
-    "27" -> Just 27
-    "28" -> Just 28
-    "29" -> Just 29
-    "30" -> Just 30
-    "31" -> Just 31
-    "32" -> Just 32
-    "33" -> Just 33
-    "34" -> Just 34
-    "35" -> Just 35
-    "36" -> Just 36
-    "37" -> Just 37
-    "38" -> Just 38
-    "39" -> Just 39
-    "40" -> Just 40
-    "41" -> Just 41
-    "42" -> Just 42
-    "43" -> Just 43
-    "44" -> Just 44
-    "45" -> Just 45
-    "46" -> Just 46
-    "47" -> Just 47
-    "48" -> Just 48
-    "49" -> Just 49
-    "50" -> Just 50
-    "51" -> Just 51
-    "52" -> Just 52
-    "53" -> Just 53
-    "54" -> Just 54
-    "55" -> Just 55
-    "56" -> Just 56
-    "57" -> Just 57
-    "58" -> Just 58
-    "59" -> Just 59
-    "60" -> Just 60
-    "61" -> Just 61
-    "62" -> Just 62
-    "63" -> Just 63
-    "64" -> Just 64
-    "65" -> Just 65
-    "66" -> Just 66
-    "67" -> Just 67
-    "68" -> Just 68
-    "69" -> Just 69
-    "70" -> Just 70
-    "71" -> Just 71
-    "72" -> Just 72
-    "73" -> Just 73
-    "74" -> Just 74
-    "75" -> Just 75
-    "76" -> Just 76
-    "77" -> Just 77
-    "78" -> Just 78
-    "79" -> Just 79
-    "80" -> Just 80
-    "81" -> Just 81
-    "82" -> Just 82
-    "83" -> Just 83
-    "84" -> Just 84
-    "85" -> Just 85
-    "86" -> Just 86
-    "87" -> Just 87
-    "88" -> Just 88
-    "89" -> Just 89
-    "90" -> Just 90
-    "91" -> Just 91
-    "92" -> Just 92
-    "93" -> Just 93
-    "94" -> Just 94
-    "95" -> Just 95
-    "96" -> Just 96
-    "97" -> Just 97
-    "98" -> Just 98
-    "99" -> Just 99
-    "100" -> Just 100
-    "101" -> Just 101
-    "102" -> Just 102
-    "103" -> Just 103
-    "104" -> Just 104
-    "105" -> Just 105
-    "106" -> Just 106
-    "107" -> Just 107
-    "108" -> Just 108
-    "109" -> Just 109
-    "110" -> Just 110
-    "111" -> Just 111
-    "112" -> Just 112
-    "113" -> Just 113
-    "114" -> Just 114
-    "115" -> Just 115
-    "116" -> Just 116
-    "117" -> Just 117
-    "118" -> Just 118
-    "119" -> Just 119
-    "120" -> Just 120
-    "121" -> Just 121
-    "122" -> Just 122
-    "123" -> Just 123
-    "124" -> Just 124
-    "125" -> Just 125
-    "126" -> Just 126
-    "127" -> Just 127
-    "128" -> Just 128
-    "129" -> Just 129
-    "130" -> Just 130
-    "131" -> Just 131
-    "132" -> Just 132
-    "133" -> Just 133
-    "134" -> Just 134
-    "135" -> Just 135
-    "136" -> Just 136
-    "137" -> Just 137
-    "138" -> Just 138
-    "139" -> Just 139
-    "140" -> Just 140
-    "141" -> Just 141
-    "142" -> Just 142
-    "143" -> Just 143
-    "144" -> Just 144
-    "145" -> Just 145
-    "146" -> Just 146
-    "147" -> Just 147
-    "148" -> Just 148
-    "149" -> Just 149
-    "150" -> Just 150
-    "151" -> Just 151
-    "152" -> Just 152
-    "153" -> Just 153
-    "154" -> Just 154
-    "155" -> Just 155
-    "156" -> Just 156
-    "157" -> Just 157
-    "158" -> Just 158
-    "159" -> Just 159
-    "160" -> Just 160
-    "161" -> Just 161
-    "162" -> Just 162
-    "163" -> Just 163
-    "164" -> Just 164
-    "165" -> Just 165
-    "166" -> Just 166
-    "167" -> Just 167
-    "168" -> Just 168
-    "169" -> Just 169
-    "170" -> Just 170
-    "171" -> Just 171
-    "172" -> Just 172
-    "173" -> Just 173
-    "174" -> Just 174
-    "175" -> Just 175
-    "176" -> Just 176
-    "177" -> Just 177
-    "178" -> Just 178
-    "179" -> Just 179
-    "180" -> Just 180
-    "181" -> Just 181
-    "182" -> Just 182
-    "183" -> Just 183
-    "184" -> Just 184
-    "185" -> Just 185
-    "186" -> Just 186
-    "187" -> Just 187
-    "188" -> Just 188
-    "189" -> Just 189
-    "190" -> Just 190
-    "191" -> Just 191
-    "192" -> Just 192
-    "193" -> Just 193
-    "194" -> Just 194
-    "195" -> Just 195
-    "196" -> Just 196
-    "197" -> Just 197
-    "198" -> Just 198
-    "199" -> Just 199
-    "200" -> Just 200
-    "201" -> Just 201
-    "202" -> Just 202
-    "203" -> Just 203
-    "204" -> Just 204
-    "205" -> Just 205
-    "206" -> Just 206
-    "207" -> Just 207
-    "208" -> Just 208
-    "209" -> Just 209
-    "210" -> Just 210
-    "211" -> Just 211
-    "212" -> Just 212
-    "213" -> Just 213
-    "214" -> Just 214
-    "215" -> Just 215
-    "216" -> Just 216
-    "217" -> Just 217
-    "218" -> Just 218
-    "219" -> Just 219
-    "220" -> Just 220
-    "221" -> Just 221
-    "222" -> Just 222
-    "223" -> Just 223
-    "224" -> Just 224
-    "225" -> Just 225
-    "226" -> Just 226
-    "227" -> Just 227
-    "228" -> Just 228
-    "229" -> Just 229
-    "230" -> Just 230
-    "231" -> Just 231
-    "232" -> Just 232
-    "233" -> Just 233
-    "234" -> Just 234
-    "235" -> Just 235
-    "236" -> Just 236
-    "237" -> Just 237
-    "238" -> Just 238
-    "239" -> Just 239
-    "240" -> Just 240
-    "241" -> Just 241
-    "242" -> Just 242
-    "243" -> Just 243
-    "244" -> Just 244
-    "245" -> Just 245
-    "246" -> Just 246
-    "247" -> Just 247
-    "248" -> Just 248
-    "249" -> Just 249
-    "250" -> Just 250
-    "251" -> Just 251
-    "252" -> Just 252
-    "253" -> Just 253
-    "254" -> Just 254
-    "255" -> Just 255
-    "256" -> Just 256
-    "257" -> Just 257
-    "258" -> Just 258
-    "259" -> Just 259
-    "260" -> Just 260
-    "261" -> Just 261
-    "262" -> Just 262
-    "263" -> Just 263
-    "264" -> Just 264
-    "265" -> Just 265
-    "266" -> Just 266
-    "267" -> Just 267
-    "268" -> Just 268
-    "269" -> Just 269
-    "270" -> Just 270
-    "271" -> Just 271
-    "272" -> Just 272
-    "273" -> Just 273
-    "274" -> Just 274
-    "275" -> Just 275
-    "276" -> Just 276
-    "277" -> Just 277
-    "278" -> Just 278
-    "279" -> Just 279
-    "280" -> Just 280
-    "281" -> Just 281
-    "282" -> Just 282
-    "283" -> Just 283
-    "284" -> Just 284
-    "285" -> Just 285
-    "286" -> Just 286
-    "287" -> Just 287
-    "288" -> Just 288
-    "289" -> Just 289
-    "290" -> Just 290
-    "291" -> Just 291
-    "292" -> Just 292
-    "293" -> Just 293
-    "294" -> Just 294
-    "295" -> Just 295
-    "296" -> Just 296
-    "297" -> Just 297
-    "298" -> Just 298
-    "299" -> Just 299
-    "300" -> Just 300
-    "301" -> Just 301
-    "302" -> Just 302
-    "303" -> Just 303
-    "304" -> Just 304
-    "305" -> Just 305
-    "306" -> Just 306
-    "307" -> Just 307
-    "308" -> Just 308
-    "309" -> Just 309
-    "310" -> Just 310
-    "311" -> Just 311
-    "312" -> Just 312
-    "313" -> Just 313
-    "314" -> Just 314
-    "315" -> Just 315
-    "316" -> Just 316
-    "317" -> Just 317
-    "318" -> Just 318
-    "319" -> Just 319
-    "320" -> Just 320
-    "321" -> Just 321
-    "322" -> Just 322
-    "323" -> Just 323
-    "324" -> Just 324
-    "325" -> Just 325
-    "326" -> Just 326
-    "327" -> Just 327
-    "328" -> Just 328
-    "329" -> Just 329
-    "330" -> Just 330
-    "331" -> Just 331
-    "332" -> Just 332
-    "333" -> Just 333
-    "334" -> Just 334
-    "335" -> Just 335
-    "336" -> Just 336
-    "337" -> Just 337
-    "338" -> Just 338
-    "339" -> Just 339
-    "340" -> Just 340
-    "341" -> Just 341
-    "342" -> Just 342
-    "343" -> Just 343
-    "344" -> Just 344
-    "345" -> Just 345
-    "346" -> Just 346
-    "347" -> Just 347
-    "348" -> Just 348
-    "349" -> Just 349
-    "350" -> Just 350
-    "351" -> Just 351
-    "352" -> Just 352
-    "353" -> Just 353
-    "354" -> Just 354
-    "355" -> Just 355
-    "356" -> Just 356
-    "357" -> Just 357
-    "358" -> Just 358
-    "359" -> Just 359
-    "360" -> Just 360
-    "361" -> Just 361
-    "362" -> Just 362
-    "363" -> Just 363
-    "364" -> Just 364
-    "365" -> Just 365
-    "366" -> Just 366
-    "367" -> Just 367
-    "368" -> Just 368
-    "369" -> Just 369
-    "370" -> Just 370
-    "371" -> Just 371
-    "372" -> Just 372
-    "373" -> Just 373
-    "374" -> Just 374
-    "375" -> Just 375
-    "376" -> Just 376
-    "377" -> Just 377
-    "378" -> Just 378
-    "379" -> Just 379
-    "380" -> Just 380
-    "381" -> Just 381
-    "382" -> Just 382
-    "383" -> Just 383
-    "384" -> Just 384
-    "385" -> Just 385
-    "386" -> Just 386
-    "387" -> Just 387
-    "388" -> Just 388
-    "389" -> Just 389
-    "390" -> Just 390
-    "391" -> Just 391
-    "392" -> Just 392
-    "393" -> Just 393
-    "394" -> Just 394
-    "395" -> Just 395
-    "396" -> Just 396
-    "397" -> Just 397
-    "398" -> Just 398
-    "399" -> Just 399
-    "400" -> Just 400
-    "401" -> Just 401
-    "402" -> Just 402
-    "403" -> Just 403
-    "404" -> Just 404
-    "405" -> Just 405
-    "406" -> Just 406
-    "407" -> Just 407
-    "408" -> Just 408
-    "409" -> Just 409
-    "410" -> Just 410
-    "411" -> Just 411
-    "412" -> Just 412
-    "413" -> Just 413
-    "414" -> Just 414
-    "415" -> Just 415
-    "416" -> Just 416
-    "417" -> Just 417
-    "418" -> Just 418
-    "419" -> Just 419
-    "420" -> Just 420
-    "421" -> Just 421
-    "422" -> Just 422
-    "423" -> Just 423
-    "424" -> Just 424
-    "425" -> Just 425
-    "426" -> Just 426
-    "427" -> Just 427
-    "428" -> Just 428
-    "429" -> Just 429
-    "430" -> Just 430
-    "431" -> Just 431
-    "432" -> Just 432
-    "433" -> Just 433
-    "434" -> Just 434
-    "435" -> Just 435
-    "436" -> Just 436
-    "437" -> Just 437
-    "438" -> Just 438
-    "439" -> Just 439
-    "440" -> Just 440
-    "441" -> Just 441
-    "442" -> Just 442
-    "443" -> Just 443
-    "444" -> Just 444
-    "445" -> Just 445
-    "446" -> Just 446
-    "447" -> Just 447
-    "448" -> Just 448
-    "449" -> Just 449
-    "450" -> Just 450
-    "451" -> Just 451
-    "452" -> Just 452
-    "453" -> Just 453
-    "454" -> Just 454
-    "455" -> Just 455
-    "456" -> Just 456
-    "457" -> Just 457
-    "458" -> Just 458
-    "459" -> Just 459
-    "460" -> Just 460
-    "461" -> Just 461
-    "462" -> Just 462
-    "463" -> Just 463
-    "464" -> Just 464
-    "465" -> Just 465
-    "466" -> Just 466
-    "467" -> Just 467
-    "468" -> Just 468
-    "469" -> Just 469
-    "470" -> Just 470
-    "471" -> Just 471
-    "472" -> Just 472
-    "473" -> Just 473
-    "474" -> Just 474
-    "475" -> Just 475
-    "476" -> Just 476
-    "477" -> Just 477
-    "478" -> Just 478
-    "479" -> Just 479
-    "480" -> Just 480
-    "481" -> Just 481
-    "482" -> Just 482
-    "483" -> Just 483
-    "484" -> Just 484
-    "485" -> Just 485
-    "486" -> Just 486
-    "487" -> Just 487
-    "488" -> Just 488
-    "489" -> Just 489
-    "490" -> Just 490
-    "491" -> Just 491
-    "492" -> Just 492
-    "493" -> Just 493
-    "494" -> Just 494
-    "495" -> Just 495
-    "496" -> Just 496
-    "497" -> Just 497
-    "498" -> Just 498
-    "499" -> Just 499
-    "500" -> Just 500
-    "501" -> Just 501
-    "502" -> Just 502
-    "503" -> Just 503
-    "504" -> Just 504
-    "505" -> Just 505
-    "506" -> Just 506
-    "507" -> Just 507
-    "508" -> Just 508
-    "509" -> Just 509
-    "510" -> Just 510
-    "511" -> Just 511
-    "512" -> Just 512
-    "513" -> Just 513
-    "514" -> Just 514
-    "515" -> Just 515
-    "516" -> Just 516
-    "517" -> Just 517
-    "518" -> Just 518
-    "519" -> Just 519
-    "520" -> Just 520
-    "521" -> Just 521
-    "522" -> Just 522
-    "523" -> Just 523
-    "524" -> Just 524
-    "525" -> Just 525
-    "526" -> Just 526
-    "527" -> Just 527
-    "528" -> Just 528
-    "529" -> Just 529
-    "530" -> Just 530
-    "531" -> Just 531
-    "532" -> Just 532
-    "533" -> Just 533
-    "534" -> Just 534
-    "535" -> Just 535
-    "536" -> Just 536
-    "537" -> Just 537
-    "538" -> Just 538
-    "539" -> Just 539
-    "540" -> Just 540
-    "541" -> Just 541
-    "542" -> Just 542
-    "543" -> Just 543
-    "544" -> Just 544
-    "545" -> Just 545
-    "546" -> Just 546
-    "547" -> Just 547
-    "548" -> Just 548
-    "549" -> Just 549
-    "550" -> Just 550
-    "551" -> Just 551
-    "552" -> Just 552
-    "553" -> Just 553
-    "554" -> Just 554
-    "555" -> Just 555
-    "556" -> Just 556
-    "557" -> Just 557
-    "558" -> Just 558
-    "559" -> Just 559
-    "560" -> Just 560
-    "561" -> Just 561
-    "562" -> Just 562
-    "563" -> Just 563
-    "564" -> Just 564
-    "565" -> Just 565
-    "566" -> Just 566
-    "567" -> Just 567
-    "568" -> Just 568
-    "569" -> Just 569
-    "570" -> Just 570
-    "571" -> Just 571
-    "572" -> Just 572
-    "573" -> Just 573
-    "574" -> Just 574
-    "575" -> Just 575
-    "576" -> Just 576
-    "577" -> Just 577
-    "578" -> Just 578
-    "579" -> Just 579
-    "580" -> Just 580
-    "581" -> Just 581
-    "582" -> Just 582
-    "583" -> Just 583
-    "584" -> Just 584
-    "585" -> Just 585
-    "586" -> Just 586
-    "587" -> Just 587
-    "588" -> Just 588
-    "589" -> Just 589
-    "590" -> Just 590
-    "591" -> Just 591
-    "592" -> Just 592
-    "593" -> Just 593
-    "594" -> Just 594
-    "595" -> Just 595
-    "596" -> Just 596
-    "597" -> Just 597
-    "598" -> Just 598
-    "599" -> Just 599
-    "600" -> Just 600
-    "601" -> Just 601
-    "602" -> Just 602
-    "603" -> Just 603
-    "604" -> Just 604
-    "605" -> Just 605
-    "606" -> Just 606
-    "607" -> Just 607
-    "608" -> Just 608
-    "609" -> Just 609
-    "610" -> Just 610
-    "611" -> Just 611
-    "612" -> Just 612
-    "613" -> Just 613
-    "614" -> Just 614
-    "615" -> Just 615
-    "616" -> Just 616
-    "617" -> Just 617
-    "618" -> Just 618
-    "619" -> Just 619
-    "620" -> Just 620
-    "621" -> Just 621
-    "622" -> Just 622
-    "623" -> Just 623
-    "624" -> Just 624
-    "625" -> Just 625
-    "626" -> Just 626
-    "627" -> Just 627
-    "628" -> Just 628
-    "629" -> Just 629
-    "630" -> Just 630
-    "631" -> Just 631
-    "632" -> Just 632
-    "633" -> Just 633
-    "634" -> Just 634
-    "635" -> Just 635
-    "636" -> Just 636
-    "637" -> Just 637
-    "638" -> Just 638
-    "639" -> Just 639
-    "640" -> Just 640
-    "641" -> Just 641
-    "642" -> Just 642
-    "643" -> Just 643
-    "644" -> Just 644
-    "645" -> Just 645
-    "646" -> Just 646
-    "647" -> Just 647
-    "648" -> Just 648
-    "649" -> Just 649
-    "650" -> Just 650
-    _ -> Nothing
=====================================
testsuite/tests/perf/compiler/all.T
=====================================
@@ -806,8 +806,3 @@ test('interpreter_steplocal',
      ],
      ghci_script,
      ['interpreter_steplocal.script'])
-
-test ('T26425',
-      [ collect_compiler_stats('all',5) ],
-      compile,
-      ['-O'])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/33732b369b15a019f27714ca0be8439…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/33732b369b15a019f27714ca0be8439…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/andreask/occ_anal_tuning] 15 commits: testsuite: Use ghci_ways to set ways in PackedDataCon/UnboxedTuples/UnliftedDataTypeInterp tests
                        
                        
by Andreas Klebinger (@AndreasK) 10 Oct '25
                    by Andreas Klebinger (@AndreasK) 10 Oct '25
10 Oct '25
                    
                        
Andreas Klebinger pushed to branch wip/andreask/occ_anal_tuning at Glasgow Haskell Compiler / GHC
Commits:
1275d360 by Matthew Pickering at 2025-10-03T06:05:56-04:00
testsuite: Use ghci_ways to set ways in PackedDataCon/UnboxedTuples/UnliftedDataTypeInterp tests
These tests reimplemented the logic from `valid_way` in order to
determine what ways to run. It's easier to use this combination of
`only_ways` and `extra_ways` to only run in GHCi ways and always run in
GHCi ways.
- - - - -
c06b534b by Matthew Pickering at 2025-10-03T06:06:40-04:00
Rename interpreterBackend to bytecodeBackend
This is preparation for creating bytecode files.
The "interpreter" is one way in which we can run bytecode objects. It is
more accurate to describe that the backend produces bytecode, rather
than the means by which the code will eventually run.
The "interpreterBackend" binding is left as a deprecated alias.
- - - - -
41bdb16f by Andreas Klebinger at 2025-10-06T18:04:34-04:00
Add a perf test for #26425
- - - - -
1da0c700 by Andreas Klebinger at 2025-10-06T18:05:14-04:00
Testsuite: Silence warnings about Wx-partial in concprog001
- - - - -
7471eb6a by sheaf at 2025-10-07T21:39:43-04:00
Improve how we detect user type errors in types
This commit cleans up all the code responsible for detecting whether a
type contains "TypeError msg" applications nested inside it. All the
logic is now in 'userTypeError_maybe', which is always deep. Whether
it looks inside type family applications is determined by the passed-in
boolean flag:
  - When deciding whether a constraint is definitely insoluble, don't
    look inside type family applications, as they may still reduce -- in
    which case the TypeError could disappear.
  - When reporting unsolved constraints, look inside type family
    applications: they had the chance to reduce but didn't, and the
    custom type error might contain valuable information.
All the details are explained in Note [Custom type errors in constraints]
in GHC.Tc.Types.Constraint.
Another benefit of this change is that it allows us to get rid of the
deeply dodgy 'getUserTypeErrorMsg' function.
This commit also improves the detection of custom type errors, for
example in equality constraints:
  TypeError blah ~# rhs
It used to be the case that we didn't detect the TypeError on the LHS,
because we never considered that equality constraints could be insoluble
due to the presence of custom type errors. Addressing this oversight
improves detection of redundant pattern match warnings, fixing #26400.
- - - - -
29955267 by Rodrigo Mesquita at 2025-10-07T21:40:25-04:00
cleanup: Drop obsolete settings from config.mk.in
These values used to be spliced into the bindist's `config.mk` s.t. when
`make` was run, the values were read and written into the bindist installation `settings` file.
However, we now carry these values to the bindist directly in the
default.target toolchain file, and `make` writes almost nothing to
`settings` now (see #26227)
The entries deleted in this MR were already unused.
Fixes #26478
- - - - -
f7adfed2 by ARATA Mizuki at 2025-10-08T08:37:24-04:00
T22033 is only relevant if the word size is 64-bit
Fixes #25497
- - - - -
ff1650c9 by Ben Gamari at 2025-10-08T08:38:07-04:00
rts/posix: Enforce iteration limit on heap reservation logic
Previously we could loop indefinitely when attempting to get an address
space reservation for our heap. Limit the logic to 8 iterations to
ensure we instead issue a reasonable error message.
Addresses #26151.
- - - - -
01844557 by Ben Gamari at 2025-10-08T08:38:07-04:00
rts/posix: Hold on to low reservations when reserving heap
Previously when the OS gave us an address space reservation in low
memory we would immediately release it and try again. However, on some
platforms this meant that we would get the same allocation again in the
next iteration (since mmap's `hint` argument is just that, a hint).
Instead we now hold on to low reservations until we have found a
suitable heap reservation.
Fixes #26151.
- - - - -
b2c8d052 by Sven Tennie at 2025-10-08T08:38:47-04:00
Build terminfo only in upper stages in cross-builds (#26288)
Currently, there's no way to provide library paths for [n]curses for
both - build and target - in cross-builds. As stage0 is only used to
build upper stages, it should be fine to build terminfo only for them.
This re-enables building cross-compilers with terminfo.
- - - - -
c58f9a61 by Julian Ospald at 2025-10-08T08:39:36-04:00
ghc-toolchain: Drop `ld.gold` from merge object command
It's deprecated.
Also see #25716
- - - - -
2b8baada by sheaf at 2025-10-08T18:23:37-04:00
Improvements to 'mayLookIdentical'
This commit makes significant improvements to the machinery that decides
when we should pretty-print the "invisible bits" of a type, such as:
  - kind applications, e.g. '@k' in 'Proxy @k ty'
  - RuntimeReps, e.g. 'TYPE r'
  - multiplicities and linear arrows 'a %1 -> b'
To do this, this commit refactors 'mayLookIdentical' to return **which**
of the invisible bits don't match up, e.g. in
  (a %1 -> b) ~ (a %Many -> b)
we find that the invisible bit that doesn't match up is a multiplicity,
so we should set 'sdocLinearTypes = True' when pretty-printing, and with
e.g.
  Proxy @k1 ~ Proxy @k2
we find that the invisible bit that doesn't match up is an invisible
TyCon argument, so we set 'sdocPrintExplicitKinds = True'.
We leverage these changes to remove the ad-hoc treatment of linearity
of data constructors with 'dataConDisplayType' and 'dataConNonLinearType'.
This is now handled by the machinery of 'pprWithInvisibleBits'.
Fixes #26335 #26340
- - - - -
129ce32d by sheaf at 2025-10-08T18:23:37-04:00
Store SDoc context in SourceError
This commits modifies the SourceError datatype which is used for
throwing and then reporting exceptions by storing all the info we need
to be able to print the SDoc, including whether we should print with
explicit kinds, explicit runtime-reps, etc.
This is done using the new datatype:
  data SourceErrorContext
    = SEC
        !DiagOpts
        !(DiagnosticOpts GhcMessage)
Now, when we come to report an error (by handling the exception), we
have access to the full context we need.
Fixes #26387
- - - - -
f9790ca8 by Ben Gamari at 2025-10-08T18:24:19-04:00
gitlab-ci: Make RELEASE_JOB an input
Rather than an undocumented variable.
- - - - -
8e2e19a7 by Andreas Klebinger at 2025-10-10T16:12:04+02:00
OccAnal: Be stricter.
* When combining usageDetails.
* When constructing core expressions.
In combineUsageDetails when combining the underlying adds we compute a
new `LocalOcc` for each entry by combining the two existing ones.
Rather than wait for those entries to be forced down the road we now
force them immediately. Speeding up T26425 by about 10% with little
effect on the common case.
We also force CoreExprs we construct in order to prevent them from
captuing the OccAnal Env massively reducing residency in some cases.
For T26425 residency went down by a factor of ~10x.
-------------------------
Metric Decrease:
    T26425
-------------------------
- - - - -
115 changed files:
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC.hs
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Data/Graph/UnVar.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Backend/Internal.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Env/Types.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Driver/Monad.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Utils/Unify.hs-boot
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Types/SourceError.hs
- compiler/GHC/Types/TyThing/Ppr.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Var/Env.hs
- compiler/GHC/Utils/Error.hs
- compiler/GHC/Utils/Outputable.hs
- docs/users_guide/extending_ghc.rst
- ghc/GHCi/UI.hs
- ghc/Main.hs
- hadrian/bindist/config.mk.in
- hadrian/src/Settings/Default.hs
- rts/posix/OSMem.c
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/tests/concurrent/prog001/all.T
- testsuite/tests/cpranal/should_compile/T18174.stderr
- testsuite/tests/driver/T11429c.stderr
- testsuite/tests/driver/T21682.stderr
- testsuite/tests/driver/T5313.hs
- testsuite/tests/ghc-api/T10052/T10052.hs
- testsuite/tests/ghc-api/T10942.hs
- testsuite/tests/ghc-api/T8639_api.hs
- testsuite/tests/ghc-api/annotations-literals/literals.hs
- testsuite/tests/ghc-api/apirecomp001/myghc.hs
- testsuite/tests/ghci-wasm/T26431.hs
- testsuite/tests/ghci/linking/dyn/T3372.hs
- testsuite/tests/ghci/should_run/PackedDataCon/packeddatacon.T
- testsuite/tests/ghci/should_run/UnboxedTuples/unboxedtuples.T
- testsuite/tests/ghci/should_run/UnliftedDataTypeInterp/unlifteddatatypeinterp.T
- testsuite/tests/indexed-types/should_fail/T14887.stderr
- testsuite/tests/linear/should_fail/T19361.stderr
- testsuite/tests/llvm/should_run/all.T
- + testsuite/tests/perf/compiler/T26425.hs
- testsuite/tests/perf/compiler/all.T
- + testsuite/tests/pmcheck/should_compile/T26400.hs
- + testsuite/tests/pmcheck/should_compile/T26400.stderr
- + testsuite/tests/pmcheck/should_compile/T26400b.hs
- testsuite/tests/pmcheck/should_compile/all.T
- testsuite/tests/roles/should_compile/Roles13.stderr
- testsuite/tests/simplCore/should_compile/OpaqueNoCastWW.stderr
- testsuite/tests/simplCore/should_compile/T17673.stderr
- testsuite/tests/simplCore/should_compile/T18078.stderr
- testsuite/tests/simplCore/should_compile/T18995.stderr
- testsuite/tests/simplCore/should_compile/T19890.stderr
- testsuite/tests/simplCore/should_compile/T21948.stderr
- testsuite/tests/simplCore/should_compile/T21960.stderr
- testsuite/tests/simplCore/should_compile/T24808.stderr
- − testsuite/tests/simplCore/should_compile/T25713.stderr
- testsuite/tests/simplCore/should_compile/T4201.stdout
- testsuite/tests/simplCore/should_compile/T8331.stderr
- testsuite/tests/typecheck/no_skolem_info/T20232.stderr
- testsuite/tests/typecheck/should_fail/T11672.stderr
- testsuite/tests/typecheck/should_fail/T12373.stderr
- testsuite/tests/typecheck/should_fail/T15807.stderr
- testsuite/tests/typecheck/should_fail/T16074.stderr
- testsuite/tests/typecheck/should_fail/T18357a.stderr
- testsuite/tests/typecheck/should_fail/T19627.stderr
- testsuite/tests/typecheck/should_fail/T20241b.stderr
- testsuite/tests/typecheck/should_fail/T21530a.stderr
- testsuite/tests/typecheck/should_fail/UnliftedNewtypesFamilyKindFail2.stderr
- testsuite/tests/typecheck/should_fail/VisFlag1.stderr
- utils/check-exact/Parsers.hs
- utils/check-exact/Preprocess.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/MergeObjs.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f2d549ece632573d1e36ee2c9b972…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3f2d549ece632573d1e36ee2c9b972…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/romes/26166-move-prims] Move code-gen aux symbols from ghc-internal to rts
                        
                        
by Rodrigo Mesquita (@alt-romes) 10 Oct '25
                    by Rodrigo Mesquita (@alt-romes) 10 Oct '25
10 Oct '25
                    
                        
Rodrigo Mesquita pushed to branch wip/romes/26166-move-prims at Glasgow Haskell Compiler / GHC
Commits:
480471cc by Rodrigo Mesquita at 2025-10-10T14:58:21+01:00
Move code-gen aux symbols from ghc-internal to rts
These symbols were all previously defined in ghc-internal and made the
dependency structure awkward, where the rts may refer to some of these
symbols and had to work around that circular dependency the way
described in #26166.
Moreover, the code generator will produce code that uses these symbols!
Therefore, they should be available in the rts:
PRINCIPLE: If the code generator may produce code which uses this
symbol, then it should be defined in the rts rather than, say,
ghc-internal.
That said, the main motivation is towards fixing #26166.
Towards #26166. Pre-requisite of !14892
- - - - -
19 changed files:
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- hadrian/src/Settings/Packages.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- rts/RtsSymbols.c
- rts/include/stg/Prim.h
- libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
- libraries/ghc-internal/cbits/bitrev.c → rts/prim/bitrev.c
- libraries/ghc-internal/cbits/bswap.c → rts/prim/bswap.c
- libraries/ghc-internal/cbits/clz.c → rts/prim/clz.c
- libraries/ghc-internal/cbits/ctz.c → rts/prim/ctz.c
- libraries/ghc-internal/cbits/int64x2minmax.c → rts/prim/int64x2minmax.c
- libraries/ghc-internal/cbits/longlong.c → rts/prim/longlong.c
- libraries/ghc-internal/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
- libraries/ghc-internal/cbits/pdep.c → rts/prim/pdep.c
- libraries/ghc-internal/cbits/pext.c → rts/prim/pext.c
- libraries/ghc-internal/cbits/popcnt.c → rts/prim/popcnt.c
- libraries/ghc-internal/cbits/vectorQuotRem.c → rts/prim/vectorQuotRem.c
- libraries/ghc-internal/cbits/word2float.c → rts/prim/word2float.c
- rts/rts.cabal
Changes:
=====================================
compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
=====================================
@@ -438,7 +438,7 @@ lower_MO_S_Shr lbl w0 [x, y] = case someWasmTypeFromCmmType (cmmBits w0) of
 lower_MO_S_Shr _ _ _ = panic "lower_MO_S_Shr: unreachable"
 
 -- | Lower a 'MO_MulMayOflo' operation. It's translated to a ccall to
--- @hs_mulIntMayOflo@ function in @ghc-prim/cbits/mulIntMayOflo@,
+-- @hs_mulIntMayOflo@ function in @rts/prim/mulIntMayOflo@,
 -- otherwise it's quite non-trivial to implement as inline assembly.
 lower_MO_MulMayOflo ::
   CLabel -> Width -> [CmmExpr] -> WasmCodeGenM w (SomeWasmExpr w)
=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -287,9 +287,6 @@ ghcInternalArgs = package ghcInternal ? do
 
           , builder (Cabal Flags) ? flag NeedLibatomic `cabalFlag` "need-atomic"
 
-          , builder (Cc CompileC) ? (not <$> flag CcLlvmBackend) ?
-              input "**/cbits/atomic.c"  ? arg "-Wno-sync-nand"
-
           ]
 
 -- | RTS-specific command line arguments.
@@ -413,6 +410,9 @@ rtsPackageArgs = package rts ? do
 
           , input "**/RetainerProfile.c" ? flag CcLlvmBackend ?
             arg "-Wno-incompatible-pointer-types"
+
+          , input "**/prim/atomic.c"  ? (not <$> flag CcLlvmBackend) ?
+            arg "-Wno-sync-nand"
           ]
 
     mconcat
=====================================
libraries/ghc-internal/ghc-internal.cabal.in
=====================================
@@ -442,20 +442,7 @@ Library
           cbits/sysconf.c
           cbits/fs.c
           cbits/strerror.c
-          cbits/atomic.c
-          cbits/bswap.c
-          cbits/bitrev.c
-          cbits/clz.c
-          cbits/ctz.c
           cbits/debug.c
-          cbits/int64x2minmax.c
-          cbits/longlong.c
-          cbits/mulIntMayOflo.c
-          cbits/pdep.c
-          cbits/pext.c
-          cbits/popcnt.c
-          cbits/vectorQuotRem.c
-          cbits/word2float.c
           cbits/Stack_c.c
 
       cmm-sources:
=====================================
rts/RtsSymbols.c
=====================================
@@ -1016,6 +1016,116 @@ extern char **environ;
 #define RTS_FINI_ARRAY_SYMBOLS
 #endif
 
+#define SymI_HasProtoAllSizes(symbol)                \
+      SymI_HasProto(symbol##8)                       \
+      SymI_HasProto(symbol##16)                      \
+      SymI_HasProto(symbol##32)                      \
+      SymI_HasProto(symbol##64)
+
+#if !defined(arm_HOST_ARCH)
+#define RTS_ATOMICS_SYMBOLS                          \
+      SymI_HasProtoAllSizes(hs_atomic_add)           \
+      SymI_HasProtoAllSizes(hs_atomic_sub)           \
+      SymI_HasProtoAllSizes(hs_atomic_and)           \
+      SymI_HasProtoAllSizes(hs_atomic_nand)          \
+      SymI_HasProtoAllSizes(hs_atomic_or)            \
+      SymI_HasProtoAllSizes(hs_atomic_xor)           \
+      SymI_HasProtoAllSizes(hs_cmpxchg)              \
+      SymI_HasProtoAllSizes(hs_xchg)                 \
+      SymI_HasProtoAllSizes(hs_atomicread)           \
+      SymI_HasProtoAllSizes(hs_atomicwrite)
+#else
+// No atomics on arm32. See e9abcad4cc3
+#define RTS_ATOMICS_SYMBOLS
+#endif
+
+// In rts/longlong.c
+#if WORD_SIZE_IN_BITS < 64
+#define RTS_SYMBOLS_LONGLONG                        \
+      SymI_HasProto(hs_eq64)                        \
+      SymI_HasProto(hs_ne64)                        \
+      SymI_HasProto(hs_gtWord64)                    \
+      SymI_HasProto(hs_geWord64)                    \
+      SymI_HasProto(hs_ltWord64)                    \
+      SymI_HasProto(hs_leWord64)                    \
+      SymI_HasProto(hs_gtInt64)                     \
+      SymI_HasProto(hs_geInt64)                     \
+      SymI_HasProto(hs_ltInt64)                     \
+      SymI_HasProto(hs_leInt64)                     \
+      SymI_HasProto(hs_neg64)                       \
+      SymI_HasProto(hs_add64)                       \
+      SymI_HasProto(hs_sub64)                       \
+      SymI_HasProto(hs_mul64)                       \
+      SymI_HasProto(hs_remWord64)                   \
+      SymI_HasProto(hs_quotWord64)                  \
+      SymI_HasProto(hs_remInt64)                    \
+      SymI_HasProto(hs_quotInt64)                   \
+      SymI_HasProto(hs_and64)                       \
+      SymI_HasProto(hs_or64)                        \
+      SymI_HasProto(hs_xor64)                       \
+      SymI_HasProto(hs_not64)                       \
+      SymI_HasProto(hs_uncheckedShiftL64)           \
+      SymI_HasProto(hs_uncheckedShiftRL64)          \
+      SymI_HasProto(hs_uncheckedIShiftRA64)         \
+      SymI_HasProto(hs_intToInt64)                  \
+      SymI_HasProto(hs_int64ToInt)                  \
+      SymI_HasProto(hs_wordToWord64)                \
+      SymI_HasProto(hs_word64ToWord)
+#else
+#define RTS_SYMBOLS_LONGLONG
+#endif
+
+// rts/prim/vectorQuotRem.c and rts/prim/int64x2minmax
+#if defined(__SSE2__)
+#define RTS_SYMBOLS_VECTORQUOTREM                    \
+      SymI_HasProto(hs_quotInt8X16)                  \
+      SymI_HasProto(hs_quotInt16X8)                  \
+      SymI_HasProto(hs_quotInt32X4)                  \
+      SymI_HasProto(hs_quotInt64X2)                  \
+      SymI_HasProto(hs_quotWord8X16)                 \
+      SymI_HasProto(hs_quotWord16X8)                 \
+      SymI_HasProto(hs_quotWord32X4)                 \
+      SymI_HasProto(hs_quotWord64X2)                 \
+      SymI_HasProto(hs_remInt8X16)                   \
+      SymI_HasProto(hs_remInt16X8)                   \
+      SymI_HasProto(hs_remInt32X4)                   \
+      SymI_HasProto(hs_remInt64X2)                   \
+      SymI_HasProto(hs_remWord8X16)                  \
+      SymI_HasProto(hs_remWord16X8)                  \
+      SymI_HasProto(hs_remWord32X4)                  \
+      SymI_HasProto(hs_remWord64X2)
+#define RTS_SYMBOLS_INT64X2MINMAX                    \
+      SymI_HasProto(hs_minInt64X2)                   \
+      SymI_HasProto(hs_maxInt64X2)                   \
+      SymI_HasProto(hs_minWord64X2)                  \
+      SymI_HasProto(hs_maxWord64X2)
+#else
+#define RTS_SYMBOLS_VECTORQUOTREM
+#define RTS_SYMBOLS_INT64X2MINMAX
+#endif
+
+// Symbols on files in rts/prim/*
+#define RTS_SYMBOLS_PRIM                             \
+      RTS_ATOMICS_SYMBOLS                            \
+      RTS_SYMBOLS_INT64X2MINMAX                      \
+      RTS_SYMBOLS_LONGLONG                           \
+      RTS_SYMBOLS_VECTORQUOTREM                      \
+      SymI_HasProtoAllSizes(hs_bitrev)               \
+      SymI_HasProto(hs_bswap16)                      \
+      SymI_HasProto(hs_bswap32)                      \
+      SymI_HasProto(hs_bswap64)                      \
+      SymI_HasProtoAllSizes(hs_clz)                  \
+      SymI_HasProtoAllSizes(hs_ctz)                  \
+      SymI_NeedsProto(hs_mulIntMayOflo)              \
+      SymI_HasProtoAllSizes(hs_pdep)                 \
+      SymI_HasProtoAllSizes(hs_pext)                 \
+      SymI_HasProtoAllSizes(hs_pext)                 \
+      SymI_HasProto(hs_popcnt)                       \
+      SymI_HasProtoAllSizes(hs_popcnt)               \
+      SymI_HasProto(hs_word2float32)                 \
+      SymI_HasProto(hs_word2float64)
+
+
 /* entirely bogus claims about types of these symbols */
 #define SymI_NeedsProto(vvv)  extern void vvv(void);
 #define SymI_NeedsDataProto(vvv)  extern StgWord vvv[];
@@ -1038,6 +1148,7 @@ RTS_ARCH_LIBGCC_SYMBOLS
 RTS_FINI_ARRAY_SYMBOLS
 RTS_LIBFFI_SYMBOLS
 RTS_ARM_OUTLINE_ATOMIC_SYMBOLS
+RTS_SYMBOLS_PRIM
 
 #undef SymI_NeedsProto
 #undef SymI_NeedsDataProto
@@ -1081,6 +1192,7 @@ RtsSymbolVal rtsSyms[] = {
       RTS_FINI_ARRAY_SYMBOLS
       RTS_LIBFFI_SYMBOLS
       RTS_ARM_OUTLINE_ATOMIC_SYMBOLS
+      RTS_SYMBOLS_PRIM
       SymI_HasDataProto(nonmoving_write_barrier_enabled)
       { 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE } /* sentinel */
 };
=====================================
rts/include/stg/Prim.h
=====================================
@@ -2,8 +2,6 @@
  *
  * (c) The GHC Team, 2014-2014
  *
- * Declarations for C fallback primitives implemented by 'ghc-internal' package.
- *
  * Do not #include this file directly: #include "Rts.h" instead.
  *
  * To understand the structure of the RTS headers, see the wiki:
@@ -13,7 +11,7 @@
 
 #pragma once
 
-/* libraries/ghc-internal/cbits/atomic.c */
+/* rts/prim/atomic.c */
 StgWord hs_atomic_add8(StgWord x, StgWord val);
 StgWord hs_atomic_add16(StgWord x, StgWord val);
 StgWord hs_atomic_add32(StgWord x, StgWord val);
@@ -55,12 +53,12 @@ StgWord hs_xchg16(StgWord x, StgWord val);
 StgWord hs_xchg32(StgWord x, StgWord val);
 StgWord64 hs_xchg64(StgWord x, StgWord64 val);
 
-/* libraries/ghc-internal/cbits/bswap.c */
+/* rts/prim/bswap.c */
 StgWord16 hs_bswap16(StgWord16 x);
 StgWord32 hs_bswap32(StgWord32 x);
 StgWord64 hs_bswap64(StgWord64 x);
 
-/* libraries/ghc-internal/cbits/bitrev.c
+/* rts/prim/bitrev.c
 This was done as part of issue #16164.
 See Note [Bit reversal primop] for more details about the implementation.*/
 StgWord hs_bitrev8(StgWord x);
@@ -68,7 +66,7 @@ StgWord16 hs_bitrev16(StgWord16 x);
 StgWord32 hs_bitrev32(StgWord32 x);
 StgWord64 hs_bitrev64(StgWord64 x);
 
-/* libraries/ghc-internal/cbits/longlong.c */
+/* rts/prim/longlong.c */
 #if WORD_SIZE_IN_BITS < 64
 StgInt hs_eq64 (StgWord64 a, StgWord64 b);
 StgInt hs_ne64 (StgWord64 a, StgWord64 b);
@@ -101,36 +99,36 @@ StgWord64 hs_wordToWord64  (StgWord   w);
 StgWord   hs_word64ToWord  (StgWord64 w);
 #endif
 
-/* libraries/ghc-internal/cbits/pdep.c */
+/* rts/prim/pdep.c */
 StgWord64 hs_pdep64(StgWord64 src, StgWord64 mask);
 StgWord hs_pdep32(StgWord src, StgWord mask);
 StgWord hs_pdep16(StgWord src, StgWord mask);
 StgWord hs_pdep8(StgWord src, StgWord mask);
 
-/* libraries/ghc-internal/cbits/pext.c */
+/* rts/prim/pext.c */
 StgWord64 hs_pext64(StgWord64 src, StgWord64 mask);
 StgWord hs_pext32(StgWord src, StgWord mask);
 StgWord hs_pext16(StgWord src, StgWord mask);
 StgWord hs_pext8(StgWord src, StgWord mask);
 
-/* libraries/ghc-internal/cbits/popcnt.c */
+/* rts/prim/popcnt.c */
 StgWord hs_popcnt8(StgWord x);
 StgWord hs_popcnt16(StgWord x);
 StgWord hs_popcnt32(StgWord x);
 StgWord hs_popcnt64(StgWord64 x);
 StgWord hs_popcnt(StgWord x);
 
-/* libraries/ghc-internal/cbits/word2float.c */
+/* rts/prim/word2float.c */
 StgFloat hs_word2float32(StgWord x);
 StgDouble hs_word2float64(StgWord x);
 
-/* libraries/ghc-internal/cbits/clz.c */
+/* rts/prim/clz.c */
 StgWord hs_clz8(StgWord x);
 StgWord hs_clz16(StgWord x);
 StgWord hs_clz32(StgWord x);
 StgWord hs_clz64(StgWord64 x);
 
-/* libraries/ghc-internal/cbits/ctz.c */
+/* rts/prim/ctz.c */
 StgWord hs_ctz8(StgWord x);
 StgWord hs_ctz16(StgWord x);
 StgWord hs_ctz32(StgWord x);
=====================================
libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
=====================================
@@ -12,90 +12,66 @@
 
 // FetchAddByteArrayOp_Int
 
-extern StgWord hs_atomic_add8(StgWord x, StgWord val);
-StgWord
-hs_atomic_add8(StgWord x, StgWord val)
+StgWord hs_atomic_add8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_add((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_add16(StgWord x, StgWord val);
-StgWord
-hs_atomic_add16(StgWord x, StgWord val)
+StgWord hs_atomic_add16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_add((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_add32(StgWord x, StgWord val);
-StgWord
-hs_atomic_add32(StgWord x, StgWord val)
+StgWord hs_atomic_add32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_add((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_add64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_add64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_add64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_add((volatile StgWord64 *) x, val);
 }
 
 // FetchSubByteArrayOp_Int
 
-extern StgWord hs_atomic_sub8(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub8(StgWord x, StgWord val)
+StgWord hs_atomic_sub8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_sub((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_sub16(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub16(StgWord x, StgWord val)
+StgWord hs_atomic_sub16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_sub((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_sub32(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub32(StgWord x, StgWord val)
+StgWord hs_atomic_sub32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_sub((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_sub64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_sub((volatile StgWord64 *) x, val);
 }
 
 // FetchAndByteArrayOp_Int
 
-extern StgWord hs_atomic_and8(StgWord x, StgWord val);
-StgWord
-hs_atomic_and8(StgWord x, StgWord val)
+StgWord hs_atomic_and8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_and((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_and16(StgWord x, StgWord val);
-StgWord
-hs_atomic_and16(StgWord x, StgWord val)
+StgWord hs_atomic_and16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_and((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_and32(StgWord x, StgWord val);
-StgWord
-hs_atomic_and32(StgWord x, StgWord val)
+StgWord hs_atomic_and32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_and((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_and64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_and64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_and64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_and((volatile StgWord64 *) x, val);
 }
@@ -167,9 +143,7 @@ hs_atomic_and64(StgWord x, StgWord64 val)
 #pragma GCC diagnostic ignored "-Wsync-nand"
 #endif
 
-extern StgWord hs_atomic_nand8(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand8(StgWord x, StgWord val)
+StgWord hs_atomic_nand8(StgWord x, StgWord val)
 {
 #if USE_SYNC_FETCH_AND_NAND
   return __sync_fetch_and_nand((volatile StgWord8 *) x, (StgWord8) val);
@@ -178,9 +152,7 @@ hs_atomic_nand8(StgWord x, StgWord val)
 #endif
 }
 
-extern StgWord hs_atomic_nand16(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand16(StgWord x, StgWord val)
+StgWord hs_atomic_nand16(StgWord x, StgWord val)
 {
 #if USE_SYNC_FETCH_AND_NAND
   return __sync_fetch_and_nand((volatile StgWord16 *) x, (StgWord16) val);
@@ -189,9 +161,7 @@ hs_atomic_nand16(StgWord x, StgWord val)
 #endif
 }
 
-extern StgWord hs_atomic_nand32(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand32(StgWord x, StgWord val)
+StgWord hs_atomic_nand32(StgWord x, StgWord val)
 {
 #if USE_SYNC_FETCH_AND_NAND
   return __sync_fetch_and_nand((volatile StgWord32 *) x, (StgWord32) val);
@@ -200,9 +170,7 @@ hs_atomic_nand32(StgWord x, StgWord val)
 #endif
 }
 
-extern StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_nand64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val)
 {
 #if USE_SYNC_FETCH_AND_NAND
   return __sync_fetch_and_nand((volatile StgWord64 *) x, val);
@@ -215,96 +183,72 @@ hs_atomic_nand64(StgWord x, StgWord64 val)
 
 // FetchOrByteArrayOp_Int
 
-extern StgWord hs_atomic_or8(StgWord x, StgWord val);
-StgWord
-hs_atomic_or8(StgWord x, StgWord val)
+StgWord hs_atomic_or8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_or((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_or16(StgWord x, StgWord val);
-StgWord
-hs_atomic_or16(StgWord x, StgWord val)
+StgWord hs_atomic_or16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_or((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_or32(StgWord x, StgWord val);
-StgWord
-hs_atomic_or32(StgWord x, StgWord val)
+StgWord hs_atomic_or32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_or((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_or64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_or64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_or64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_or((volatile StgWord64 *) x, val);
 }
 
 // FetchXorByteArrayOp_Int
 
-extern StgWord hs_atomic_xor8(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor8(StgWord x, StgWord val)
+StgWord hs_atomic_xor8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_xor((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_xor16(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor16(StgWord x, StgWord val)
+StgWord hs_atomic_xor16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_xor((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_xor32(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor32(StgWord x, StgWord val)
+StgWord hs_atomic_xor32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_xor((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_xor64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_xor((volatile StgWord64 *) x, val);
 }
 
 // CasByteArrayOp_Int
 
-extern StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg8(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new)
 {
   StgWord8 expected = (StgWord8) old;
   __atomic_compare_exchange_n((StgWord8 *) x, &expected, (StgWord8) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
   return expected;
 }
 
-extern StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg16(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new)
 {
   StgWord16 expected = (StgWord16) old;
   __atomic_compare_exchange_n((StgWord16 *) x, &expected, (StgWord16) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
   return expected;
 }
 
-extern StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg32(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new)
 {
   StgWord32 expected = (StgWord32) old;
   __atomic_compare_exchange_n((StgWord32 *) x, &expected, (StgWord32) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
   return expected;
 }
 
-extern StgWord64 hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new);
-StgWord64
-hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
+StgWord64 hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
 {
   StgWord64 expected = (StgWord64) old;
   __atomic_compare_exchange_n((StgWord64 *) x, &expected, (StgWord64) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
@@ -313,31 +257,23 @@ hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
 
 // Atomic exchange operations
 
-extern StgWord hs_xchg8(StgWord x, StgWord val);
-StgWord
-hs_xchg8(StgWord x, StgWord val)
+StgWord hs_xchg8(StgWord x, StgWord val)
 {
   return (StgWord) __atomic_exchange_n((StgWord8 *) x, (StgWord8) val, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord hs_xchg16(StgWord x, StgWord val);
-StgWord
-hs_xchg16(StgWord x, StgWord val)
+StgWord hs_xchg16(StgWord x, StgWord val)
 {
   return (StgWord) __atomic_exchange_n((StgWord16 *)x, (StgWord16) val, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord hs_xchg32(StgWord x, StgWord val);
-StgWord
-hs_xchg32(StgWord x, StgWord val)
+StgWord hs_xchg32(StgWord x, StgWord val)
 {
   return (StgWord) __atomic_exchange_n((StgWord32 *) x, (StgWord32) val, __ATOMIC_SEQ_CST);
 }
 
 //GCC provides this even on 32bit, but StgWord is still 32 bits.
-extern StgWord64 hs_xchg64(StgWord x, StgWord64 val);
-StgWord64
-hs_xchg64(StgWord x, StgWord64 val)
+StgWord64 hs_xchg64(StgWord x, StgWord64 val)
 {
   return (StgWord64) __atomic_exchange_n((StgWord64 *) x, (StgWord64) val, __ATOMIC_SEQ_CST);
 }
@@ -352,30 +288,22 @@ hs_xchg64(StgWord x, StgWord64 val)
 // primitives which the GCC documentation claims "usually" implies a full
 // barrier.
 
-extern StgWord hs_atomicread8(StgWord x);
-StgWord
-hs_atomicread8(StgWord x)
+StgWord hs_atomicread8(StgWord x)
 {
   return __atomic_load_n((StgWord8 *) x, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord hs_atomicread16(StgWord x);
-StgWord
-hs_atomicread16(StgWord x)
+StgWord hs_atomicread16(StgWord x)
 {
   return __atomic_load_n((StgWord16 *) x, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord hs_atomicread32(StgWord x);
-StgWord
-hs_atomicread32(StgWord x)
+StgWord hs_atomicread32(StgWord x)
 {
   return __atomic_load_n((StgWord32 *) x, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord64 hs_atomicread64(StgWord x);
-StgWord64
-hs_atomicread64(StgWord x)
+StgWord64 hs_atomicread64(StgWord x)
 {
   return __atomic_load_n((StgWord64 *) x, __ATOMIC_SEQ_CST);
 }
@@ -384,30 +312,22 @@ hs_atomicread64(StgWord x)
 // Implies a full memory barrier (see compiler/GHC/Builtin/primops.txt.pp)
 // __ATOMIC_SEQ_CST: Full barrier (see hs_atomicread8 above).
 
-extern void hs_atomicwrite8(StgWord x, StgWord val);
-void
-hs_atomicwrite8(StgWord x, StgWord val)
+void hs_atomicwrite8(StgWord x, StgWord val)
 {
   __atomic_store_n((StgWord8 *) x, (StgWord8) val, __ATOMIC_SEQ_CST);
 }
 
-extern void hs_atomicwrite16(StgWord x, StgWord val);
-void
-hs_atomicwrite16(StgWord x, StgWord val)
+void hs_atomicwrite16(StgWord x, StgWord val)
 {
   __atomic_store_n((StgWord16 *) x, (StgWord16) val, __ATOMIC_SEQ_CST);
 }
 
-extern void hs_atomicwrite32(StgWord x, StgWord val);
-void
-hs_atomicwrite32(StgWord x, StgWord val)
+void hs_atomicwrite32(StgWord x, StgWord val)
 {
   __atomic_store_n((StgWord32 *) x, (StgWord32) val, __ATOMIC_SEQ_CST);
 }
 
-extern void hs_atomicwrite64(StgWord x, StgWord64 val);
-void
-hs_atomicwrite64(StgWord x, StgWord64 val)
+void hs_atomicwrite64(StgWord x, StgWord64 val)
 {
   __atomic_store_n((StgWord64 *) x, (StgWord64) val, __ATOMIC_SEQ_CST);
 }
=====================================
libraries/ghc-internal/cbits/bitrev.c → rts/prim/bitrev.c
=====================================
=====================================
libraries/ghc-internal/cbits/bswap.c → rts/prim/bswap.c
=====================================
=====================================
libraries/ghc-internal/cbits/clz.c → rts/prim/clz.c
=====================================
=====================================
libraries/ghc-internal/cbits/ctz.c → rts/prim/ctz.c
=====================================
=====================================
libraries/ghc-internal/cbits/int64x2minmax.c → rts/prim/int64x2minmax.c
=====================================
=====================================
libraries/ghc-internal/cbits/longlong.c → rts/prim/longlong.c
=====================================
=====================================
libraries/ghc-internal/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
=====================================
=====================================
libraries/ghc-internal/cbits/pdep.c → rts/prim/pdep.c
=====================================
=====================================
libraries/ghc-internal/cbits/pext.c → rts/prim/pext.c
=====================================
=====================================
libraries/ghc-internal/cbits/popcnt.c → rts/prim/popcnt.c
=====================================
=====================================
libraries/ghc-internal/cbits/vectorQuotRem.c → rts/prim/vectorQuotRem.c
=====================================
=====================================
libraries/ghc-internal/cbits/word2float.c → rts/prim/word2float.c
=====================================
=====================================
rts/rts.cabal
=====================================
@@ -529,6 +529,19 @@ library
                  sm/Storage.c
                  sm/Sweep.c
                  fs.c
+                 prim/atomic.c
+                 prim/bitrev.c
+                 prim/bswap.c
+                 prim/clz.c
+                 prim/ctz.c
+                 prim/int64x2minmax.c
+                 prim/longlong.c
+                 prim/mulIntMayOflo.c
+                 prim/pdep.c
+                 prim/pext.c
+                 prim/popcnt.c
+                 prim/vectorQuotRem.c
+                 prim/word2float.c
                  -- I wish we had wildcards..., this would be:
                  -- *.c hooks/**/*.c sm/**/*.c eventlog/**/*.c linker/**/*.c
 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/480471cc326c4ad3e15bdf6b8e50e10…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/480471cc326c4ad3e15bdf6b8e50e10…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/T26166] 2 commits: Move code-gen aux symbols from ghc-internal to rts
                        
                        
by Rodrigo Mesquita (@alt-romes) 10 Oct '25
                    by Rodrigo Mesquita (@alt-romes) 10 Oct '25
10 Oct '25
                    
                        
Rodrigo Mesquita pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC
Commits:
480471cc by Rodrigo Mesquita at 2025-10-10T14:58:21+01:00
Move code-gen aux symbols from ghc-internal to rts
These symbols were all previously defined in ghc-internal and made the
dependency structure awkward, where the rts may refer to some of these
symbols and had to work around that circular dependency the way
described in #26166.
Moreover, the code generator will produce code that uses these symbols!
Therefore, they should be available in the rts:
PRINCIPLE: If the code generator may produce code which uses this
symbol, then it should be defined in the rts rather than, say,
ghc-internal.
That said, the main motivation is towards fixing #26166.
Towards #26166. Pre-requisite of !14892
- - - - -
b2a6c0b9 by Ben Gamari at 2025-10-10T14:58:21+01:00
rts: Avoid static symbol references to ghc-internal
This resolves #26166, a bug due to new constraints placed by Apple's
linker on undefined references.
One source of such references in the RTS is the many symbols referenced
in ghc-internal. To mitigate #26166, we make these references dynamic,
as described in Note [RTS/ghc-internal interface].
Fixes #26166
Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita(a)gmail.com>
- - - - -
45 changed files:
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Linker/Static.hs
- hadrian/src/Settings/Packages.hs
- + libraries/ghc-internal/cbits/RtsIface.c
- libraries/ghc-internal/ghc-internal.cabal.in
- + libraries/ghc-internal/include/RtsIfaceSymbols.h
- rts/BuiltinClosures.c
- rts/CloneStack.h
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Prelude.h
- rts/PrimOps.cmm
- rts/RtsAPI.c
- rts/RtsStartup.c
- rts/RtsSymbols.c
- + rts/RtsToHsIface.c
- rts/Schedule.c
- rts/StgStdThunks.cmm
- rts/configure.ac
- − rts/external-symbols.list.in
- rts/include/Rts.h
- rts/include/RtsAPI.h
- + rts/include/rts/RtsToHsIface.h
- rts/include/stg/Prim.h
- rts/posix/Signals.c
- libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
- libraries/ghc-internal/cbits/bitrev.c → rts/prim/bitrev.c
- libraries/ghc-internal/cbits/bswap.c → rts/prim/bswap.c
- libraries/ghc-internal/cbits/clz.c → rts/prim/clz.c
- libraries/ghc-internal/cbits/ctz.c → rts/prim/ctz.c
- libraries/ghc-internal/cbits/int64x2minmax.c → rts/prim/int64x2minmax.c
- libraries/ghc-internal/cbits/longlong.c → rts/prim/longlong.c
- libraries/ghc-internal/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
- libraries/ghc-internal/cbits/pdep.c → rts/prim/pdep.c
- libraries/ghc-internal/cbits/pext.c → rts/prim/pext.c
- libraries/ghc-internal/cbits/popcnt.c → rts/prim/popcnt.c
- libraries/ghc-internal/cbits/vectorQuotRem.c → rts/prim/vectorQuotRem.c
- libraries/ghc-internal/cbits/word2float.c → rts/prim/word2float.c
- − rts/rts.buildinfo.in
- rts/rts.cabal
- rts/wasm/JSFFI.c
- utils/deriveConstants/Main.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3d6f1bfc305187aa44cd21591f49aa…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3d6f1bfc305187aa44cd21591f49aa…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/T26166] 2 commits: Move code-gen aux symbols from ghc-internal to rts
                        
                        
by Rodrigo Mesquita (@alt-romes) 10 Oct '25
                    by Rodrigo Mesquita (@alt-romes) 10 Oct '25
10 Oct '25
                    
                        
Rodrigo Mesquita pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC
Commits:
2e1c436e by Rodrigo Mesquita at 2025-10-10T14:33:06+01:00
Move code-gen aux symbols from ghc-internal to rts
These symbols were all previously defined in ghc-internal and made the
dependency structure awkward, where the rts may refer to some of these
symbols and had to work around that circular dependency the way
described in #26166.
Moreover, the code generator will produce code that uses these symbols!
Therefore, they should be available in the rts:
PRINCIPLE: If the code generator may produce code which uses this
symbol, then it should be defined in the rts rather than, say,
ghc-internal.
That said, the main motivation is towards fixing #26166.
Towards #26166. Pre-requisite of !14892
- - - - -
3d6f1bfc by Ben Gamari at 2025-10-10T14:33:06+01:00
rts: Avoid static symbol references to ghc-internal
This resolves #26166, a bug due to new constraints placed by Apple's
linker on undefined references.
One source of such references in the RTS is the many symbols referenced
in ghc-internal. To mitigate #26166, we make these references dynamic,
as described in Note [RTS/ghc-internal interface].
Fixes #26166
Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita(a)gmail.com>
- - - - -
44 changed files:
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Linker/Static.hs
- hadrian/src/Settings/Packages.hs
- + libraries/ghc-internal/cbits/RtsIface.c
- libraries/ghc-internal/ghc-internal.cabal.in
- + libraries/ghc-internal/include/RtsIfaceSymbols.h
- rts/BuiltinClosures.c
- rts/CloneStack.h
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Prelude.h
- rts/PrimOps.cmm
- rts/RtsAPI.c
- rts/RtsStartup.c
- rts/RtsSymbols.c
- + rts/RtsToHsIface.c
- rts/Schedule.c
- rts/StgStdThunks.cmm
- rts/configure.ac
- − rts/external-symbols.list.in
- rts/include/Rts.h
- rts/include/RtsAPI.h
- + rts/include/rts/RtsToHsIface.h
- rts/include/stg/Prim.h
- rts/posix/Signals.c
- libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
- libraries/ghc-internal/cbits/bitrev.c → rts/prim/bitrev.c
- libraries/ghc-internal/cbits/bswap.c → rts/prim/bswap.c
- libraries/ghc-internal/cbits/clz.c → rts/prim/clz.c
- libraries/ghc-internal/cbits/ctz.c → rts/prim/ctz.c
- libraries/ghc-internal/cbits/int64x2minmax.c → rts/prim/int64x2minmax.c
- libraries/ghc-internal/cbits/longlong.c → rts/prim/longlong.c
- libraries/ghc-internal/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
- libraries/ghc-internal/cbits/pdep.c → rts/prim/pdep.c
- libraries/ghc-internal/cbits/pext.c → rts/prim/pext.c
- libraries/ghc-internal/cbits/popcnt.c → rts/prim/popcnt.c
- libraries/ghc-internal/cbits/vectorQuotRem.c → rts/prim/vectorQuotRem.c
- libraries/ghc-internal/cbits/word2float.c → rts/prim/word2float.c
- − rts/rts.buildinfo.in
- rts/rts.cabal
- rts/wasm/JSFFI.c
- utils/deriveConstants/Main.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/03f6b9307fcb22620789e6b333f043…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/03f6b9307fcb22620789e6b333f043…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/T26166] 2 commits: Move code-gen aux symbols from ghc-internal to rts
                        
                        
by Rodrigo Mesquita (@alt-romes) 10 Oct '25
                    by Rodrigo Mesquita (@alt-romes) 10 Oct '25
10 Oct '25
                    
                        
Rodrigo Mesquita pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC
Commits:
35ea01fa by Rodrigo Mesquita at 2025-10-10T14:25:05+01:00
Move code-gen aux symbols from ghc-internal to rts
These symbols were all previously defined in ghc-internal and made the
dependency structure awkward, where the rts may refer to some of these
symbols and had to work around that circular dependency the way
described in #26166.
Moreover, the code generator will produce code that uses these symbols!
Therefore, they should be available in the rts:
PRINCIPLE: If the code generator may produce code which uses this
symbol, then it should be defined in the rts rather than, say,
ghc-internal.
That said, the main motivation is towards fixing #26166.
Towards #26166. Pre-requisite of !14892
- - - - -
03f6b930 by Ben Gamari at 2025-10-10T14:25:05+01:00
rts: Avoid static symbol references to ghc-internal
This resolves #26166, a bug due to new constraints placed by Apple's
linker on undefined references.
One source of such references in the RTS is the many symbols referenced
in ghc-internal. To mitigate #26166, we make these references dynamic,
as described in Note [RTS/ghc-internal interface].
Fixes #26166
Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita(a)gmail.com>
- - - - -
44 changed files:
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Linker/Static.hs
- hadrian/src/Settings/Packages.hs
- + libraries/ghc-internal/cbits/RtsIface.c
- libraries/ghc-internal/ghc-internal.cabal.in
- + libraries/ghc-internal/include/RtsIfaceSymbols.h
- rts/BuiltinClosures.c
- rts/CloneStack.h
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Prelude.h
- rts/PrimOps.cmm
- rts/RtsAPI.c
- rts/RtsStartup.c
- rts/RtsSymbols.c
- + rts/RtsToHsIface.c
- rts/Schedule.c
- rts/StgStdThunks.cmm
- rts/configure.ac
- − rts/external-symbols.list.in
- rts/include/Rts.h
- rts/include/RtsAPI.h
- + rts/include/rts/RtsToHsIface.h
- rts/include/stg/Prim.h
- rts/posix/Signals.c
- libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
- libraries/ghc-internal/cbits/bitrev.c → rts/prim/bitrev.c
- libraries/ghc-internal/cbits/bswap.c → rts/prim/bswap.c
- libraries/ghc-internal/cbits/clz.c → rts/prim/clz.c
- libraries/ghc-internal/cbits/ctz.c → rts/prim/ctz.c
- libraries/ghc-internal/cbits/int64x2minmax.c → rts/prim/int64x2minmax.c
- libraries/ghc-internal/cbits/longlong.c → rts/prim/longlong.c
- libraries/ghc-internal/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
- libraries/ghc-internal/cbits/pdep.c → rts/prim/pdep.c
- libraries/ghc-internal/cbits/pext.c → rts/prim/pext.c
- libraries/ghc-internal/cbits/popcnt.c → rts/prim/popcnt.c
- libraries/ghc-internal/cbits/vectorQuotRem.c → rts/prim/vectorQuotRem.c
- libraries/ghc-internal/cbits/word2float.c → rts/prim/word2float.c
- − rts/rts.buildinfo.in
- rts/rts.cabal
- rts/wasm/JSFFI.c
- utils/deriveConstants/Main.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0a23708b6283c6e46dadb3d94e83b1…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0a23708b6283c6e46dadb3d94e83b1…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/T26166] 2 commits: Move code-gen aux symbols from ghc-internal to rts
                        
                        
by Rodrigo Mesquita (@alt-romes) 10 Oct '25
                    by Rodrigo Mesquita (@alt-romes) 10 Oct '25
10 Oct '25
                    
                        
Rodrigo Mesquita pushed to branch wip/T26166 at Glasgow Haskell Compiler / GHC
Commits:
1e62b9c9 by Rodrigo Mesquita at 2025-10-10T13:34:53+01:00
Move code-gen aux symbols from ghc-internal to rts
These symbols were all previously defined in ghc-internal and made the
dependency structure awkward, where the rts may refer to some of these
symbols and had to work around that circular dependency the way
described in #26166.
Moreover, the code generator will produce code that uses these symbols!
Therefore, they should be available in the rts:
PRINCIPLE: If the code generator may produce code which uses this
symbol, then it should be defined in the rts rather than, say,
ghc-internal.
That said, the main motivation is towards fixing #26166.
Towards #26166. Pre-requisite of !14892
- - - - -
0a23708b by Ben Gamari at 2025-10-10T14:23:37+01:00
rts: Avoid static symbol references to ghc-internal
This resolves #26166, a bug due to new constraints placed by Apple's
linker on undefined references.
One source of such references in the RTS is the many symbols referenced
in ghc-internal. To mitigate #26166, we make these references dynamic,
as described in Note [RTS/ghc-internal interface].
Fixes #26166
Co-authored-by: Rodrigo Mesquita <rodrigo.m.mesquita(a)gmail.com>
- - - - -
44 changed files:
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/Linker/Static.hs
- hadrian/src/Settings/Packages.hs
- + libraries/ghc-internal/cbits/RtsIface.c
- libraries/ghc-internal/ghc-internal.cabal.in
- + libraries/ghc-internal/include/RtsIfaceSymbols.h
- rts/BuiltinClosures.c
- rts/CloneStack.h
- rts/Compact.cmm
- rts/ContinuationOps.cmm
- rts/Exception.cmm
- rts/Prelude.h
- rts/PrimOps.cmm
- rts/RtsAPI.c
- rts/RtsStartup.c
- rts/RtsSymbols.c
- + rts/RtsToHsIface.c
- rts/Schedule.c
- rts/StgStdThunks.cmm
- rts/configure.ac
- − rts/external-symbols.list.in
- rts/include/Rts.h
- rts/include/RtsAPI.h
- + rts/include/rts/RtsToHsIface.h
- rts/include/stg/Prim.h
- rts/posix/Signals.c
- libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
- libraries/ghc-internal/cbits/bitrev.c → rts/prim/bitrev.c
- libraries/ghc-internal/cbits/bswap.c → rts/prim/bswap.c
- libraries/ghc-internal/cbits/clz.c → rts/prim/clz.c
- libraries/ghc-internal/cbits/ctz.c → rts/prim/ctz.c
- libraries/ghc-internal/cbits/int64x2minmax.c → rts/prim/int64x2minmax.c
- libraries/ghc-internal/cbits/longlong.c → rts/prim/longlong.c
- libraries/ghc-internal/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
- libraries/ghc-internal/cbits/pdep.c → rts/prim/pdep.c
- libraries/ghc-internal/cbits/pext.c → rts/prim/pext.c
- libraries/ghc-internal/cbits/popcnt.c → rts/prim/popcnt.c
- libraries/ghc-internal/cbits/vectorQuotRem.c → rts/prim/vectorQuotRem.c
- libraries/ghc-internal/cbits/word2float.c → rts/prim/word2float.c
- − rts/rts.buildinfo.in
- rts/rts.cabal
- rts/wasm/JSFFI.c
- utils/deriveConstants/Main.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b58f7922b5ea74aa60854dcf329b2c…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b58f7922b5ea74aa60854dcf329b2c…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/gbc-files] 13 commits: Add a perf test for #26425
                        
                        
by Matthew Pickering (@mpickering) 10 Oct '25
                    by Matthew Pickering (@mpickering) 10 Oct '25
10 Oct '25
                    
                        
Matthew Pickering pushed to branch wip/gbc-files at Glasgow Haskell Compiler / GHC
Commits:
41bdb16f by Andreas Klebinger at 2025-10-06T18:04:34-04:00
Add a perf test for #26425
- - - - -
1da0c700 by Andreas Klebinger at 2025-10-06T18:05:14-04:00
Testsuite: Silence warnings about Wx-partial in concprog001
- - - - -
7471eb6a by sheaf at 2025-10-07T21:39:43-04:00
Improve how we detect user type errors in types
This commit cleans up all the code responsible for detecting whether a
type contains "TypeError msg" applications nested inside it. All the
logic is now in 'userTypeError_maybe', which is always deep. Whether
it looks inside type family applications is determined by the passed-in
boolean flag:
  - When deciding whether a constraint is definitely insoluble, don't
    look inside type family applications, as they may still reduce -- in
    which case the TypeError could disappear.
  - When reporting unsolved constraints, look inside type family
    applications: they had the chance to reduce but didn't, and the
    custom type error might contain valuable information.
All the details are explained in Note [Custom type errors in constraints]
in GHC.Tc.Types.Constraint.
Another benefit of this change is that it allows us to get rid of the
deeply dodgy 'getUserTypeErrorMsg' function.
This commit also improves the detection of custom type errors, for
example in equality constraints:
  TypeError blah ~# rhs
It used to be the case that we didn't detect the TypeError on the LHS,
because we never considered that equality constraints could be insoluble
due to the presence of custom type errors. Addressing this oversight
improves detection of redundant pattern match warnings, fixing #26400.
- - - - -
29955267 by Rodrigo Mesquita at 2025-10-07T21:40:25-04:00
cleanup: Drop obsolete settings from config.mk.in
These values used to be spliced into the bindist's `config.mk` s.t. when
`make` was run, the values were read and written into the bindist installation `settings` file.
However, we now carry these values to the bindist directly in the
default.target toolchain file, and `make` writes almost nothing to
`settings` now (see #26227)
The entries deleted in this MR were already unused.
Fixes #26478
- - - - -
f7adfed2 by ARATA Mizuki at 2025-10-08T08:37:24-04:00
T22033 is only relevant if the word size is 64-bit
Fixes #25497
- - - - -
ff1650c9 by Ben Gamari at 2025-10-08T08:38:07-04:00
rts/posix: Enforce iteration limit on heap reservation logic
Previously we could loop indefinitely when attempting to get an address
space reservation for our heap. Limit the logic to 8 iterations to
ensure we instead issue a reasonable error message.
Addresses #26151.
- - - - -
01844557 by Ben Gamari at 2025-10-08T08:38:07-04:00
rts/posix: Hold on to low reservations when reserving heap
Previously when the OS gave us an address space reservation in low
memory we would immediately release it and try again. However, on some
platforms this meant that we would get the same allocation again in the
next iteration (since mmap's `hint` argument is just that, a hint).
Instead we now hold on to low reservations until we have found a
suitable heap reservation.
Fixes #26151.
- - - - -
b2c8d052 by Sven Tennie at 2025-10-08T08:38:47-04:00
Build terminfo only in upper stages in cross-builds (#26288)
Currently, there's no way to provide library paths for [n]curses for
both - build and target - in cross-builds. As stage0 is only used to
build upper stages, it should be fine to build terminfo only for them.
This re-enables building cross-compilers with terminfo.
- - - - -
c58f9a61 by Julian Ospald at 2025-10-08T08:39:36-04:00
ghc-toolchain: Drop `ld.gold` from merge object command
It's deprecated.
Also see #25716
- - - - -
2b8baada by sheaf at 2025-10-08T18:23:37-04:00
Improvements to 'mayLookIdentical'
This commit makes significant improvements to the machinery that decides
when we should pretty-print the "invisible bits" of a type, such as:
  - kind applications, e.g. '@k' in 'Proxy @k ty'
  - RuntimeReps, e.g. 'TYPE r'
  - multiplicities and linear arrows 'a %1 -> b'
To do this, this commit refactors 'mayLookIdentical' to return **which**
of the invisible bits don't match up, e.g. in
  (a %1 -> b) ~ (a %Many -> b)
we find that the invisible bit that doesn't match up is a multiplicity,
so we should set 'sdocLinearTypes = True' when pretty-printing, and with
e.g.
  Proxy @k1 ~ Proxy @k2
we find that the invisible bit that doesn't match up is an invisible
TyCon argument, so we set 'sdocPrintExplicitKinds = True'.
We leverage these changes to remove the ad-hoc treatment of linearity
of data constructors with 'dataConDisplayType' and 'dataConNonLinearType'.
This is now handled by the machinery of 'pprWithInvisibleBits'.
Fixes #26335 #26340
- - - - -
129ce32d by sheaf at 2025-10-08T18:23:37-04:00
Store SDoc context in SourceError
This commits modifies the SourceError datatype which is used for
throwing and then reporting exceptions by storing all the info we need
to be able to print the SDoc, including whether we should print with
explicit kinds, explicit runtime-reps, etc.
This is done using the new datatype:
  data SourceErrorContext
    = SEC
        !DiagOpts
        !(DiagnosticOpts GhcMessage)
Now, when we come to report an error (by handling the exception), we
have access to the full context we need.
Fixes #26387
- - - - -
f9790ca8 by Ben Gamari at 2025-10-08T18:24:19-04:00
gitlab-ci: Make RELEASE_JOB an input
Rather than an undocumented variable.
- - - - -
e689e516 by Matthew Pickering at 2025-10-10T09:44:34+01:00
Add support for generating bytecode objects
This commit adds the `-fwrite-byte-code` option which makes GHC emit a
`.gbc` file which contains a serialised representation of bytecode.
The bytecode can be loaded by the compiler to avoid having to
reinterpret a module when using the bytecode interpreter (for example,
in GHCi).
There are also the new options:
* -gbcdir=<DIR>: Specify the directory to place the gbc files
* -gbcsuf=<suffix>: Specify the suffix for gbc files
The option `-fbyte-code-and-object-code` now implies
`-fwrite-byte-code`.
These performance tests fail due to https://github.com/haskell/directory/issues/204
-------------------------
Metric Increase:
    MultiComponentModules
    MultiLayerModules
    MultiComponentModulesRecomp
    MultiLayerModulesRecomp
    MultiLayerModulesTH_Make
    MultiLayerModulesTH_OneShot
    T13701
-------------------------
The bytecode serialisation part was implemented by Cheng Shao
Co-authored-by: Cheng Shao <terrorjack(a)type.dance>
- - - - -
155 changed files:
- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/ByteCode/Breakpoints.hs
- + compiler/GHC/ByteCode/Serialize.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Core/Multiplicity.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Data/FlatBag.hs
- compiler/GHC/Data/SmallArray.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Backpack.hs
- + compiler/GHC/Driver/ByteCode.hs
- compiler/GHC/Driver/Config/Finder.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Env/Types.hs
- compiler/GHC/Driver/Errors.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Driver/Messager.hs
- compiler/GHC/Driver/Monad.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- compiler/GHC/HsToCore/Usage.hs
- compiler/GHC/Iface/Decl.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Type.hs
- compiler/GHC/Linker/Deps.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Linker/Types.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Utils/Unify.hs-boot
- compiler/GHC/Tc/Validity.hs
- compiler/GHC/Types/SourceError.hs
- compiler/GHC/Types/SptEntry.hs
- compiler/GHC/Types/Tickish.hs
- compiler/GHC/Types/TyThing/Ppr.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Finder/Types.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/Location.hs
- compiler/GHC/Unit/Module/ModSummary.hs
- compiler/GHC/Unit/Module/WholeCoreBindings.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Error.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/ghc.cabal.in
- docs/users_guide/phases.rst
- docs/users_guide/separate_compilation.rst
- ghc/GHCi/UI.hs
- hadrian/bindist/config.mk.in
- hadrian/src/Settings/Default.hs
- rts/posix/OSMem.c
- testsuite/tests/bytecode/T24634/T24634a.stdout
- testsuite/tests/bytecode/T24634/T24634b.stdout
- testsuite/tests/concurrent/prog001/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/cpranal/should_compile/T18174.stderr
- testsuite/tests/driver/T11429c.stderr
- testsuite/tests/driver/T21682.stderr
- + testsuite/tests/driver/bytecode-object/A.hs
- + testsuite/tests/driver/bytecode-object/BytecodeForeign.c
- + testsuite/tests/driver/bytecode-object/BytecodeForeign.hs
- + testsuite/tests/driver/bytecode-object/BytecodeMain.hs
- + testsuite/tests/driver/bytecode-object/BytecodeTest.hs
- + testsuite/tests/driver/bytecode-object/Makefile
- + testsuite/tests/driver/bytecode-object/all.T
- + testsuite/tests/driver/bytecode-object/bytecode_object12.stderr
- + testsuite/tests/driver/bytecode-object/bytecode_object13.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object14.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object15.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object16.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object17.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object18.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object19.script
- + testsuite/tests/driver/bytecode-object/bytecode_object19.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object25.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object4.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object5.stdout
- + testsuite/tests/driver/bytecode-object/bytecode_object6.stdout
- testsuite/tests/driver/fat-iface/T22405/T22405.stdout
- testsuite/tests/driver/fat-iface/T22405/T22405b.stdout
- testsuite/tests/driver/fat-iface/fat011.stderr
- testsuite/tests/ghc-api/T10942.hs
- testsuite/tests/ghc-api/annotations-literals/literals.hs
- testsuite/tests/indexed-types/should_fail/T14887.stderr
- testsuite/tests/linear/should_fail/T19361.stderr
- testsuite/tests/llvm/should_run/all.T
- testsuite/tests/perf/compiler/Makefile
- + testsuite/tests/perf/compiler/MultiLayerModulesDefsGhciWithBytecodeFiles.script
- + testsuite/tests/perf/compiler/T26425.hs
- testsuite/tests/perf/compiler/all.T
- + testsuite/tests/pmcheck/should_compile/T26400.hs
- + testsuite/tests/pmcheck/should_compile/T26400.stderr
- + testsuite/tests/pmcheck/should_compile/T26400b.hs
- testsuite/tests/pmcheck/should_compile/all.T
- testsuite/tests/roles/should_compile/Roles13.stderr
- testsuite/tests/simplCore/should_compile/OpaqueNoCastWW.stderr
- testsuite/tests/simplCore/should_compile/T17673.stderr
- testsuite/tests/simplCore/should_compile/T18078.stderr
- testsuite/tests/simplCore/should_compile/T18995.stderr
- testsuite/tests/simplCore/should_compile/T19890.stderr
- testsuite/tests/simplCore/should_compile/T21948.stderr
- testsuite/tests/simplCore/should_compile/T21960.stderr
- testsuite/tests/simplCore/should_compile/T24808.stderr
- − testsuite/tests/simplCore/should_compile/T25713.stderr
- testsuite/tests/simplCore/should_compile/T4201.stdout
- testsuite/tests/simplCore/should_compile/T8331.stderr
- testsuite/tests/simplStg/should_compile/T22840.stderr
- testsuite/tests/typecheck/no_skolem_info/T20232.stderr
- testsuite/tests/typecheck/should_fail/T11672.stderr
- testsuite/tests/typecheck/should_fail/T12373.stderr
- testsuite/tests/typecheck/should_fail/T15807.stderr
- testsuite/tests/typecheck/should_fail/T16074.stderr
- testsuite/tests/typecheck/should_fail/T18357a.stderr
- testsuite/tests/typecheck/should_fail/T19627.stderr
- testsuite/tests/typecheck/should_fail/T20241b.stderr
- testsuite/tests/typecheck/should_fail/T21530a.stderr
- testsuite/tests/typecheck/should_fail/UnliftedNewtypesFamilyKindFail2.stderr
- testsuite/tests/typecheck/should_fail/VisFlag1.stderr
- utils/check-exact/Parsers.hs
- utils/check-exact/Preprocess.hs
- utils/ghc-toolchain/src/GHC/Toolchain/Tools/MergeObjs.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c7f8f69f6f541308e148a9e9f04505…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c7f8f69f6f541308e148a9e9f04505…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/romes/26166-move-prims] Move code-gen aux symbols from ghc-internal to rts
                        
                        
by Rodrigo Mesquita (@alt-romes) 10 Oct '25
                    by Rodrigo Mesquita (@alt-romes) 10 Oct '25
10 Oct '25
                    
                        
Rodrigo Mesquita pushed to branch wip/romes/26166-move-prims at Glasgow Haskell Compiler / GHC
Commits:
1e62b9c9 by Rodrigo Mesquita at 2025-10-10T13:34:53+01:00
Move code-gen aux symbols from ghc-internal to rts
These symbols were all previously defined in ghc-internal and made the
dependency structure awkward, where the rts may refer to some of these
symbols and had to work around that circular dependency the way
described in #26166.
Moreover, the code generator will produce code that uses these symbols!
Therefore, they should be available in the rts:
PRINCIPLE: If the code generator may produce code which uses this
symbol, then it should be defined in the rts rather than, say,
ghc-internal.
That said, the main motivation is towards fixing #26166.
Towards #26166. Pre-requisite of !14892
- - - - -
18 changed files:
- hadrian/src/Settings/Packages.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- rts/RtsSymbols.c
- rts/include/stg/Prim.h
- libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
- libraries/ghc-internal/cbits/bitrev.c → rts/prim/bitrev.c
- libraries/ghc-internal/cbits/bswap.c → rts/prim/bswap.c
- libraries/ghc-internal/cbits/clz.c → rts/prim/clz.c
- libraries/ghc-internal/cbits/ctz.c → rts/prim/ctz.c
- libraries/ghc-internal/cbits/int64x2minmax.c → rts/prim/int64x2minmax.c
- libraries/ghc-internal/cbits/longlong.c → rts/prim/longlong.c
- libraries/ghc-internal/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
- libraries/ghc-internal/cbits/pdep.c → rts/prim/pdep.c
- libraries/ghc-internal/cbits/pext.c → rts/prim/pext.c
- libraries/ghc-internal/cbits/popcnt.c → rts/prim/popcnt.c
- libraries/ghc-internal/cbits/vectorQuotRem.c → rts/prim/vectorQuotRem.c
- libraries/ghc-internal/cbits/word2float.c → rts/prim/word2float.c
- rts/rts.cabal
Changes:
=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -287,9 +287,6 @@ ghcInternalArgs = package ghcInternal ? do
 
           , builder (Cabal Flags) ? flag NeedLibatomic `cabalFlag` "need-atomic"
 
-          , builder (Cc CompileC) ? (not <$> flag CcLlvmBackend) ?
-              input "**/cbits/atomic.c"  ? arg "-Wno-sync-nand"
-
           ]
 
 -- | RTS-specific command line arguments.
@@ -413,6 +410,9 @@ rtsPackageArgs = package rts ? do
 
           , input "**/RetainerProfile.c" ? flag CcLlvmBackend ?
             arg "-Wno-incompatible-pointer-types"
+
+          , input "**/prim/atomic.c"  ? (not <$> flag CcLlvmBackend) ?
+            arg "-Wno-sync-nand"
           ]
 
     mconcat
=====================================
libraries/ghc-internal/ghc-internal.cabal.in
=====================================
@@ -442,20 +442,7 @@ Library
           cbits/sysconf.c
           cbits/fs.c
           cbits/strerror.c
-          cbits/atomic.c
-          cbits/bswap.c
-          cbits/bitrev.c
-          cbits/clz.c
-          cbits/ctz.c
           cbits/debug.c
-          cbits/int64x2minmax.c
-          cbits/longlong.c
-          cbits/mulIntMayOflo.c
-          cbits/pdep.c
-          cbits/pext.c
-          cbits/popcnt.c
-          cbits/vectorQuotRem.c
-          cbits/word2float.c
           cbits/Stack_c.c
 
       cmm-sources:
=====================================
rts/RtsSymbols.c
=====================================
@@ -1016,6 +1016,116 @@ extern char **environ;
 #define RTS_FINI_ARRAY_SYMBOLS
 #endif
 
+#define SymI_NeedsProtoAllSizes(symbol)                \
+      SymI_NeedsProto(##symbol##8)                     \
+      SymI_NeedsProto(##symbol##16)                    \
+      SymI_NeedsProto(##symbol##32)                    \
+      SymI_NeedsProto(##symbol##64)
+
+#if !defined(arm_HOST_ARCH)
+#define RTS_ATOMICS_SYMBOLS                            \
+      SymI_NeedsProtoAllSizes(hs_atomic_add)           \
+      SymI_NeedsProtoAllSizes(hs_atomic_sub)           \
+      SymI_NeedsProtoAllSizes(hs_atomic_and)           \
+      SymI_NeedsProtoAllSizes(hs_atomic_nand)          \
+      SymI_NeedsProtoAllSizes(hs_atomic_or)            \
+      SymI_NeedsProtoAllSizes(hs_atomic_xor)           \
+      SymI_NeedsProtoAllSizes(hs_cmpxchg)              \
+      SymI_NeedsProtoAllSizes(hs_xchg)                 \
+      SymI_NeedsProtoAllSizes(hs_atomicread)           \
+      SymI_NeedsProtoAllSizes(hs_atomicwrite)
+#else
+// No atomics on arm32. See e9abcad4cc3
+#define RTS_ATOMICS_SYMBOLS
+#endif
+
+// In rts/longlong.c
+#if WORD_SIZE_IN_BITS < 64
+#define RTS_SYMBOLS_LONGLONG                          \
+      SymI_NeedsProto(hs_eq64)                        \
+      SymI_NeedsProto(hs_ne64)                        \
+      SymI_NeedsProto(hs_gtWord64)                    \
+      SymI_NeedsProto(hs_geWord64)                    \
+      SymI_NeedsProto(hs_ltWord64)                    \
+      SymI_NeedsProto(hs_leWord64)                    \
+      SymI_NeedsProto(hs_gtInt64)                     \
+      SymI_NeedsProto(hs_geInt64)                     \
+      SymI_NeedsProto(hs_ltInt64)                     \
+      SymI_NeedsProto(hs_leInt64)                     \
+      SymI_NeedsProto(hs_neg64)                       \
+      SymI_NeedsProto(hs_add64)                       \
+      SymI_NeedsProto(hs_sub64)                       \
+      SymI_NeedsProto(hs_mul64)                       \
+      SymI_NeedsProto(hs_remWord64)                   \
+      SymI_NeedsProto(hs_quotWord64)                  \
+      SymI_NeedsProto(hs_remInt64)                    \
+      SymI_NeedsProto(hs_quotInt64)                   \
+      SymI_NeedsProto(hs_and64)                       \
+      SymI_NeedsProto(hs_or64)                        \
+      SymI_NeedsProto(hs_xor64)                       \
+      SymI_NeedsProto(hs_not64)                       \
+      SymI_NeedsProto(hs_uncheckedShiftL64)           \
+      SymI_NeedsProto(hs_uncheckedShiftRL64)          \
+      SymI_NeedsProto(hs_uncheckedIShiftRA64)         \
+      SymI_NeedsProto(hs_intToInt64)                  \
+      SymI_NeedsProto(hs_int64ToInt)                  \
+      SymI_NeedsProto(hs_wordToWord64)                \
+      SymI_NeedsProto(hs_word64ToWord)
+#else
+#define RTS_SYMBOLS_LONGLONG
+#endif
+
+// rts/prim/vectorQuotRem.c and rts/prim/int64x2minmax
+#if defined(__SSE2__)                                  \
+#define RTS_SYMBOLS_VECTORQUOTREM                      \
+      SymI_NeedsProto(hs_quotInt8X16)                  \
+      SymI_NeedsProto(hs_quotInt16X8)                  \
+      SymI_NeedsProto(hs_quotInt32X4)                  \
+      SymI_NeedsProto(hs_quotInt64X2)                  \
+      SymI_NeedsProto(hs_quotWord8X16)                 \
+      SymI_NeedsProto(hs_quotWord16X8)                 \
+      SymI_NeedsProto(hs_quotWord32X4)                 \
+      SymI_NeedsProto(hs_quotWord64X2)                 \
+      SymI_NeedsProto(hs_remInt8X16)                   \
+      SymI_NeedsProto(hs_remInt16X8)                   \
+      SymI_NeedsProto(hs_remInt32X4)                   \
+      SymI_NeedsProto(hs_remInt64X2)                   \
+      SymI_NeedsProto(hs_remWord8X16)                  \
+      SymI_NeedsProto(hs_remWord16X8)                  \
+      SymI_NeedsProto(hs_remWord32X4)                  \
+      SymI_NeedsProto(hs_remWord64X2)
+#define RTS_SYMBOLS_INT64X2MINMAX                      \
+      SymI_NeedsProto(hs_minInt64X2)                   \
+      SymI_NeedsProto(hs_maxInt64X2)                   \
+      SymI_NeedsProto(hs_minWord64X2)                  \
+      SymI_NeedsProto(hs_maxWord64X2)
+#else
+#define RTS_SYMBOLS_VECTORQUOTREM
+#define RTS_SYMBOLS_INT64X2MINMAX
+#endif
+
+// Symbols on files in rts/prim/*
+#define RTS_SYMBOLS_PRIM                               \
+      RTS_ATOMICS_SYMBOLS                              \
+      RTS_SYMBOLS_INT64X2MINMAX                        \
+      RTS_SYMBOLS_LONGLONG                             \
+      RTS_SYMBOLS_VECTORQUOTREM                        \
+      SymI_NeedsProtoAllSizes(hs_bitrev)               \
+      SymI_NeedsProto(hs_bswap16)                      \
+      SymI_NeedsProto(hs_bswap32)                      \
+      SymI_NeedsProto(hs_bswap64)                      \
+      SymI_NeedsProtoAllSizes(hs_clz)                  \
+      SymI_NeedsProtoAllSizes(hs_ctz)                  \
+      SymI_NeedsProto(hs_mulIntMayOflo)                \
+      SymI_NeedsProtoAllSizes(hs_pdep)                 \
+      SymI_NeedsProtoAllSizes(hs_pext)                 \
+      SymI_NeedsProtoAllSizes(hs_pext)                 \
+      SymI_NeedsProto(hs_popcnt)                       \
+      SymI_NeedsProtoAllSizes(hs_popcnt)               \
+      SymI_NeedsProto(hs_word2float32)                 \
+      SymI_NeedsProto(hs_word2float64)
+
+
 /* entirely bogus claims about types of these symbols */
 #define SymI_NeedsProto(vvv)  extern void vvv(void);
 #define SymI_NeedsDataProto(vvv)  extern StgWord vvv[];
@@ -1038,6 +1148,7 @@ RTS_ARCH_LIBGCC_SYMBOLS
 RTS_FINI_ARRAY_SYMBOLS
 RTS_LIBFFI_SYMBOLS
 RTS_ARM_OUTLINE_ATOMIC_SYMBOLS
+RTS_SYMBOLS_PRIM
 
 #undef SymI_NeedsProto
 #undef SymI_NeedsDataProto
@@ -1081,6 +1192,7 @@ RtsSymbolVal rtsSyms[] = {
       RTS_FINI_ARRAY_SYMBOLS
       RTS_LIBFFI_SYMBOLS
       RTS_ARM_OUTLINE_ATOMIC_SYMBOLS
+      RTS_SYMBOLS_PRIM
       SymI_HasDataProto(nonmoving_write_barrier_enabled)
       { 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE } /* sentinel */
 };
=====================================
rts/include/stg/Prim.h
=====================================
@@ -13,7 +13,7 @@
 
 #pragma once
 
-/* libraries/ghc-internal/cbits/atomic.c */
+/* rts/prim/atomic.c */
 StgWord hs_atomic_add8(StgWord x, StgWord val);
 StgWord hs_atomic_add16(StgWord x, StgWord val);
 StgWord hs_atomic_add32(StgWord x, StgWord val);
=====================================
libraries/ghc-internal/cbits/atomic.c → rts/prim/atomic.c
=====================================
@@ -12,90 +12,66 @@
 
 // FetchAddByteArrayOp_Int
 
-extern StgWord hs_atomic_add8(StgWord x, StgWord val);
-StgWord
-hs_atomic_add8(StgWord x, StgWord val)
+StgWord hs_atomic_add8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_add((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_add16(StgWord x, StgWord val);
-StgWord
-hs_atomic_add16(StgWord x, StgWord val)
+StgWord hs_atomic_add16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_add((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_add32(StgWord x, StgWord val);
-StgWord
-hs_atomic_add32(StgWord x, StgWord val)
+StgWord hs_atomic_add32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_add((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_add64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_add64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_add64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_add((volatile StgWord64 *) x, val);
 }
 
 // FetchSubByteArrayOp_Int
 
-extern StgWord hs_atomic_sub8(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub8(StgWord x, StgWord val)
+StgWord hs_atomic_sub8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_sub((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_sub16(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub16(StgWord x, StgWord val)
+StgWord hs_atomic_sub16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_sub((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_sub32(StgWord x, StgWord val);
-StgWord
-hs_atomic_sub32(StgWord x, StgWord val)
+StgWord hs_atomic_sub32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_sub((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_sub64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_sub((volatile StgWord64 *) x, val);
 }
 
 // FetchAndByteArrayOp_Int
 
-extern StgWord hs_atomic_and8(StgWord x, StgWord val);
-StgWord
-hs_atomic_and8(StgWord x, StgWord val)
+StgWord hs_atomic_and8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_and((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_and16(StgWord x, StgWord val);
-StgWord
-hs_atomic_and16(StgWord x, StgWord val)
+StgWord hs_atomic_and16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_and((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_and32(StgWord x, StgWord val);
-StgWord
-hs_atomic_and32(StgWord x, StgWord val)
+StgWord hs_atomic_and32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_and((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_and64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_and64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_and64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_and((volatile StgWord64 *) x, val);
 }
@@ -167,9 +143,7 @@ hs_atomic_and64(StgWord x, StgWord64 val)
 #pragma GCC diagnostic ignored "-Wsync-nand"
 #endif
 
-extern StgWord hs_atomic_nand8(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand8(StgWord x, StgWord val)
+StgWord hs_atomic_nand8(StgWord x, StgWord val)
 {
 #if USE_SYNC_FETCH_AND_NAND
   return __sync_fetch_and_nand((volatile StgWord8 *) x, (StgWord8) val);
@@ -178,9 +152,7 @@ hs_atomic_nand8(StgWord x, StgWord val)
 #endif
 }
 
-extern StgWord hs_atomic_nand16(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand16(StgWord x, StgWord val)
+StgWord hs_atomic_nand16(StgWord x, StgWord val)
 {
 #if USE_SYNC_FETCH_AND_NAND
   return __sync_fetch_and_nand((volatile StgWord16 *) x, (StgWord16) val);
@@ -189,9 +161,7 @@ hs_atomic_nand16(StgWord x, StgWord val)
 #endif
 }
 
-extern StgWord hs_atomic_nand32(StgWord x, StgWord val);
-StgWord
-hs_atomic_nand32(StgWord x, StgWord val)
+StgWord hs_atomic_nand32(StgWord x, StgWord val)
 {
 #if USE_SYNC_FETCH_AND_NAND
   return __sync_fetch_and_nand((volatile StgWord32 *) x, (StgWord32) val);
@@ -200,9 +170,7 @@ hs_atomic_nand32(StgWord x, StgWord val)
 #endif
 }
 
-extern StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_nand64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val)
 {
 #if USE_SYNC_FETCH_AND_NAND
   return __sync_fetch_and_nand((volatile StgWord64 *) x, val);
@@ -215,96 +183,72 @@ hs_atomic_nand64(StgWord x, StgWord64 val)
 
 // FetchOrByteArrayOp_Int
 
-extern StgWord hs_atomic_or8(StgWord x, StgWord val);
-StgWord
-hs_atomic_or8(StgWord x, StgWord val)
+StgWord hs_atomic_or8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_or((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_or16(StgWord x, StgWord val);
-StgWord
-hs_atomic_or16(StgWord x, StgWord val)
+StgWord hs_atomic_or16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_or((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_or32(StgWord x, StgWord val);
-StgWord
-hs_atomic_or32(StgWord x, StgWord val)
+StgWord hs_atomic_or32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_or((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_or64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_or64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_or64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_or((volatile StgWord64 *) x, val);
 }
 
 // FetchXorByteArrayOp_Int
 
-extern StgWord hs_atomic_xor8(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor8(StgWord x, StgWord val)
+StgWord hs_atomic_xor8(StgWord x, StgWord val)
 {
   return __sync_fetch_and_xor((volatile StgWord8 *) x, (StgWord8) val);
 }
 
-extern StgWord hs_atomic_xor16(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor16(StgWord x, StgWord val)
+StgWord hs_atomic_xor16(StgWord x, StgWord val)
 {
   return __sync_fetch_and_xor((volatile StgWord16 *) x, (StgWord16) val);
 }
 
-extern StgWord hs_atomic_xor32(StgWord x, StgWord val);
-StgWord
-hs_atomic_xor32(StgWord x, StgWord val)
+StgWord hs_atomic_xor32(StgWord x, StgWord val)
 {
   return __sync_fetch_and_xor((volatile StgWord32 *) x, (StgWord32) val);
 }
 
-extern StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val);
-StgWord64
-hs_atomic_xor64(StgWord x, StgWord64 val)
+StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val)
 {
   return __sync_fetch_and_xor((volatile StgWord64 *) x, val);
 }
 
 // CasByteArrayOp_Int
 
-extern StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg8(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new)
 {
   StgWord8 expected = (StgWord8) old;
   __atomic_compare_exchange_n((StgWord8 *) x, &expected, (StgWord8) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
   return expected;
 }
 
-extern StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg16(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new)
 {
   StgWord16 expected = (StgWord16) old;
   __atomic_compare_exchange_n((StgWord16 *) x, &expected, (StgWord16) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
   return expected;
 }
 
-extern StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new);
-StgWord
-hs_cmpxchg32(StgWord x, StgWord old, StgWord new)
+StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new)
 {
   StgWord32 expected = (StgWord32) old;
   __atomic_compare_exchange_n((StgWord32 *) x, &expected, (StgWord32) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
   return expected;
 }
 
-extern StgWord64 hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new);
-StgWord64
-hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
+StgWord64 hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
 {
   StgWord64 expected = (StgWord64) old;
   __atomic_compare_exchange_n((StgWord64 *) x, &expected, (StgWord64) new, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
@@ -313,31 +257,23 @@ hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new)
 
 // Atomic exchange operations
 
-extern StgWord hs_xchg8(StgWord x, StgWord val);
-StgWord
-hs_xchg8(StgWord x, StgWord val)
+StgWord hs_xchg8(StgWord x, StgWord val)
 {
   return (StgWord) __atomic_exchange_n((StgWord8 *) x, (StgWord8) val, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord hs_xchg16(StgWord x, StgWord val);
-StgWord
-hs_xchg16(StgWord x, StgWord val)
+StgWord hs_xchg16(StgWord x, StgWord val)
 {
   return (StgWord) __atomic_exchange_n((StgWord16 *)x, (StgWord16) val, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord hs_xchg32(StgWord x, StgWord val);
-StgWord
-hs_xchg32(StgWord x, StgWord val)
+StgWord hs_xchg32(StgWord x, StgWord val)
 {
   return (StgWord) __atomic_exchange_n((StgWord32 *) x, (StgWord32) val, __ATOMIC_SEQ_CST);
 }
 
 //GCC provides this even on 32bit, but StgWord is still 32 bits.
-extern StgWord64 hs_xchg64(StgWord x, StgWord64 val);
-StgWord64
-hs_xchg64(StgWord x, StgWord64 val)
+StgWord64 hs_xchg64(StgWord x, StgWord64 val)
 {
   return (StgWord64) __atomic_exchange_n((StgWord64 *) x, (StgWord64) val, __ATOMIC_SEQ_CST);
 }
@@ -352,30 +288,22 @@ hs_xchg64(StgWord x, StgWord64 val)
 // primitives which the GCC documentation claims "usually" implies a full
 // barrier.
 
-extern StgWord hs_atomicread8(StgWord x);
-StgWord
-hs_atomicread8(StgWord x)
+StgWord hs_atomicread8(StgWord x)
 {
   return __atomic_load_n((StgWord8 *) x, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord hs_atomicread16(StgWord x);
-StgWord
-hs_atomicread16(StgWord x)
+StgWord hs_atomicread16(StgWord x)
 {
   return __atomic_load_n((StgWord16 *) x, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord hs_atomicread32(StgWord x);
-StgWord
-hs_atomicread32(StgWord x)
+StgWord hs_atomicread32(StgWord x)
 {
   return __atomic_load_n((StgWord32 *) x, __ATOMIC_SEQ_CST);
 }
 
-extern StgWord64 hs_atomicread64(StgWord x);
-StgWord64
-hs_atomicread64(StgWord x)
+StgWord64 hs_atomicread64(StgWord x)
 {
   return __atomic_load_n((StgWord64 *) x, __ATOMIC_SEQ_CST);
 }
@@ -384,30 +312,22 @@ hs_atomicread64(StgWord x)
 // Implies a full memory barrier (see compiler/GHC/Builtin/primops.txt.pp)
 // __ATOMIC_SEQ_CST: Full barrier (see hs_atomicread8 above).
 
-extern void hs_atomicwrite8(StgWord x, StgWord val);
-void
-hs_atomicwrite8(StgWord x, StgWord val)
+void hs_atomicwrite8(StgWord x, StgWord val)
 {
   __atomic_store_n((StgWord8 *) x, (StgWord8) val, __ATOMIC_SEQ_CST);
 }
 
-extern void hs_atomicwrite16(StgWord x, StgWord val);
-void
-hs_atomicwrite16(StgWord x, StgWord val)
+void hs_atomicwrite16(StgWord x, StgWord val)
 {
   __atomic_store_n((StgWord16 *) x, (StgWord16) val, __ATOMIC_SEQ_CST);
 }
 
-extern void hs_atomicwrite32(StgWord x, StgWord val);
-void
-hs_atomicwrite32(StgWord x, StgWord val)
+void hs_atomicwrite32(StgWord x, StgWord val)
 {
   __atomic_store_n((StgWord32 *) x, (StgWord32) val, __ATOMIC_SEQ_CST);
 }
 
-extern void hs_atomicwrite64(StgWord x, StgWord64 val);
-void
-hs_atomicwrite64(StgWord x, StgWord64 val)
+void hs_atomicwrite64(StgWord x, StgWord64 val)
 {
   __atomic_store_n((StgWord64 *) x, (StgWord64) val, __ATOMIC_SEQ_CST);
 }
=====================================
libraries/ghc-internal/cbits/bitrev.c → rts/prim/bitrev.c
=====================================
=====================================
libraries/ghc-internal/cbits/bswap.c → rts/prim/bswap.c
=====================================
=====================================
libraries/ghc-internal/cbits/clz.c → rts/prim/clz.c
=====================================
=====================================
libraries/ghc-internal/cbits/ctz.c → rts/prim/ctz.c
=====================================
=====================================
libraries/ghc-internal/cbits/int64x2minmax.c → rts/prim/int64x2minmax.c
=====================================
=====================================
libraries/ghc-internal/cbits/longlong.c → rts/prim/longlong.c
=====================================
=====================================
libraries/ghc-internal/cbits/mulIntMayOflo.c → rts/prim/mulIntMayOflo.c
=====================================
=====================================
libraries/ghc-internal/cbits/pdep.c → rts/prim/pdep.c
=====================================
=====================================
libraries/ghc-internal/cbits/pext.c → rts/prim/pext.c
=====================================
=====================================
libraries/ghc-internal/cbits/popcnt.c → rts/prim/popcnt.c
=====================================
=====================================
libraries/ghc-internal/cbits/vectorQuotRem.c → rts/prim/vectorQuotRem.c
=====================================
=====================================
libraries/ghc-internal/cbits/word2float.c → rts/prim/word2float.c
=====================================
=====================================
rts/rts.cabal
=====================================
@@ -529,6 +529,19 @@ library
                  sm/Storage.c
                  sm/Sweep.c
                  fs.c
+                 prim/atomic.c
+                 prim/bitrev.c
+                 prim/bswap.c
+                 prim/clz.c
+                 prim/ctz.c
+                 prim/int64x2minmax.c
+                 prim/longlong.c
+                 prim/mulIntMayOflo.c
+                 prim/pdep.c
+                 prim/pext.c
+                 prim/popcnt.c
+                 prim/vectorQuotRem.c
+                 prim/word2float.c
                  -- I wish we had wildcards..., this would be:
                  -- *.c hooks/**/*.c sm/**/*.c eventlog/**/*.c linker/**/*.c
 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1e62b9c9238220ece0fc567064931f8…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1e62b9c9238220ece0fc567064931f8…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0
                            
                          
                          
                            
    
                          
                        
                    
                        
                            
                                
                            
                            [Git][ghc/ghc][wip/andreask/occ_anal_tuning] OccAnal: Be stricter.
                        
                        
by Andreas Klebinger (@AndreasK) 10 Oct '25
                    by Andreas Klebinger (@AndreasK) 10 Oct '25
10 Oct '25
                    
                        
Andreas Klebinger pushed to branch wip/andreask/occ_anal_tuning at Glasgow Haskell Compiler / GHC
Commits:
3f2d549e by Andreas Klebinger at 2025-10-10T14:22:32+02:00
OccAnal: Be stricter.
* When combining usageDetails.
* When constructing core expressions.
In combineUsageDetails when combining the underlying adds we compute a
new `LocalOcc` for each entry by combining the two existing ones.
Rather than wait for those entries to be forced down the road we now
force them immediately. Speeding up T26425 by about 10% with little
effect on the common case.
We also force CoreExprs we construct in order to prevent them from
captuing the OccAnal Env massively reducing residency in some cases.
For T26425 residency went down by a factor of ~10x.
-------------------------
Metric Decrease:
    T26425
-------------------------
- - - - -
4 changed files:
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Data/Graph/UnVar.hs
- compiler/GHC/Types/Unique/FM.hs
- compiler/GHC/Types/Var/Env.hs
Changes:
=====================================
compiler/GHC/Core/Opt/OccurAnal.hs
=====================================
@@ -9,6 +9,8 @@
 -- many /other/ arguments the function has.  Inconsistent unboxing is very
 -- bad for performance, so I increased the limit to allow it to unbox
 -- consistently.
+-- AK: Seems we no longer unbox OccEnv now anyway so it might be redundant.
+
 
 {-
 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
@@ -37,6 +39,7 @@ import GHC.Core.Utils   ( exprIsTrivial, isDefaultAlt, isExpandableApp,
                           mkCastMCo, mkTicks )
 import GHC.Core.Opt.Arity   ( joinRhsArity, isOneShotBndr )
 import GHC.Core.Coercion
+import GHC.Core.Seq (seqExpr)
 import GHC.Core.Type
 import GHC.Core.TyCo.FVs    ( tyCoVarsOfMCo )
 
@@ -984,7 +987,7 @@ occAnalBind !env lvl ire (NonRec bndr rhs) thing_inside combine
   = -- Analyse the RHS and /then/ the body
     let -- Analyse the rhs first, generating rhs_uds
         !(rhs_uds_s, bndr', rhs') = occAnalNonRecRhs env lvl ire mb_join bndr rhs
-        rhs_uds = foldr1 orUDs rhs_uds_s   -- NB: orUDs.  See (W4) of
+        rhs_uds = foldl1' orUDs rhs_uds_s   -- NB: orUDs.  See (W4) of
                                            -- Note [Occurrence analysis for join points]
 
         -- Now analyse the body, adding the join point
@@ -1049,6 +1052,7 @@ occAnalNonRecRhs !env lvl imp_rule_edges mb_join bndr rhs
     -- Match join arity O from mb_join_arity with manifest join arity M as
     -- returned by of occAnalLamTail. It's totally OK for them to mismatch;
     -- hence adjust the UDs from the RHS
+
     WUD adj_rhs_uds final_rhs = adjustNonRecRhs mb_join $
                                 occAnalLamTail rhs_env rhs
     final_bndr_with_rules
@@ -2188,7 +2192,8 @@ occ_anal_lam_tail env expr@(Lam {})
     go env rev_bndrs body
       = addInScope env rev_bndrs $ \env ->
         let !(WUD usage body') = occ_anal_lam_tail env body
-            wrap_lam body bndr = Lam (tagLamBinder usage bndr) body
+            wrap_lam !body !bndr = let !bndr' = (tagLamBinder usage bndr)
+                                   in Lam bndr' body
         in WUD (usage `addLamCoVarOccs` rev_bndrs)
                (foldl' wrap_lam body' rev_bndrs)
 
@@ -2541,7 +2546,7 @@ occAnal env (Case scrut bndr ty alts)
            let alt_env = addBndrSwap scrut' bndr $
                          setTailCtxt env  -- Kill off OccRhs
                WUD alts_usage alts' = do_alts alt_env alts
-               tagged_bndr = tagLamBinder alts_usage bndr
+               !tagged_bndr = tagLamBinder alts_usage bndr
            in WUD alts_usage (tagged_bndr, alts')
 
       total_usage = markAllNonTail scrut_usage `andUDs` alts_usage
@@ -2561,11 +2566,16 @@ occAnal env (Case scrut bndr ty alts)
         let WUD rhs_usage rhs' = occAnal env rhs
             tagged_bndrs = tagLamBinders rhs_usage bndrs
         in                 -- See Note [Binders in case alternatives]
-        WUD rhs_usage (Alt con tagged_bndrs rhs')
+        seqList tagged_bndrs -- avoid retaining the occEnv
+          $ WUD rhs_usage (Alt con tagged_bndrs rhs')
 
 occAnal env (Let bind body)
   = occAnalBind env NotTopLevel noImpRuleEdges bind
-                (\env -> occAnal env body) mkLets
+                (\env -> occAnal env body)
+                -- Without the seqs we construct a `Let` whos body is a
+                -- a thunk retaining the whole OccEnv until forced by the simplifier.
+                (\bndrs body -> (seqExpr body) `seq` (seqList bndrs) `seq` mkLets bndrs body)
+                -- mkLets
 
 occAnalArgs :: OccEnv -> CoreExpr -> [CoreExpr]
             -> [OneShots]  -- Very commonly empty, notably prior to dmd anal
@@ -2644,10 +2654,12 @@ occAnalApp !env (Var fun, args, ticks)
   | fun `hasKey` runRWKey
   , [t1, t2, arg]  <- args
   , WUD usage arg' <- adjustNonRecRhs (JoinPoint 1) $ occAnalLamTail env arg
-  = WUD usage (mkTicks ticks $ mkApps (Var fun) [t1, t2, arg'])
+  = let app_out = (mkTicks ticks $ mkApps (Var fun) [t1, t2, arg'])
+    in seq (seqExpr app_out) $ WUD usage app_out
 
 occAnalApp env (Var fun_id, args, ticks)
-  = WUD all_uds (mkTicks ticks app')
+  = let app_out = (mkTicks ticks app')
+    in seqExpr app_out `seq` WUD all_uds app_out
   where
     -- Lots of banged bindings: this is a very heavily bit of code,
     -- so it pays not to make lots of thunks here, all of which
@@ -2692,8 +2704,9 @@ occAnalApp env (Var fun_id, args, ticks)
         -- See Note [Sources of one-shot information], bullet point A']
 
 occAnalApp env (fun, args, ticks)
-  = WUD (markAllNonTail (fun_uds `andUDs` args_uds))
-                     (mkTicks ticks app')
+  = let app_out = (mkTicks ticks app')
+    in seqExpr app_out `seq` WUD (markAllNonTail (fun_uds `andUDs` args_uds)) app_out
+
   where
     !(WUD args_uds app') = occAnalArgs env fun' args []
     !(WUD fun_uds fun')  = occAnal (addAppCtxt env args) fun
@@ -3650,8 +3663,8 @@ data WithTailUsageDetails a = WTUD !TailUsageDetails !a
 -------------------
 -- UsageDetails API
 
-andUDs, orUDs
-        :: UsageDetails -> UsageDetails -> UsageDetails
+andUDs:: UsageDetails -> UsageDetails -> UsageDetails
+orUDs :: UsageDetails -> UsageDetails -> UsageDetails
 andUDs = combineUsageDetailsWith andLocalOcc
 orUDs  = combineUsageDetailsWith orLocalOcc
 
@@ -3759,17 +3772,18 @@ restrictFreeVars bndrs fvs = restrictUniqSetToUFM bndrs fvs
 
 combineUsageDetailsWith :: (LocalOcc -> LocalOcc -> LocalOcc)
                         -> UsageDetails -> UsageDetails -> UsageDetails
-{-# INLINE combineUsageDetailsWith #-}
 combineUsageDetailsWith plus_occ_info
     uds1@(UD { ud_env = env1, ud_z_many = z_many1, ud_z_in_lam = z_in_lam1, ud_z_tail = z_tail1 })
     uds2@(UD { ud_env = env2, ud_z_many = z_many2, ud_z_in_lam = z_in_lam2, ud_z_tail = z_tail2 })
   | isEmptyVarEnv env1 = uds2
   | isEmptyVarEnv env2 = uds1
   | otherwise
-  = UD { ud_env       = plusVarEnv_C plus_occ_info env1 env2
-       , ud_z_many    = plusVarEnv z_many1   z_many2
-       , ud_z_in_lam  = plusVarEnv z_in_lam1 z_in_lam2
-       , ud_z_tail    = plusVarEnv z_tail1   z_tail2 }
+  -- Using strictPlusVarEnv here speeds up the test T26425 by about 10% by avoiding
+  -- intermediate thunks.
+  = UD { ud_env       = strictPlusVarEnv_C plus_occ_info env1 env2
+       , ud_z_many    = strictPlusVarEnv z_many1   z_many2
+       , ud_z_in_lam  = strictPlusVarEnv z_in_lam1 z_in_lam2
+       , ud_z_tail    = strictPlusVarEnv z_tail1   z_tail2 }
 
 lookupLetOccInfo :: UsageDetails -> Id -> OccInfo
 -- Don't use locally-generated occ_info for exported (visible-elsewhere)
=====================================
compiler/GHC/Data/Graph/UnVar.hs
=====================================
@@ -17,8 +17,8 @@ equal to g, but twice as expensive and large.
 module GHC.Data.Graph.UnVar
     ( UnVarSet
     , emptyUnVarSet, mkUnVarSet, unionUnVarSet, unionUnVarSets
-    , extendUnVarSet, extendUnVarSetList, delUnVarSet, delUnVarSetList
-    , elemUnVarSet, isEmptyUnVarSet
+    , extendUnVarSet, extendUnVarSet_Directly, extendUnVarSetList, delUnVarSet, delUnVarSetList
+    , elemUnVarSet, elemUnVarSet_Directly, isEmptyUnVarSet
     , UnVarGraph
     , emptyUnVarGraph
     , unionUnVarGraph, unionUnVarGraphs
@@ -60,6 +60,9 @@ emptyUnVarSet = UnVarSet S.empty
 elemUnVarSet :: Var -> UnVarSet -> Bool
 elemUnVarSet v (UnVarSet s) = k v `S.member` s
 
+{-# INLINE elemUnVarSet_Directly #-}
+elemUnVarSet_Directly :: Uniquable key => key -> UnVarSet -> Bool
+elemUnVarSet_Directly v (UnVarSet s) = (getKey $ getUnique v) `S.member` s
 
 isEmptyUnVarSet :: UnVarSet -> Bool
 isEmptyUnVarSet (UnVarSet s) = S.null s
@@ -82,6 +85,10 @@ mkUnVarSet vs = UnVarSet $ S.fromList $ map k vs
 extendUnVarSet :: Var -> UnVarSet -> UnVarSet
 extendUnVarSet v (UnVarSet s) = UnVarSet $ S.insert (k v) s
 
+{-# INLINE extendUnVarSet_Directly #-}
+extendUnVarSet_Directly :: Uniquable key => key -> UnVarSet -> UnVarSet
+extendUnVarSet_Directly u (UnVarSet s) = UnVarSet $ S.insert (getKey $ getUnique u) s
+
 extendUnVarSetList :: [Var] -> UnVarSet -> UnVarSet
 extendUnVarSetList vs s = s `unionUnVarSet` mkUnVarSet vs
 
=====================================
compiler/GHC/Types/Unique/FM.hs
=====================================
@@ -51,7 +51,9 @@ module GHC.Types.Unique.FM (
         delListFromUFM,
         delListFromUFM_Directly,
         plusUFM,
+        strictPlusUFM,
         plusUFM_C,
+        strictPlusUFM_C,
         plusUFM_CD,
         plusUFM_CD2,
         mergeUFM,
@@ -251,16 +253,24 @@ delListFromUFM_Directly = foldl' delFromUFM_Directly
 delFromUFM_Directly :: UniqFM key elt -> Unique -> UniqFM key elt
 delFromUFM_Directly (UFM m) u = UFM (M.delete (getKey u) m)
 
--- Bindings in right argument shadow those in the left
+-- | Bindings in right argument shadow those in the left.
+--
+-- Unlike containers this union is right-biased for historic reasons.
 plusUFM :: UniqFM key elt -> UniqFM key elt -> UniqFM key elt
--- M.union is left-biased, plusUFM should be right-biased.
 plusUFM (UFM x) (UFM y) = UFM (M.union y x)
      -- Note (M.union y x), with arguments flipped
      -- M.union is left-biased, plusUFM should be right-biased.
 
+-- | Right biased
+strictPlusUFM :: UniqFM key elt -> UniqFM key elt -> UniqFM key elt
+strictPlusUFM (UFM x) (UFM y) = UFM (MS.union y x)
+
 plusUFM_C :: (elt -> elt -> elt) -> UniqFM key elt -> UniqFM key elt -> UniqFM key elt
 plusUFM_C f (UFM x) (UFM y) = UFM (M.unionWith f x y)
 
+strictPlusUFM_C :: (elt -> elt -> elt) -> UniqFM key elt -> UniqFM key elt -> UniqFM key elt
+strictPlusUFM_C f (UFM x) (UFM y) = UFM (MS.unionWith f x y)
+
 -- | `plusUFM_CD f m1 d1 m2 d2` merges the maps using `f` as the
 -- combinding function and `d1` resp. `d2` as the default value if
 -- there is no entry in `m1` reps. `m2`. The domain is the union of
=====================================
compiler/GHC/Types/Var/Env.hs
=====================================
@@ -12,7 +12,8 @@ module GHC.Types.Var.Env (
         elemVarEnv, disjointVarEnv, anyVarEnv,
         extendVarEnv, extendVarEnv_C, extendVarEnv_Acc,
         extendVarEnvList,
-        plusVarEnv, plusVarEnv_C, plusVarEnv_CD, plusMaybeVarEnv_C,
+        strictPlusVarEnv, plusVarEnv, plusVarEnv_C, strictPlusVarEnv_C,
+        plusVarEnv_CD, plusMaybeVarEnv_C,
         plusVarEnvList, alterVarEnv,
         delVarEnvList, delVarEnv,
         minusVarEnv,
@@ -511,6 +512,7 @@ extendVarEnv      :: VarEnv a -> Var -> a -> VarEnv a
 extendVarEnv_C    :: (a->a->a) -> VarEnv a -> Var -> a -> VarEnv a
 extendVarEnv_Acc  :: (a->b->b) -> (a->b) -> VarEnv b -> Var -> a -> VarEnv b
 plusVarEnv        :: VarEnv a -> VarEnv a -> VarEnv a
+strictPlusVarEnv  :: VarEnv a -> VarEnv a -> VarEnv a
 plusVarEnvList    :: [VarEnv a] -> VarEnv a
 extendVarEnvList  :: VarEnv a -> [(Var, a)] -> VarEnv a
 varEnvDomain      :: VarEnv elt -> UnVarSet
@@ -522,6 +524,7 @@ delVarEnvList     :: Foldable f => VarEnv a -> f Var -> VarEnv a
 delVarEnv         :: VarEnv a -> Var -> VarEnv a
 minusVarEnv       :: VarEnv a -> VarEnv b -> VarEnv a
 plusVarEnv_C      :: (a -> a -> a) -> VarEnv a -> VarEnv a -> VarEnv a
+strictPlusVarEnv_C :: (a -> a -> a) -> VarEnv a -> VarEnv a -> VarEnv a
 plusVarEnv_CD     :: (a -> a -> a) -> VarEnv a -> a -> VarEnv a -> a -> VarEnv a
 plusMaybeVarEnv_C :: (a -> a -> Maybe a) -> VarEnv a -> VarEnv a -> VarEnv a
 mapVarEnv         :: (a -> b) -> VarEnv a -> VarEnv b
@@ -548,6 +551,7 @@ extendVarEnv_C   = addToUFM_C
 extendVarEnv_Acc = addToUFM_Acc
 extendVarEnvList = addListToUFM
 plusVarEnv_C     = plusUFM_C
+strictPlusVarEnv_C = strictPlusUFM_C
 plusVarEnv_CD    = plusUFM_CD
 plusMaybeVarEnv_C = plusMaybeUFM_C
 delVarEnvList    = delListFromUFM
@@ -556,6 +560,7 @@ delVarEnvList    = delListFromUFM
 delVarEnv        = delFromUFM
 minusVarEnv      = minusUFM
 plusVarEnv       = plusUFM
+strictPlusVarEnv = strictPlusUFM
 plusVarEnvList   = plusUFMList
 -- lookupVarEnv is very hot (in part due to being called by substTyVar),
 -- if it's not inlined than the mere allocation of the Just constructor causes
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f2d549ece632573d1e36ee2c9b9725…
-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/3f2d549ece632573d1e36ee2c9b9725…
You're receiving this email because of your account on gitlab.haskell.org.
                    
                  
                  
                          
                            
                            1
                            
                          
                          
                            
                            0