Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM is generating terrible code #3025

Closed
eholk opened this issue Jul 26, 2012 · 10 comments
Closed

LLVM is generating terrible code #3025

eholk opened this issue Jul 26, 2012 · 10 comments
Labels
A-codegen Area: Code generation I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@eholk
Copy link
Contributor

eholk commented Jul 26, 2012

It probably has something to do with us not generating a memmove call instead. Here's an example from the parser.

parse::parser::parser::meth4586::parse_bottom_expr::_6ed32f9348e8142f::_03+0x1b10
+0x125c leaq                           +1289059(%rip), %rdi
+0x1263 movq                           $4, %rsi
+0x1268 callq                          0x10cef068c
+0x126d movq                           %rax, %rbx
+0x1270 leaq                           -4368(%rbp), %rdi
+0x1277 movq                           %r12, %rsi
+0x127a movq                           $1, %rdx
+0x127f callq                          parse::parser::parser::meth4417::look_ahead::_4f6f66ed9b7429d8::_03+0x10
+0x1284 movzxl                         -4359(%rbp), %eax
+0x128b movl                           %eax, -12100(%rbp)
+0x1291 movl                           -4360(%rbp), %eax
+0x1297 movl                           %eax, -12112(%rbp)
+0x129d movq                           -4368(%rbp), %rax
+0x12a4 movq                           %rax, -12120(%rbp)
+0x12ab movzxl                         -4358(%rbp), %eax
+0x12b2 movl                           %eax, -12124(%rbp)
+0x12b8 movzxl                         -4357(%rbp), %eax
+0x12bf movl                           %eax, -12128(%rbp)
+0x12c5 movl                           -4356(%rbp), %eax
+0x12cb movl                           %eax, -12132(%rbp)
+0x12d1 movzxl                         -4355(%rbp), %eax
+0x12d8 movl                           %eax, -12136(%rbp)
+0x12de movzxl                         -4354(%rbp), %eax
+0x12e5 movl                           %eax, -12140(%rbp)
+0x12eb movzxl                         -4353(%rbp), %eax
+0x12f2 movl                           %eax, -12144(%rbp)
+0x12f8 movl                           -4352(%rbp), %eax
+0x12fe movl                           %eax, -12148(%rbp)
+0x1304 movzxl                         -4351(%rbp), %eax
+0x130b movl                           %eax, -12152(%rbp)
+0x1311 movzxl                         -4350(%rbp), %eax
+0x1318 movl                           %eax, -12156(%rbp)
+0x131e movzxl                         -4349(%rbp), %eax
+0x1325 movl                           %eax, -12160(%rbp)
+0x132b movl                           -4348(%rbp), %eax
+0x1331 movl                           %eax, -12164(%rbp)
+0x1337 movzxl                         -4347(%rbp), %eax
+0x133e movl                           %eax, -12168(%rbp)
+0x1344 movzxl                         -4346(%rbp), %eax
+0x134b movl                           %eax, -12172(%rbp)
+0x1351 movzxl                         -4345(%rbp), %eax
+0x1358 movl                           %eax, -12176(%rbp)
+0x135e movl                           -4344(%rbp), %eax
+0x1364 movl                           %eax, -12180(%rbp)
+0x136a movzxl                         -4343(%rbp), %eax
+0x1371 movl                           %eax, -12184(%rbp)
+0x1377 movzxl                         -4342(%rbp), %eax
+0x137e movl                           %eax, -12188(%rbp)
+0x1384 movzxl                         -4341(%rbp), %eax
+0x138b movl                           %eax, -12192(%rbp)
+0x1391 movl                           -4340(%rbp), %eax
+0x1397 movl                           %eax, -12196(%rbp)
+0x139d movzxl                         -4339(%rbp), %eax
+0x13a4 movl                           %eax, -12200(%rbp)
+0x13aa movzxl                         -4338(%rbp), %eax
+0x13b1 movl                           %eax, -12204(%rbp)
+0x13b7 movzxl                         -4337(%rbp), %eax
+0x13be movl                           %eax, -12208(%rbp)
+0x13c4 movl                           -4336(%rbp), %eax
+0x13ca movl                           %eax, -12212(%rbp)
+0x13d0 movzxl                         -4335(%rbp), %eax
+0x13d7 movl                           %eax, -12216(%rbp)
+0x13dd movzxl                         -4334(%rbp), %eax
+0x13e4 movl                           %eax, -12220(%rbp)
+0x13ea movzxl                         -4333(%rbp), %eax
+0x13f1 movl                           %eax, -12224(%rbp)
+0x13f7 movl                           -4332(%rbp), %eax
+0x13fd movl                           %eax, -12228(%rbp)
+0x1403 movzxl                         -4331(%rbp), %eax
+0x140a movl                           %eax, -12232(%rbp)
+0x1410 movzxl                         -4330(%rbp), %eax
+0x1417 movl                           %eax, -12236(%rbp)
+0x141d movzxl                         -4329(%rbp), %eax
+0x1424 movl                           %eax, -12240(%rbp)
+0x142a movl                           -4328(%rbp), %eax
+0x1430 movl                           %eax, -12244(%rbp)
+0x1436 movzxl                         -4327(%rbp), %eax
+0x143d movl                           %eax, -12248(%rbp)
+0x1443 movzxl                         -4326(%rbp), %eax
+0x144a movl                           %eax, -12252(%rbp)
+0x1450 movzxl                         -4325(%rbp), %eax
+0x1457 movl                           %eax, -12256(%rbp)
+0x145d movl                           -4324(%rbp), %eax
+0x1463 movl                           %eax, -12264(%rbp)
+0x1469 movzxl                         -4323(%rbp), %eax
+0x1470 movl                           %eax, -12268(%rbp)
+0x1476 movzxl                         -4322(%rbp), %eax
+0x147d movl                           %eax, -12272(%rbp)
+0x1483 movzxl                         -4321(%rbp), %eax
+0x148a movl                           %eax, -12276(%rbp)
+0x1490 movl                           -4320(%rbp), %eax
+0x1496 movl                           %eax, -12280(%rbp)
+0x149c movzxl                         -4319(%rbp), %eax
+0x14a3 movl                           %eax, -12284(%rbp)
+0x14a9 movzxl                         -4318(%rbp), %eax
+0x14b0 movl                           %eax, -12288(%rbp)
+0x14b6 movzxl                         -4317(%rbp), %eax
+0x14bd movl                           %eax, -12292(%rbp)
+0x14c3 movl                           -4316(%rbp), %eax
+0x14c9 movl                           %eax, -12296(%rbp)
+0x14cf movzxl                         -4315(%rbp), %eax
+0x14d6 movl                           %eax, -12300(%rbp)
+0x14dc movzxl                         -4314(%rbp), %eax
+0x14e3 movl                           %eax, -12304(%rbp)
+0x14e9 movzxl                         -4313(%rbp), %eax
+0x14f0 movl                           %eax, -12308(%rbp)
+0x14f6 movl                           -4312(%rbp), %eax
+0x14fc movl                           %eax, -12312(%rbp)
+0x1502 movzxl                         -4311(%rbp), %eax
+0x1509 movl                           %eax, -12316(%rbp)
+0x150f movzxl                         -4310(%rbp), %eax
+0x1516 movl                           %eax, -12320(%rbp)
+0x151c movzxl                         -4309(%rbp), %eax
+0x1523 movl                           %eax, -12324(%rbp)
+0x1529 movl                           -4308(%rbp), %eax
+0x152f movl                           %eax, -12328(%rbp)
+0x1535 movzxl                         -4307(%rbp), %eax
+0x153c movl                           %eax, -12332(%rbp)
+0x1542 movzxl                         -4306(%rbp), %eax
+0x1549 movl                           %eax, -12336(%rbp)
+0x154f movzxl                         -4305(%rbp), %eax
+0x1556 movl                           %eax, -12340(%rbp)
+0x155c movl                           -4304(%rbp), %eax
+0x1562 movl                           %eax, -12344(%rbp)
+0x1568 movzxl                         -4303(%rbp), %eax
+0x156f movl                           %eax, -12348(%rbp)
+0x1575 movzxl                         -4302(%rbp), %eax
+0x157c movl                           %eax, -12352(%rbp)
+0x1582 movzxl                         -4301(%rbp), %eax
+0x1589 movl                           %eax, -12356(%rbp)
+0x158f movl                           -4300(%rbp), %eax
+0x1595 movl                           %eax, -12360(%rbp)
+0x159b movzxl                         -4299(%rbp), %eax
+0x15a2 movl                           %eax, -12364(%rbp)
+0x15a8 movzxl                         -4298(%rbp), %eax
+0x15af movl                           %eax, -12368(%rbp)
+0x15b5 movzxl                         -4297(%rbp), %eax
+0x15bc movl                           %eax, -12372(%rbp)
+0x15c2 movzxl                         -4295(%rbp), %eax
+0x15c9 movl                           %eax, -12376(%rbp)
+0x15cf movzxl                         -4294(%rbp), %eax
+0x15d6 movl                           %eax, -12380(%rbp)
+0x15dc movzxl                         -4293(%rbp), %eax
+0x15e3 movl                           %eax, -12384(%rbp)
+0x15e9 movzxl                         -4291(%rbp), %eax
+0x15f0 movl                           %eax, -12388(%rbp)
+0x15f6 movzxl                         -4290(%rbp), %eax
+0x15fd movl                           %eax, -12392(%rbp)
+0x1603 movzxl                         -4289(%rbp), %eax
+0x160a movl                           %eax, -12396(%rbp)
+0x1610 movl                           -4288(%rbp), %eax
+0x1616 movl                           %eax, -12400(%rbp)
+0x161c movzxl                         -4287(%rbp), %eax
+0x1623 movl                           %eax, -12404(%rbp)
+0x1629 movzxl                         -4286(%rbp), %eax
+0x1630 movl                           %eax, -12408(%rbp)
+0x1636 movzxl                         -4285(%rbp), %eax
+0x163d movl                           %eax, -12412(%rbp)
+0x1643 movl                           -4284(%rbp), %eax
+0x1649 movl                           %eax, -12416(%rbp)
+0x164f movq                           %rbx, -12096(%rbp)
+0x1656 movzxl                         -4283(%rbp), %r14d
+0x165e movzxl                         -4282(%rbp), %r15d
+0x1666 movzxl                         -4281(%rbp), %r10d
+0x166e movl                           -4280(%rbp), %r9d
+0x1675 movzxl                         -4279(%rbp), %r8d
+0x167d movzxl                         -4278(%rbp), %ecx
+0x1684 movzxl                         -4277(%rbp), %r11d
+0x168c movl                           -4276(%rbp), %esi
+0x1692 movzxl                         -4275(%rbp), %edi
+0x1699 movzxl                         -4274(%rbp), %ebx
+0x16a0 movq                           %r12, %rdx
+0x16a3 movzxl                         -4273(%rbp), %r12d
+0x16ab movl                           -4296(%rbp), %eax
+0x16b1 movl                           -4292(%rbp), %r13d
+0x16b8 movl                           %r13d, +528(%rsp)
+0x16c0 movl                           %eax, +496(%rsp)
+0x16c7 movl                           %r12d, +680(%rsp)
+0x16cf movq                           %rdx, %r12
+0x16d2 movl                           %ebx, +672(%rsp)
+0x16d9 movl                           %edi, +664(%rsp)
+0x16e0 movl                           %esi, +656(%rsp)
+0x16e7 movl                           %r11d, +648(%rsp)
+0x16ef movl                           %ecx, +640(%rsp)
+0x16f6 movl                           %r8d, +632(%rsp)
+0x16fe movl                           %r9d, +624(%rsp)
+0x1706 movl                           %r10d, +616(%rsp)
+0x170e movl                           %r15d, +608(%rsp)
+0x1716 movl                           %r14d, +600(%rsp)
+0x171e movq                           -12096(%rbp), %r14
+0x1725 movl                           -12416(%rbp), %eax
+0x172b movl                           %eax, +592(%rsp)
+0x1732 movl                           -12412(%rbp), %eax
+0x1738 movl                           %eax, +584(%rsp)
+0x173f movl                           -12408(%rbp), %eax
+0x1745 movl                           %eax, +576(%rsp)
+0x174c movl                           -12404(%rbp), %eax
+0x1752 movl                           %eax, +568(%rsp)
+0x1759 movl                           -12400(%rbp), %eax
+0x175f movl                           %eax, +560(%rsp)
+0x1766 movl                           -12396(%rbp), %eax
+0x176c movl                           %eax, +552(%rsp)
+0x1773 movl                           -12392(%rbp), %eax
+0x1779 movl                           %eax, +544(%rsp)
+0x1780 movl                           -12388(%rbp), %eax
+0x1786 movl                           %eax, +536(%rsp)
+0x178d movl                           -12384(%rbp), %eax
+0x1793 movl                           %eax, +520(%rsp)
+0x179a movl                           -12380(%rbp), %eax
+0x17a0 movl                           %eax, +512(%rsp)
+0x17a7 movl                           -12376(%rbp), %eax
+0x17ad movl                           %eax, +504(%rsp)
+0x17b4 movl                           -12372(%rbp), %eax
+0x17ba movl                           %eax, +488(%rsp)
+0x17c1 movl                           -12368(%rbp), %eax
+0x17c7 movl                           %eax, +480(%rsp)
+0x17ce movl                           -12364(%rbp), %eax
+0x17d4 movl                           %eax, +472(%rsp)
+0x17db movl                           -12360(%rbp), %eax
+0x17e1 movl                           %eax, +464(%rsp)
+0x17e8 movl                           -12356(%rbp), %eax
+0x17ee movl                           %eax, +456(%rsp)
+0x17f5 movl                           -12352(%rbp), %eax
+0x17fb movl                           %eax, +448(%rsp)
+0x1802 movl                           -12348(%rbp), %eax
+0x1808 movl                           %eax, +440(%rsp)
+0x180f movl                           -12344(%rbp), %eax
+0x1815 movl                           %eax, +432(%rsp)
+0x181c movl                           -12340(%rbp), %eax
+0x1822 movl                           %eax, +424(%rsp)
+0x1829 movl                           -12336(%rbp), %eax
+0x182f movl                           %eax, +416(%rsp)
+0x1836 movl                           -12332(%rbp), %eax
+0x183c movl                           %eax, +408(%rsp)
+0x1843 movl                           -12328(%rbp), %eax
+0x1849 movl                           %eax, +400(%rsp)
+0x1850 movl                           -12324(%rbp), %eax
+0x1856 movl                           %eax, +392(%rsp)
+0x185d movl                           -12320(%rbp), %eax
+0x1863 movl                           %eax, +384(%rsp)
+0x186a movl                           -12316(%rbp), %eax
+0x1870 movl                           %eax, +376(%rsp)
+0x1877 movl                           -12312(%rbp), %eax
+0x187d movl                           %eax, +368(%rsp)
+0x1884 movl                           -12308(%rbp), %eax
+0x188a movl                           %eax, +360(%rsp)
+0x1891 movl                           -12304(%rbp), %eax
+0x1897 movl                           %eax, +352(%rsp)
+0x189e movl                           -12300(%rbp), %eax
+0x18a4 movl                           %eax, +344(%rsp)
+0x18ab movl                           -12296(%rbp), %eax
+0x18b1 movl                           %eax, +336(%rsp)
+0x18b8 movl                           -12292(%rbp), %eax
+0x18be movl                           %eax, +328(%rsp)
+0x18c5 movl                           -12288(%rbp), %eax
+0x18cb movl                           %eax, +320(%rsp)
+0x18d2 movl                           -12284(%rbp), %eax
+0x18d8 movl                           %eax, +312(%rsp)
+0x18df movl                           -12280(%rbp), %eax
+0x18e5 movl                           %eax, +304(%rsp)
+0x18ec movl                           -12276(%rbp), %eax
+0x18f2 movl                           %eax, +296(%rsp)
+0x18f9 movl                           -12272(%rbp), %eax
+0x18ff movl                           %eax, +288(%rsp)
+0x1906 movl                           -12268(%rbp), %eax
+0x190c movl                           %eax, +280(%rsp)
+0x1913 movl                           -12264(%rbp), %eax
+0x1919 movl                           %eax, +272(%rsp)
+0x1920 movl                           -12256(%rbp), %eax
+0x1926 movl                           %eax, +264(%rsp)
+0x192d movl                           -12252(%rbp), %eax
+0x1933 movl                           %eax, +256(%rsp)
+0x193a movl                           -12248(%rbp), %eax
+0x1940 movl                           %eax, +248(%rsp)
+0x1947 movl                           -12244(%rbp), %eax
+0x194d movl                           %eax, +240(%rsp)
+0x1954 movl                           -12240(%rbp), %eax
+0x195a movl                           %eax, +232(%rsp)
+0x1961 movl                           -12236(%rbp), %eax
+0x1967 movl                           %eax, +224(%rsp)
+0x196e movl                           -12232(%rbp), %eax
+0x1974 movl                           %eax, +216(%rsp)
+0x197b movl                           -12228(%rbp), %eax
+0x1981 movl                           %eax, +208(%rsp)
+0x1988 movl                           -12224(%rbp), %eax
+0x198e movl                           %eax, +200(%rsp)
+0x1995 movl                           -12220(%rbp), %eax
+0x199b movl                           %eax, +192(%rsp)
+0x19a2 movl                           -12216(%rbp), %eax
+0x19a8 movl                           %eax, +184(%rsp)
+0x19af movl                           -12212(%rbp), %eax
+0x19b5 movl                           %eax, +176(%rsp)
+0x19bc movl                           -12208(%rbp), %eax
+0x19c2 movl                           %eax, +168(%rsp)
+0x19c9 movl                           -12204(%rbp), %eax
+0x19cf movl                           %eax, +160(%rsp)
+0x19d6 movl                           -12200(%rbp), %eax
+0x19dc movl                           %eax, +152(%rsp)
+0x19e3 movl                           -12196(%rbp), %eax
+0x19e9 movl                           %eax, +144(%rsp)
+0x19f0 movl                           -12192(%rbp), %eax
+0x19f6 movl                           %eax, +136(%rsp)
+0x19fd movl                           -12188(%rbp), %eax
+0x1a03 movl                           %eax, +128(%rsp)
+0x1a0a movl                           -12184(%rbp), %eax
+0x1a10 movl                           %eax, +120(%rsp)
+0x1a14 movl                           -12180(%rbp), %eax
+0x1a1a movl                           %eax, +112(%rsp)
+0x1a1e movl                           -12176(%rbp), %eax
+0x1a24 movl                           %eax, +104(%rsp)
+0x1a28 movl                           -12172(%rbp), %eax
+0x1a2e movl                           %eax, +96(%rsp)
+0x1a32 movl                           -12168(%rbp), %eax
+0x1a38 movl                           %eax, +88(%rsp)
+0x1a3c movl                           -12164(%rbp), %eax
+0x1a42 movl                           %eax, +80(%rsp)
+0x1a46 movl                           -12160(%rbp), %eax
+0x1a4c movl                           %eax, +72(%rsp)
+0x1a50 movl                           -12156(%rbp), %eax
+0x1a56 movl                           %eax, +64(%rsp)
+0x1a5a movl                           -12152(%rbp), %eax
+0x1a60 movl                           %eax, +56(%rsp)
+0x1a64 movl                           -12148(%rbp), %eax
+0x1a6a movl                           %eax, +48(%rsp)
+0x1a6e movl                           -12144(%rbp), %eax
+0x1a74 movl                           %eax, +40(%rsp)
+0x1a78 movl                           -12140(%rbp), %eax
+0x1a7e movl                           %eax, +32(%rsp)
+0x1a82 movl                           -12136(%rbp), %eax
+0x1a88 movl                           %eax, +24(%rsp)
+0x1a8c movl                           -12132(%rbp), %eax
+0x1a92 movl                           %eax, +16(%rsp)
+0x1a96 movl                           -12128(%rbp), %eax
+0x1a9c movl                           %eax, +8(%rsp)
+0x1aa0 movl                           -12124(%rbp), %eax
@graydon
Copy link
Contributor

