Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
what is best in optimizer pipeline
value numbering
code motion
peepholing
loop idiom recognition
legalization
thread gassing
op banning
View Results
 
  • Locked thread
rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
hear me o muse, cause like the introduction to a victorian novel we're preparing to execute



all i need baby is a source a target and a host



gimme that lithe sweet flexible intermediate form more more i need it

https://twitter.com/jckarter/status/869214560279863301

what you call undefined behavior is the only way i know how to live



mmm god lowering peepholes forwarding yes

rjmccall fucked around with this message at 20:49 on Jun 27, 2017

Adbot
ADBOT LOVES YOU

akadajet
Sep 14, 2003

you should compile some larger images, op

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
what the gently caress, fixed

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

the example killed me

JewKiller 3000
Nov 28, 2006

by Lowtax
ssa form: cool and good?

Cybernetic Vermin
Apr 18, 2005

i just generate llvm ops from a cascade of bash scripts op

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

JewKiller 3000 posted:

ssa form: cool and good?

arguments good, phi nodes bad

ConanTheLibrarian
Aug 13, 2004


dis buch is late
Fallen Rib
have you considered using an interpreter instead OP?

poty
Jun 21, 2008

虹はどこで終わるのですか? あなたの魂の中で、または地平線で?
whats a good introductory book i can read as an electrical engineer that studied some computer (architecture) stuff but nothing useful about compilers

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
how do we feel about jitters? are they true compilers or a dangerous heresy?

RISCy Business
Jun 17, 2015

bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork
Fun Shoe
--funroll-loops

The Management
Jan 2, 2010

sup, bitch?
mods please change thread title to "language lawyers: the standard says I can format your hard drive"

Bloody
Mar 3, 2013

voted peephole, gas, and ban

Cybernetic Vermin
Apr 18, 2005

The Management posted:

mods please change thread title to "language lawyers: the standard says I can format your hard drive"

compilers: i casted from int* to short* and c.l.c turned my mom into a goat

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

poty posted:

whats a good introductory book i can read as an electrical engineer that studied some computer (architecture) stuff but nothing useful about compilers

a lot of classic compilers books are really useless because they're actually all about lexing and parsing

here's the main thing you need to understand about compilers as a hardware person. assembly language is typically specified in terms of its translation to machine code + object-file primitives: everything in an assembly file is an explicit directive which is supposed to correspond exactly to something in the output, and there isn't much room for variation. that is not true of "high-level" programming languages, including c, which are so-called because they introduce their own abstraction level: that is, they introduce an abstract machine with its own formal semantics, and the translation into an executable form like machine code is merely a (typically lenient) implementation mechanism for that abstract machine. so for a lot of things, you shouldn't just try to understand the compiler behaviorally, you really need to understand the formal semantics of the programming language

a language implementation's relationship to its language specification is often a lot like a memory controller's relationship to the architecture's memory ordering rules. there are things that will work in practice for a specific system that are not guaranteed to work in general because there is always additional flexibility that is simply not yet being exploited by the implementation. a new implementation comes out that devirtualizes the right call / speculates the right load and suddenly the fact that the original code was never actually correct becomes important

otherwise i don't have a specific book recommendation but maybe try to understand some specific optimization like copy propagation and how the compiler reasons about aliasing

Chris Knight
Jun 5, 2002

me @ ur posts


Fun Shoe

JewKiller 3000 posted:

ssa form: cool and good?

seafoam is cool and good

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
https://fun.irq.dk/funroll-loops.org/

MeruFM
Jul 27, 2010

Deep Dish Fuckfest posted:

how do we feel about jitters? are they true compilers or a dangerous heresy?

bad but required and useful in our hosed up gay world

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
having a jit enables some really neat dynamic code generation and specialization tricks. i'd love to see more language implementations based on a sane language + execution environment that really take intelligent advantage of both static and dynamic information

