Commit Graph

3 Commits

Author SHA1 Message Date
Erik Eckstein
cd8efecd96 SIL Optimizer: check for SILUndef before constructing a ValueSet for a value
Fixes a crash, because SILUndef's function is null.

rdar://97199428
2022-07-19 11:19:34 +02:00
Erik Eckstein
dd9efa87a0 SIL: add block/instruction/value set variants which maintain their current size. 2022-07-13 14:27:50 +02:00
Erik Eckstein
6760dc420c SIL: add a utility which can manage per-value and per-instruction bitfields and flags efficiently.
It's used to implement `InstructionSet` and `ValueSet`: sets of SILValues and SILInstructions.
Just like `BasicBlockSet` for basic blocks, the set is implemented by setting bits directly in SILNode.
This is super efficient because insertion and deletion to/from the set are basic bit operations.

The cost is an additional word in SILNode. But this is basically negligible: it just adds ~0.7% of memory used for SILInstructions.
In my experiments, I didn't see any relevant changes in memory consumption or compile time.
2022-07-13 14:27:50 +02:00