graydon commented Jul 26, 2012

Yeah, we've seen it do this before, find me tomorrow and we'll get to the bottom of it.

@ghost ghost assigned graydon Jul 26, 2012
@bblum
Copy link
Contributor

bblum commented Aug 1, 2012

it really loves its movbs, too. seen in disassembly of libcore:

   51c0d:       c6 85 b7 fe ff ff 00    movb   $0x0,-0x149(%rbp)
   51c14:       c6 85 b6 fe ff ff 00    movb   $0x0,-0x14a(%rbp)
   51c1b:       c6 85 b5 fe ff ff 00    movb   $0x0,-0x14b(%rbp)
   51c22:       c6 85 b4 fe ff ff 00    movb   $0x0,-0x14c(%rbp)
   51c29:       c6 85 b3 fe ff ff 00    movb   $0x0,-0x14d(%rbp)
   51c30:       c6 85 b2 fe ff ff 00    movb   $0x0,-0x14e(%rbp)
   51c37:       c6 85 b1 fe ff ff 00    movb   $0x0,-0x14f(%rbp)
   51c3e:       c6 85 b0 fe ff ff 00    movb   $0x0,-0x150(%rbp)
   51c45:       c6 85 af fe ff ff 00    movb   $0x0,-0x151(%rbp)
   51c4c:       c6 85 ae fe ff ff 00    movb   $0x0,-0x152(%rbp)
   51c53:       c6 85 ad fe ff ff 00    movb   $0x0,-0x153(%rbp)
   51c5a:       c6 85 ac fe ff ff 00    movb   $0x0,-0x154(%rbp)
   51c61:       c6 85 ab fe ff ff 00    movb   $0x0,-0x155(%rbp)
   51c68:       c6 85 aa fe ff ff 00    movb   $0x0,-0x156(%rbp)
   51c6f:       c6 85 a9 fe ff ff 00    movb   $0x0,-0x157(%rbp)
   51c76:       c6 85 a8 fe ff ff 00    movb   $0x0,-0x158(%rbp)
   51c7d:       c6 85 a7 fe ff ff 00    movb   $0x0,-0x159(%rbp)
   51c84:       c6 85 a6 fe ff ff 00    movb   $0x0,-0x15a(%rbp)
   51c8b:       c6 85 a5 fe ff ff 00    movb   $0x0,-0x15b(%rbp)
   51c92:       c6 85 a4 fe ff ff 00    movb   $0x0,-0x15c(%rbp)
   51c99:       c6 85 a3 fe ff ff 00    movb   $0x0,-0x15d(%rbp)
   51ca0:       c6 85 a2 fe ff ff 00    movb   $0x0,-0x15e(%rbp)
   51ca7:       c6 85 a1 fe ff ff 00    movb   $0x0,-0x15f(%rbp)
   51cae:       c6 85 a0 fe ff ff 00    movb   $0x0,-0x160(%rbp)

