Re: [Patch,microblaze]: Instruction prefetch optimization for microblaze.
On 12/07/2015 09:39 AM, Ajit Kumar Agarwal wrote: -Original Message- From: Michael Eager [mailto:ea...@eagerm.com] Sent: Thursday, December 03, 2015 7:27 PM To: Ajit Kumar Agarwal; GCC Patches Cc: Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida; Nagaraju Mekala Subject: Re: [Patch,microblaze]: Instruction prefetch optimization for microblaze. On 12/01/2015 12:49 AM, Ajit Kumar Agarwal wrote: The changes are made in this patch for the instruction prefetch optimizations for Microblaze. Reg tested for Microblaze target. The changes are made for instruction prefetch optimizations for Microblaze. The "wic" microblaze instruction is the instruction prefetch instruction. The instruction prefetch optimization is done to generate the iprefetch instruction at the call site fall through path. This optimization is enabled with microblaze target flag mxl-prefetch. The purpose of adding the flags is that selection of "wic" instruction should be enabled in the reconfigurable design and the selection is not enabled by default. ChangeLog: 2015-12-01 Ajit Agarwal * config/microblaze/microblaze.c (get_branch_target): New. (insert_wic_for_ilb_runout): New. (insert_wic): New. (microblaze_machine_dependent_reorg): New. (TARGET_MACHINE_DEPENDENT_REORG): Define macro. * config/microblaze/microblaze.md (UNSPEC_IPREFETCH): Define. (iprefetch): New pattern * config/microblaze/microblaze.opt (mxl-prefetch): New flag. Signed-off-by:Ajit Agarwal ajit...@xilinx.com Thanks & Regards Ajit + rtx_insn *insn, *before_4 = 0, *before_16 = 0; int addr = 0, length, + first_addr = -1; int wic_addr0 = 128 * 4, wic_addr1 = 128 * 4; Especially when there are initializers, I prefer to see each variable declared on a separate line. If the meaning of a variable is not clear (and most of these are not), include a comment >>before the declaration. +if (first_addr == -1) + first_addr = INSN_ADDRESSES (INSN_UID (insn)); Can be moved to initialize first_addr. +addr = INSN_ADDRESSES (INSN_UID (insn)) - first_addr; Is "addr" and address or offset? If the latter, use a more descriptive name. +if (before_4 == 0 && addr + length >= 4 * 4) + before_4 = insn; ... Please add comments to describe what you are doing here. What are before_4 and before_16? What are all these conditions testing? + loop_optimizer_finalize(); Space before parens. All the above comments are incorporated. Updated patch is attached. Regtested for Microblaze target. Mibench/EEMBC benchmarks are run on the hardware enabling the mxl-prefetch and the run goes through fine With the generation of "wic" instruction. [Patch,microblaze]: Instruction prefetch optimization for microblaze. The changes are made for instruction prefetch optimizations for Microblaze. The "wic" microblaze instruction is the instruction prefetch instruction. The instruction prefetch optimization is done to generate the iprefetch instruction at the call site fall through path. This optimization is enabled with microblaze target flag mxl-prefetch. The purpose of adding the flags is that selection of "wic" instruction should be enabled in the reconfigurable design and the selection is not enabled by default. ChangeLog: 2015-12-07 Ajit Agarwal * config/microblaze/microblaze.c (get_branch_target): New. (insert_wic_for_ilb_runout): New. (insert_wic): New. (microblaze_machine_dependent_reorg): New. (TARGET_MACHINE_DEPENDENT_REORG): Define macro. * config/microblaze/microblaze.md (UNSPEC_IPREFETCH): Define. (iprefetch): New pattern * config/microblaze/microblaze.opt (mxl-prefetch): New flag. Signed-off-by:Ajit Agarwal ajit...@xilinx.com Thanks & Regards Ajit Committed revision 232683. -- Michael Eagerea...@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
RE: [Patch,microblaze]: Instruction prefetch optimization for microblaze.
-Original Message- From: Michael Eager [mailto:ea...@eagerm.com] Sent: Thursday, December 03, 2015 7:27 PM To: Ajit Kumar Agarwal; GCC Patches Cc: Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida; Nagaraju Mekala Subject: Re: [Patch,microblaze]: Instruction prefetch optimization for microblaze. On 12/01/2015 12:49 AM, Ajit Kumar Agarwal wrote: > The changes are made in this patch for the instruction prefetch optimizations > for Microblaze. > > Reg tested for Microblaze target. > > The changes are made for instruction prefetch optimizations for > Microblaze. The "wic" microblaze instruction is the instruction > prefetch instruction. The instruction prefetch optimization is done to > generate the iprefetch instruction at the call site fall through path. > This optimization is enabled with microblaze target flag mxl-prefetch. The > purpose of adding the flags is that selection of "wic" instruction should be > enabled in the reconfigurable design and the selection is not enabled by > default. > > ChangeLog: > 2015-12-01 Ajit Agarwal > > * config/microblaze/microblaze.c > (get_branch_target): New. > (insert_wic_for_ilb_runout): New. > (insert_wic): New. > (microblaze_machine_dependent_reorg): New. > (TARGET_MACHINE_DEPENDENT_REORG): Define macro. > * config/microblaze/microblaze.md > (UNSPEC_IPREFETCH): Define. > (iprefetch): New pattern > * config/microblaze/microblaze.opt > (mxl-prefetch): New flag. > > Signed-off-by:Ajit Agarwal ajit...@xilinx.com > > > Thanks & Regards > Ajit > >>+ rtx_insn *insn, *before_4 = 0, *before_16 = 0; int addr = 0, length, >>+ first_addr = -1; int wic_addr0 = 128 * 4, wic_addr1 = 128 * 4; >>Especially when there are initializers, I prefer to see each variable >>declared on a separate line. If the meaning of a variable is not clear (and >>most of these are not), include a comment >>before the declaration. >>+if (first_addr == -1) >>+ first_addr = INSN_ADDRESSES (INSN_UID (insn)); >>Can be moved to initialize first_addr. >>+addr = INSN_ADDRESSES (INSN_UID (insn)) - first_addr; >>Is "addr" and address or offset? If the latter, use a more descriptive name. >>+if (before_4 == 0 && addr + length >= 4 * 4) >>+ before_4 = insn; ... >>Please add comments to describe what you are doing here. What are before_4 >>and before_16? What are all these conditions testing? >>+ loop_optimizer_finalize(); >>Space before parens. All the above comments are incorporated. Updated patch is attached. Regtested for Microblaze target. Mibench/EEMBC benchmarks are run on the hardware enabling the mxl-prefetch and the run goes through fine With the generation of "wic" instruction. [Patch,microblaze]: Instruction prefetch optimization for microblaze. The changes are made for instruction prefetch optimizations for Microblaze. The "wic" microblaze instruction is the instruction prefetch instruction. The instruction prefetch optimization is done to generate the iprefetch instruction at the call site fall through path. This optimization is enabled with microblaze target flag mxl-prefetch. The purpose of adding the flags is that selection of "wic" instruction should be enabled in the reconfigurable design and the selection is not enabled by default. ChangeLog: 2015-12-07 Ajit Agarwal * config/microblaze/microblaze.c (get_branch_target): New. (insert_wic_for_ilb_runout): New. (insert_wic): New. (microblaze_machine_dependent_reorg): New. (TARGET_MACHINE_DEPENDENT_REORG): Define macro. * config/microblaze/microblaze.md (UNSPEC_IPREFETCH): Define. (iprefetch): New pattern * config/microblaze/microblaze.opt (mxl-prefetch): New flag. Signed-off-by:Ajit Agarwal ajit...@xilinx.com Thanks & Regards Ajit -- Michael Eagerea...@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077 iprefetch.patch Description: iprefetch.patch
Re: [Patch,microblaze]: Instruction prefetch optimization for microblaze.
On 12/01/2015 12:49 AM, Ajit Kumar Agarwal wrote: The changes are made in this patch for the instruction prefetch optimizations for Microblaze. Reg tested for Microblaze target. The changes are made for instruction prefetch optimizations for Microblaze. The "wic" microblaze instruction is the instruction prefetch instruction. The instruction prefetch optimization is done to generate the iprefetch instruction at the call site fall through path. This optimization is enabled with microblaze target flag mxl-prefetch. The purpose of adding the flags is that selection of "wic" instruction should be enabled in the reconfigurable design and the selection is not enabled by default. ChangeLog: 2015-12-01 Ajit Agarwal * config/microblaze/microblaze.c (get_branch_target): New. (insert_wic_for_ilb_runout): New. (insert_wic): New. (microblaze_machine_dependent_reorg): New. (TARGET_MACHINE_DEPENDENT_REORG): Define macro. * config/microblaze/microblaze.md (UNSPEC_IPREFETCH): Define. (iprefetch): New pattern * config/microblaze/microblaze.opt (mxl-prefetch): New flag. Signed-off-by:Ajit Agarwal ajit...@xilinx.com Thanks & Regards Ajit + rtx_insn *insn, *before_4 = 0, *before_16 = 0; + int addr = 0, length, first_addr = -1; + int wic_addr0 = 128 * 4, wic_addr1 = 128 * 4; Especially when there are initializers, I prefer to see each variable declared on a separate line. If the meaning of a variable is not clear (and most of these are not), include a comment before the declaration. +if (first_addr == -1) + first_addr = INSN_ADDRESSES (INSN_UID (insn)); Can be moved to initialize first_addr. +addr = INSN_ADDRESSES (INSN_UID (insn)) - first_addr; Is "addr" and address or offset? If the latter, use a more descriptive name. +if (before_4 == 0 && addr + length >= 4 * 4) + before_4 = insn; ... Please add comments to describe what you are doing here. What are before_4 and before_16? What are all these conditions testing? + loop_optimizer_finalize(); Space before parens. -- Michael Eagerea...@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
RE: [Patch,microblaze]: Instruction prefetch optimization for microblaze.
Moreover this patch is tested and run on hardware with Mibench/EEMBC benchmarks for Microblaze target. The reconfigurable design is enabled with the selection of "wic" instruction prefetch instruction and above benchmarks compiled with -mxl-prefetch flags. Thanks & Regards Ajit -Original Message- From: Ajit Kumar Agarwal Sent: Tuesday, December 01, 2015 2:19 PM To: GCC Patches Cc: Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida; Nagaraju Mekala Subject: [Patch,microblaze]: Instruction prefetch optimization for microblaze. The changes are made in this patch for the instruction prefetch optimizations for Microblaze. Reg tested for Microblaze target. The changes are made for instruction prefetch optimizations for Microblaze. The "wic" microblaze instruction is the instruction prefetch instruction. The instruction prefetch optimization is done to generate the iprefetch instruction at the call site fall through path. This optimization is enabled with microblaze target flag mxl-prefetch. The purpose of adding the flags is that selection of "wic" instruction should be enabled in the reconfigurable design and the selection is not enabled by default. ChangeLog: 2015-12-01 Ajit Agarwal * config/microblaze/microblaze.c (get_branch_target): New. (insert_wic_for_ilb_runout): New. (insert_wic): New. (microblaze_machine_dependent_reorg): New. (TARGET_MACHINE_DEPENDENT_REORG): Define macro. * config/microblaze/microblaze.md (UNSPEC_IPREFETCH): Define. (iprefetch): New pattern * config/microblaze/microblaze.opt (mxl-prefetch): New flag. Signed-off-by:Ajit Agarwal ajit...@xilinx.com Thanks & Regards Ajit