From 812e79b63de9952e2ee7e0ae5b848e1ab74f6acb Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 29 Mar 2016 12:54:36 +0000 Subject: [PATCH] llvm_ir_generator: don't mark non-constant attribute loads as invariant. Oops. --- artiq/compiler/transforms/llvm_ir_generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 8082595f9..22f60fdde 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -811,7 +811,8 @@ class LLVMIRGenerator: llptr = self.llbuilder.gep(obj, [self.llindex(0), self.llindex(index)], inbounds=True, name="ptr.{}".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 def process_SetAttr(self, insn):