@eholk
Copy link
Contributor Author

eholk commented Aug 1, 2012

@bblum: do you know what function that's from?

@bblum
Copy link
Contributor

bblum commented Aug 2, 2012

task::each_ancestor::coalesce, which isn't pushed yet. (edit: is now pushed.)

@echristo
Copy link

echristo commented Aug 8, 2012

The only time I've seen this sort of thing that I can recall is when we had a very large structure being passed around/returned by value. Is that a possibility here?

@pcwalton
Copy link
Contributor

pcwalton commented Aug 8, 2012

Yes, it's what's probably going on. rustc shouldn't ordinarily generate
large structure copies and should memcpy, but evidently something is going
wrong in rustc and it's generating first class aggregates.
On Aug 7, 2012 5:28 PM, "Eric Christopher" notifications@github.com wrote:

The only time I've seen this sort of thing that I can recall is when we
had a very large structure being passed around/returned by value. Is that a
possibility here?


Reply to this email directly or view it on GitHubhttps://github.com//issues/3025#issuecomment-7571604.

@graydon
Copy link
Contributor

graydon commented Aug 8, 2012

I'm going to place a first bet, then, on the fact that various AST types are ginormous. For example, I just added a little profiling mode here that counts sizes, and it looks like item is 416 bytes long, expr is 184 bytes, ty is 152 bytes, etc.

