Message from @picnicnapkin

Discord ID: 464432288223199253


2018-07-05 13:32:31 UTC  

He can manually control the optimizer passes to convince the compiler to do a 4th inlining.

2018-07-05 13:32:46 UTC  

The optimizer is derived from something I assume

2018-07-05 13:33:08 UTC  

Clang is a front-end for LLVM.

2018-07-05 13:33:14 UTC  

ah

2018-07-05 13:33:58 UTC  

He's not a LLVM programmer, although Clang is their most important front-end.

2018-07-05 13:34:28 UTC  

I mean, he's not responsible for LLVM itself.

2018-07-05 13:35:02 UTC  

back when I did embedded stuff we would mess with the runtime to create different runmodes, and we did stuff like made generic unrolled loops for rasterizing and we'd put them straight into the runtime

2018-07-05 13:35:32 UTC  

so basically to do a draw cycle we'd use a DMI call to switch runmode

2018-07-05 13:36:18 UTC  

for some reason that came to mind just now but thiking about it there's absolutely no way that's how clang is doing any sort of optimizaiton

2018-07-05 13:38:02 UTC  

*incomplete thought - the crt had a size limit so in my head optimized code + limit to 3 connected to that

2018-07-05 13:38:16 UTC  

none of this is making any sense is it

2018-07-05 13:38:26 UTC  

I should probaly take a break soon

2018-07-05 13:39:19 UTC  

Clang doesn't optimize. It just spits out correct IR to LLVM.

2018-07-05 13:41:20 UTC  

Well, according to the previous talk, Clang only tries to remove dead code.

2018-07-05 13:41:39 UTC  

makes sense

2018-07-05 13:43:43 UTC  

He talks about how LLVM does bottom-up passes, while GCC does top-down. Both with fallback heuristics that try to work the other way around in special cases.

2018-07-05 13:54:22 UTC  

You're making me want to get into a big C++ project again. I haven't done a big C++ project in probably ~2 years now

2018-07-05 14:07:34 UTC  

i have a love/hate relationship with C++, but its the thing i use the most.

2018-07-05 14:07:43 UTC  

and i totally agree about JS, and Node especially

2018-07-05 14:07:45 UTC  

jesus christ

2018-07-05 14:08:06 UTC  

entire published "packages" to determine whether a number is odd or even lol

2018-07-05 14:36:23 UTC  

I've had a C++ fetish since I was maybe 13 or so. I tried to learn it on my own for years, went through tons of books, ended up properly learning C at about 15 and doing a bunch of embedded stuff in C with increaing ammounts of ASM mixed in, then really got back into C++ maybe from when I was 17 or so. I ended up completely disliking a lot of featues like STL at the time (and still today kinda) because they were so overused at the time, so I coded most of my own stuff with pretty much only the basic features of C++ with a ton of low level style C'ish code

2018-07-05 14:40:43 UTC  

now I've been spoiled by languges like Ruby so I end up using a ton of the new features and completely abuse Boost

2018-07-05 14:42:45 UTC  

yeah started with C, did quite a bit of embedded stuff (and FPGA/hardware) in university, and C++, and then mostly did C++ in jobs and grad school. I like STL, but I hate when people abuse it and do stupid shit with it... using it wrong can be _really_ bad for performance

2018-07-05 14:43:11 UTC  

i've seen STL heavy programs spend 30%+ of total runtime in `new` and `delete`

2018-07-05 14:44:47 UTC  

back when I was getting into it I think STL was fairly new and people would do shit like completely rewrite completely functional libraries to be super abstracted with STL.. So you'd use them and get insane errors that were just super abstract

2018-07-05 14:44:54 UTC  

It's so much better now.

2018-07-05 14:45:04 UTC  

it's come a long way yeah

2018-07-05 14:45:16 UTC  

and if STL doesnt have it, then boost probably does

2018-07-05 14:45:18 UTC  

agreed

2018-07-05 14:45:42 UTC  

I just can't stand not having RAII and Rule Of Zero.

2018-07-05 14:46:58 UTC  

man i still get confused about move semantics and that shit sometimes

2018-07-05 14:47:01 UTC  

why RAII?

2018-07-05 14:48:10 UTC  

Most of the time you don't even have to remember about moves.

2018-07-05 14:48:32 UTC  

Like, `T&&`.

2018-07-05 14:48:49 UTC  

Just take by value.

2018-07-05 14:49:47 UTC  

I guess, but I kinda feel like that's part of what makes it a ~C language

2018-07-05 14:50:05 UTC  

RAII, let all resource cleanup happen automatically. Suddenly you notice 90% of your destructors are empty, the other 10% is trivial.

2018-07-05 14:51:20 UTC  

And you barely need `try/catch`.

2018-07-05 14:54:23 UTC  

Point taken, but I've never particularly disliked writing destructors.

2018-07-05 14:55:20 UTC  

then again I'm not maintaining huge C++ codebases at the moment so I have that luxury