instead it feels like jits always spend the bulk of their effort (both in development and at runtime) working around stupidity in the language / runtime model. "i couldn't possibly statically inline this trivial getter, it's in a different class file" :monocle:

Bloody
Mar 3, 2013

compilers are programs that take words and produce bits

RISCy Business
Jun 17, 2015

bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork
Fun Shoe
compiler? i hardly know 'er!

JawnV6
Jul 4, 2004

So hot ...
whats a runtime

RISCy Business
Jun 17, 2015

bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork
Fun Shoe

JawnV6 posted:

whats a runtime

not much what's up with you

JawnV6
Jul 4, 2004

So hot ...

RISCy Business posted:

not much what's up with you

p good, almost rumtime

Killer Low Life
Sep 6, 2010

compile this dick

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

JawnV6 posted:

whats a runtime

code which supports the execution of programs, e.g. to implement language features. at the very minimum it includes a loader. generally it also includes functions and variables that support various language features, either for performance (e.g. memcpy and memset) or complexity (e.g. soft division, c++ dynamic casts) or correctness (e.g. the non-lock-free cases of c11 _Atomic), as well as code to support library features that interact with basic behavior (e.g. setjmp, atexit). the line between "runtime" and "standard library" gets pretty vague

JewKiller 3000
Nov 28, 2006

by Lowtax
how do you feel about the tendency to call compilers whose output is not assembly language "transpilers"

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
eh. it's less awkward than "source to source compiler" or "source to source transformation"

it's always to some kind of source code, though, i've never seen it used for e.g. javac

JewKiller 3000
Nov 28, 2006

by Lowtax
alright those were all easy let's do a fun one. what optimization passes do you think are most dangerous? i'm not referring to how they interact with a buggy program, because that would vary based on the program, i mean the compiler code itself. which aggressive optimizations are most likely to accidentally generate incorrect code because they're hella complicated/old/unmaintained/no one sane ever uses them? and don't tell me none or i'll ask for a formal proof :v:

Angela Merkle Tree
Jan 4, 2012

the definition of open: "mkdir android ; cd android ; repo init -u git://android.git.kernel.org/platform/manifest.git ; repo sync ; make"
College Slice
compiler dev is fun because you get to say and type sexp a lot

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

JewKiller 3000 posted:

how do you feel about the tendency to call compilers whose output is not assembly language "transpilers"

"transpiler" just means "compiler that i sneer at" and js people are trying to claim it

Workaday Wizard
Oct 23, 2009

by Pragmatica

rjmccall posted:

arguments good, phi nodes bad

what are phi nodes? why are they bad?

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
I prefer assemblers.

big shtick energy
May 27, 2004


i like how once a C compiler encounters undefined behaviour, not only is that behaviour and what follows undefined, but stuff before the undefined behaviour becomes undefined as well.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

DuckConference posted:

i like how once a C compiler encounters undefined behaviour, not only is that behaviour and what follows undefined, but stuff before the undefined behaviour becomes undefined as well.

later undefined behavior can loosen constraints on earlier behavior

like fro m http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html "Knowing the multiplication "cannot" overflow (because doing so would be undefined) allows optimizing "X*2/2" to "X"."

idk what the order of operations in c is and in what order x*2/2 should get evaluated but yeah

fritz
Jul 26, 2003

Killer Low Life posted:

compile this dick

optimized out b/c never called

RISCy Business
Jun 17, 2015

bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork bork
Fun Shoe

fritz posted:

optimized out b/c never called

:drat:

A Pinball Wizard
Mar 23, 2005

I know every trick, no freak's gonna beat my hands

College Slice

fritz posted:

optimized out b/c never called

:master:

BONGHITZ
Jan 1, 1970

Bloody posted:

voted peephole, gas, and ban

Adbot
ADBOT LOVES YOU

ozymandOS
Jun 9, 2004

fritz posted:

optimized out b/c never called

:trumppop:

  • Locked thread