Perhaps I'll spend a little time rearranging these types. We treat them by value a lot more than we should. And likewise, the various sub-parts that make up each of them.

pcwalton added a commit that referenced this issue Aug 26, 2012
Previously, LLVM was generating a ton of byte-by-byte copies,
leading to huge numbers of vregs and bloating the code. Now, using
memset, the code becomes a nice series of SSE moves instead.
pcwalton added a commit that referenced this issue Aug 26, 2012
This was causing a bunch of structural copies, which when inlined
was leading to enormous register pressure. Often this is seen in
code which makes use of result::unwrap.
@pcwalton
Copy link
Contributor

I fixed a few of these. Leaving this open because I haven't investigated the parser code yet.

@pnkfelix
Copy link
Member

We might also want to look at #4413 in parallel with this.

@thestinger
Copy link
Contributor

Closing this because it's not very specific, and I think the issues mentioned here have been fixed. I'll report some specific issues in our IR generation instead, there are a lot of them! :)

flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 20, 2020
Add --no-deps option to avoid running on path dependencies in workspaces

Since rust-lang/cargo#8758 has hit nightly, this allows us to address the second bullet point and [the concern related to `--fix`](rust-lang/cargo#8143 (comment)) in the [RUSTC_WORKSPACE_WRAPPER tracking issue](rust-lang/cargo#8143).

As a reminder stabilizing that env var will solve rust-lang#4612 (Clippy not running after `cargo check` in stable) and would allow to stabilize the `--fix` option in Clippy.

changelog: Add `--no-deps` option to avoid running on path dependencies in workspaces

Fixes rust-lang#3025
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
The issue with the current code is that comments are collapsed, so comments like
the one from the test end up in a string like:

```
"// this is a single line comment\n/* block = */"
```

I chose to fix it by detecting whether we're in a block comment starting from
the end instead, and tested a single-line comment ended in `*/` just for sanity,
ensuring line breaks are not removed in that case, which would break the
formatting.

The right fix eventually is probably to lex the comments properly, but this does
the work for now, I guess :)

Fixes rust-lang#3025
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 17, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

7 participants