llvm_ir_generator: don't mark non-constant attribute loads as invariant.

Oops.
This commit is contained in:
whitequark 2016-03-29 12:54:36 +00:00
parent dc2c19f08f
commit a9489246a4
1 changed files with 2 additions and 1 deletions

View File

@ -811,7 +811,8 @@ class LLVMIRGenerator:
llptr = self.llbuilder.gep(obj, [self.llindex(0), self.llindex(index)], llptr = self.llbuilder.gep(obj, [self.llindex(0), self.llindex(index)],
inbounds=True, name="ptr.{}".format(insn.name)) inbounds=True, name="ptr.{}".format(insn.name))
llval = 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 if types.is_instance(typ) and attr not in typ.constant_attributes:
llval.metadata['invariant.load'] = self.empty_metadata
return llval return llval
def process_SetAttr(self, insn): def process_SetAttr(self, insn):