forked from M-Labs/artiq
llvm_ir_generator: use !{→unconditionally.}invariant.load metadata.
This helps LICM, among other things.
This commit is contained in:
parent
8b6418c604
commit
d3ee858d16
@ -651,7 +651,7 @@ class LLVMIRGenerator:
|
||||
llptr = self.llbuilder.gep(llenv, [self.llindex(0), self.llindex(outer_index)],
|
||||
inbounds=True)
|
||||
llouterenv = self.llbuilder.load(llptr)
|
||||
llouterenv.set_metadata('invariant.load', self.empty_metadata)
|
||||
llouterenv.set_metadata('unconditionally.invariant.load', self.empty_metadata)
|
||||
llouterenv.set_metadata('nonnull', self.empty_metadata)
|
||||
return self.llptr_to_var(llouterenv, env_ty.params["$outer"], var_name)
|
||||
|
||||
@ -795,7 +795,7 @@ class LLVMIRGenerator:
|
||||
inbounds=True, name="ptr.{}".format(insn.name))
|
||||
llvalue = self.llbuilder.load(llptr, name="val.{}".format(insn.name))
|
||||
if types.is_instance(typ) and attr in typ.constant_attributes:
|
||||
llvalue.set_metadata('invariant.load', self.empty_metadata)
|
||||
llvalue.set_metadata('unconditionally.invariant.load', self.empty_metadata)
|
||||
if isinstance(llvalue.type, ll.PointerType):
|
||||
self.mark_dereferenceable(llvalue)
|
||||
return llvalue
|
||||
@ -1050,7 +1050,7 @@ class LLVMIRGenerator:
|
||||
llptr = self.llbuilder.gep(llenv, [self.llindex(0), self.llindex(outer_index)],
|
||||
inbounds=True)
|
||||
llouterenv = self.llbuilder.load(llptr)
|
||||
llouterenv.set_metadata('invariant.load', self.empty_metadata)
|
||||
llouterenv.set_metadata('unconditionally.invariant.load', self.empty_metadata)
|
||||
llouterenv.set_metadata('nonnull', self.empty_metadata)
|
||||
return self.llptr_to_var(llouterenv, env_ty.params["$outer"], var_name)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user