forked from M-Labs/artiq
compiler: mark loads of kernel constant attributes as load invariant.
Also, enable LICM, since it can take advantage of this.
This commit is contained in:
parent
081edb27d7
commit
0e0f81b509
|
@ -105,6 +105,7 @@ class Target:
|
|||
llpassmgr.add_instruction_combining_pass()
|
||||
llpassmgr.add_gvn_pass()
|
||||
llpassmgr.add_cfg_simplification_pass()
|
||||
llpassmgr.add_licm_pass()
|
||||
|
||||
# Clean up after optimizing.
|
||||
llpassmgr.add_dead_arg_elimination_pass()
|
||||
|
|
|
@ -796,7 +796,9 @@ class LLVMIRGenerator:
|
|||
else:
|
||||
llptr = self.llbuilder.gep(obj, [self.llindex(0), self.llindex(index)],
|
||||
inbounds=True, name="ptr.{}".format(insn.name))
|
||||
return self.llbuilder.load(llptr, name="val.{}".format(insn.name))
|
||||
llval = self.llbuilder.load(llptr, name="val.{}".format(insn.name))
|
||||
llval.metadata['invariant.load'] = self.empty_metadata
|
||||
return llval
|
||||
|
||||
def process_SetAttr(self, insn):
|
||||
typ, attr = insn.object().type, insn.attr
|
||||
|
|
Loading…
Reference in New Issue