forked from M-Labs/artiq
compiler: validate local accesses after interleaving.
This commit is contained in:
parent
df91500f68
commit
78fb3e1b7b
@ -72,9 +72,9 @@ class Module:
|
||||
self.artiq_ir = artiq_ir_generator.visit(src.typedtree)
|
||||
artiq_ir_generator.annotate_calls(devirtualization)
|
||||
cfg_simplifier.process(self.artiq_ir)
|
||||
local_access_validator.process(self.artiq_ir)
|
||||
dead_code_eliminator.process(self.artiq_ir)
|
||||
interleaver.process(self.artiq_ir)
|
||||
local_access_validator.process(self.artiq_ir)
|
||||
|
||||
def build_llvm_ir(self, target):
|
||||
"""Compile the module to LLVM IR for the specified target."""
|
||||
|
@ -27,7 +27,12 @@ class DeadCodeEliminator:
|
||||
while modified:
|
||||
modified = False
|
||||
for insn in func.instructions():
|
||||
if isinstance(insn, (ir.Phi, ir.Alloc, ir.GetLocal, ir.GetConstructor,
|
||||
# Note that GetLocal is treated as an impure operation:
|
||||
# the local access validator has to observe it to emit
|
||||
# a diagnostic for reads of uninitialized locals, and
|
||||
# it also has to run after the interleaver, but interleaver
|
||||
# doesn't like to work with IR before DCE.
|
||||
if isinstance(insn, (ir.Phi, ir.Alloc, ir.GetConstructor,
|
||||
ir.GetAttr, ir.GetElem, ir.Coerce, ir.Arith,
|
||||
ir.Compare, ir.Closure, ir.Select, ir.Quote)) \
|
||||
and not any(insn.uses):
|
||||
|
Loading…
Reference in New Issue
Block a user