From owner-svn-soc-all@FreeBSD.ORG Thu Aug 21 19:00:31 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84843570 for ; Thu, 21 Aug 2014 19:00:31 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 561BE39F5 for ; Thu, 21 Aug 2014 19:00:31 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7LJ0Vn1046786 for ; Thu, 21 Aug 2014 19:00:31 GMT (envelope-from dpl@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id s7LJ0UbO046574 for svn-soc-all@FreeBSD.org; Thu, 21 Aug 2014 19:00:30 GMT (envelope-from dpl@FreeBSD.org) Date: Thu, 21 Aug 2014 19:00:30 GMT Message-Id: <201408211900.s7LJ0UbO046574@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to dpl@FreeBSD.org using -f From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r272791 - soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2014 19:00:31 -0000 Author: dpl Date: Thu Aug 21 19:00:30 2014 New Revision: 272791 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272791 Log: Corrected some GEP instructions, and removed the args and chain from the object instantiation. Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc Modified: soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc ============================================================================== --- soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc Thu Aug 21 18:26:32 2014 (r272790) +++ soc2014/dpl/netmap-ipfwjit/sys/netpfil/ipfw/jit.cc Thu Aug 21 19:00:30 2014 (r272791) @@ -298,11 +298,11 @@ // m = args->m (idx: 0) m = irb.CreateAlloca(mbufPtrTy); - irb.CreateStore(irb.CreateInBoundsGEP(args, ConstantInt::get(int32Ty, 0)), m); + irb.CreateStore(irb.CreateInBoundsGEP(irb.CreateLoad(args), ConstantInt::get(int32Ty, 0)), m); // ip = (struct ip *)((m)->m_data) (idx: 2) ip = irb.CreateAlloca(ipPtrTy); - irb.CreateStore(irb.CreateBitCast(irb.CreateInBoundsGEP(args, ConstantInt::get(int32Ty, 2)), ipPtrTy), ip); + irb.CreateStore(irb.CreateBitCast(irb.CreateInBoundsGEP(irb.CreateLoad(args), ConstantInt::get(int32Ty, 2)), ipPtrTy), ip); #ifdef __FreeBSD__ ucred_cache = irb.CreateAlloca(ucredPtrTy); // Init: NULL if type ucred. @@ -330,7 +330,7 @@ proto = irb.CreateAlloca(int8Ty); irb.CreateStore(ConstantInt::get(int8Ty, 0), proto); // args->f_id.proto = 0 (idx: 6, 5) - irb.CreateStore(ConstantInt::get(int8Ty, 0), irb.CreateInBoundsGEP(args, {ConstantInt::get(int32Ty, 6), ConstantInt::get(int32Ty, 5)} )); + irb.CreateStore(ConstantInt::get(int8Ty, 0), irb.CreateInBoundsGEP(irb.CreateLoad(args), {ConstantInt::get(int32Ty, 6), ConstantInt::get(int32Ty, 5)} )); src_port = irb.CreateAlloca(int16Ty); irb.CreateStore(ConstantInt::get(int16Ty, 0), src_port); @@ -703,7 +703,7 @@ } public: - ipfwJIT(struct ip_fw_args *args, struct ip_fw_chain *chain): irb(con) + ipfwJIT(): irb(con) { // Create the module and load the code. mod = loadbc("ip_fw_rules.bc"); @@ -731,7 +731,7 @@ // Get struct types, and store vars setEnv(); - allocaAndInit(args, chain); + allocaAndInit(); emit_check_tag(); emit_pullup_failed(); @@ -843,7 +843,7 @@ InitializeNativeTarget(); LLVMLinkInJIT(); - ipfwJIT compiler(args, chain); + ipfwJIT compiler; // Fill up needed local variables. compiler.emit_lookpkt_call();