RFA: Improve jump threading #2 of N
Jeff Law
law@redhat.com
Thu Apr 21 19:03:00 GMT 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/21/11 11:26, Steven Bosscher wrote:
>> Bootstrapped and regression tested on x86_64-unknown-linux-gnu. OK for
>> trunk?
>
> Would this also fix PR18046?
Not right now.
If we look at VRP2 (and this only affects VRP's jump threading) we have:
SSA form after inserting ASSERT_EXPRs
bar ()
{
int prephitmp.5;
int pretmp.4;
int i.0;
# BLOCK 2 freq:10000
# PRED: ENTRY [100.0%] (fallthru,exec)
# VUSE <.MEM_5(D)>
i.0_1 = i;
switch (i.0_1) <default: <L2>, case 0: <L0>>
# SUCC: 4 [71.0%] (exec) 3 [29.0%] (exec)
# BLOCK 3 freq:2900
# PRED: 2 [29.0%] (exec)
<L0>:
i.0_2 = ASSERT_EXPR <i.0_1, i.0_1 == 0>;
# .MEM_6 = VDEF <.MEM_5(D)>
foo ();
# VUSE <.MEM_6>
pretmp.4_8 = i;
# SUCC: 4 [100.0%] (fallthru,exec)
# BLOCK 4 freq:10000
# PRED: 2 [71.0%] (exec) 3 [100.0%] (fallthru,exec)
# .MEM_3 = PHI <.MEM_5(D)(2), .MEM_6(3)>
# prephitmp.5_9 = PHI <i.0_1(2), pretmp.4_8(3)>
<L2>:
switch (prephitmp.5_9) <default: <L6>, case 0: <L4>>
# SUCC: 6 [61.0%] (exec) 5 [39.0%] (exec)
# BLOCK 5 freq:3898
# PRED: 4 [39.0%] (exec)
<L4>:
# .MEM_7 = VDEF <.MEM_3>
foo ();
# SUCC: 6 [100.0%] (fallthru,exec)
# BLOCK 6 freq:10000
# PRED: 4 [61.0%] (exec) 5 [100.0%] (fallthru,exec)
# .MEM_4 = PHI <.MEM_3(4), .MEM_7(5)>
<L6>:
# VUSE <.MEM_4>
return;
# SUCC: EXIT [100.0%]
}
Note the lack of range information for i.0_1 for the default case of the
first switch. That's going to be a prerequisite for threading through
the second switch which its reached via the default path from the first
switch.
jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJNsGviAAoJEBRtltQi2kC79/AH/3jrM+zArf6l9tUlyO8dFF4T
IBfJW8oq94DQfwyahEh6yk1Qeh6YkV3e5GsmIpI3GAzimhekoXEKchdqbXvYfSvC
JNk5FmTlv5rc4SUL+rPLpOeVNxgj46LXjlgUh3d3Ino5PXW8uhal4qidMEPxhonA
HHgbwuvYdhLWrJYJ35mEP5HPQGLRTVQtCdpDz+8CXl9D8Cr87y93W+cOEXckhOGI
yJeUhTRYftVCOwDdVfzEgqM+3OkGq6PE0TEMh/OUA2zDfeTVfQ8/vv9T521X/DJW
v9a7JN0gQM+6Hp5MmpMnSpKCfmeKKXUpvisT/Cr0pHeXKthmbm1nwRFoHalYp5g=
=6WXP
-----END PGP SIGNATURE-----
More information about the Gcc-patches
mailing list