From c0a7be0a908b78019efde7425f07771fee0719fd Mon Sep 17 00:00:00 2001 From: Steve Fan Date: Thu, 16 Dec 2021 16:21:16 +0800 Subject: [PATCH] llvm_ir: move stacksave before lltag alloca in build_rpc Signed-off-by: Steve Fan --- artiq/compiler/transforms/llvm_ir_generator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/artiq/compiler/transforms/llvm_ir_generator.py b/artiq/compiler/transforms/llvm_ir_generator.py index 5f61db822..31b10d505 100644 --- a/artiq/compiler/transforms/llvm_ir_generator.py +++ b/artiq/compiler/transforms/llvm_ir_generator.py @@ -1249,13 +1249,13 @@ class LLVMIRGenerator: self.engine.process(diag) tag += ir.rpc_tag(fun_type.ret, ret_error_handler) + llstackptr = self.llbuilder.call(self.llbuiltin("llvm.stacksave"), [], + name="rpc.stack") + lltag = self.llconst_of_const(ir.Constant(tag, builtins.TStr())) lltagptr = self.llbuilder.alloca(lltag.type) self.llbuilder.store(lltag, lltagptr) - llstackptr = self.llbuilder.call(self.llbuiltin("llvm.stacksave"), [], - name="rpc.stack") - llargs = self.llbuilder.alloca(llptr, ll.Constant(lli32, len(args)), name="rpc.args") for index, arg in enumerate(args):