| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| |
|
|
|
|
| |
I tested it and it seems this wasn't doing anything. Maybe at some point
in the past it was needed to fix up a worse implementation of mem2reg?
So turn it into a check. Maybe it's wrong and it can be necessary.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Do it in 2 passes: 1. gather variables, 2. step thru RPO transforming
loads/stores to each variable. More elegant solution to f9e3a52eaa.
More efficient since all variable usages are visited in CFG order, which
matters due to block sealing.
|
| | |
|
| |
|
|
|
|
|
| |
If a function is stashed for inlining and inlined in all of its
callsites or unused, it never ends up in the object file. If any symbol
reference to it is emitted, then it must be de-inlined (rematerialized),
and this is done near the end before emitting the actual object file.
|
| |
|
|
|
| |
That way they are not copied when inlining.
Also rename ninstr -> ninstrtab. opnarg -> opnoper
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
It was meant as a micro-optimization but actually keeping it in sync was
annoying. This for example was broken:
```
extern enum foo { ... } g_foo;
enum foo g_foo;
```
|
| |
|
|
|
| |
Is much nicer. I don't know whether I want to do it for the other int
types too. char and uchar are fine as bytes. u/short -> u/s16int, maybe.
|
| |
|
|
| |
OpenBSD working & tested
|
| | |
|
| |
|
|
|
|
|
| |
The symref given by staticaddrof is in ex2, not sub. This worked by
chance (with sub->ssym.off happening to be zero) on linux, but on
OpenBSD it would give garbage. Which would result in messed up relocations
later leading to miscompilations.
|
| |
|
|
|
| |
Move the alloca to the beginning of the block and do a 2nd pass on those
odd cases.
|
| |
|
|
|
|
|
|
|
| |
mem2reg was assuming alloca's appeared before all their uses. When this
didn't happen it broke the logic re. sealed blocks. Normally this
doesn't happen in most natural code. Even with gotos, RPO would assure
this in most cases, the exception I found is a goto that jumps into a
loop past a variable declaration that is earlier in the loop. Then even
RPO would keep the alloca itself past the first uses, breaking things.
|
| |
|
|
|
| |
The motivation is for aarch64 msub/madd instrs, for isel to produce. But
it should be useful for other things too.
|
| | |
|
| |
|
|
| |
And add some GCC predefs like __SIZE_TYPE__, __LONG_SIZE__, etc
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
`const int x[]` was being treated as `const int x[const]`, which is
wrong, and matters when `x` is a function parameter that really decays
to a pointer (`int const *const x`)
|
| | |
|
| | |
|
| |
|
|
|
| |
OpenBSD enforces read xor execute (XOM) even in x86-64. Not aware of any
other platforms that do this.
|
| | |
|
| |
|
|
|
| |
The one in x86-64_emit was not portable due to relying on zero
initialization of inactive union fields/padding.
|
| | |
|
| |
|
|
|
| |
The intent is for _Alignas declarations but those aren't implemented
yet. And initializing that field in declarator() can mess with .sym.
|
| | |
|
| |
|
|
|
|
| |
Instead of constructing an array and doing quicksort.
i love .02% speedup microoptimizations
|