This is the mail archive of the
mailing list for the GCC project.
Re: Scheduling problem - A more detailed explain
- From: "吴曦" <wu dot andrew dot xi at gmail dot com>
- To: gcc <gcc at gcc dot gnu dot org>
- Cc: wilson at specifix dot com, xzfkiller at gmail dot com
- Date: Tue, 9 Oct 2007 08:49:27 +0800
- Subject: Re: Scheduling problem - A more detailed explain
"rws_access_reg should be handling this correctly. It uses
HARD_REGNO_NREGS to get the number of regs referred to by a reg rtl.
So it should return 64 in this case, and then it will iterate over all
64-bit PR regs when checking for a dependency."
I have found HARD_REGNO_NREGS in ia64.h
#define HARD_REGNO_NREGS(REGNO, MODE) \
((REGNO) == PR_REG (0) && (MODE) == DImode ? 64 \
As you stated above, it returns 64 for DImode pr0.
"We already have support for these move instructions. See the
movdi_internal pattern. Since there are 64 1-bit PR registers, we use
a DImode reference to pr0 to represent the entire set of PR registers.
Is this the RTL that you are using? Or do you have your own
representation? If different, what RTL are you using?"
I generate this mov instruction like this:
gen_movdi(gen_rtx_REG(DImode, PR_REG(0)), X);
here X is a general register. Further, I dump the rtl list and found
the generated insn, I think it is correct:
(insn 522 551 523 2 (set (reg:DI 8 r8)
(reg:DI 256 p0)) -1 (nil)
(insn 537 377 535 2 (set (reg:DI 256 p0)
(reg:DI 8 r8)) -1 (nil)
but the scheduling really produces wrong code :-<
Besides, I am using GCC-4.1.1 and I found rws_access_reg which handles
the dependencies for these mov instructions ...
rws_access_reg (rtx reg, struct reg_flags flags, int pred)
int regno = REGNO (reg);
int n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg));
if (n == 1)
return rws_access_regno (regno, flags, pred);
int need_barrier = 0;
while (--n >= 0)
need_barrier |= rws_access_regno (regno + n, flags, pred);
Well... Is there anything I miss or forget to do ?