diff options
author | Justus Fasse <justus.fasse@etu.univ-grenoble-alpes.fr> | 2021-08-17 14:49:28 +0200 |
---|---|---|
committer | Justus Fasse <justus.fasse@etu.univ-grenoble-alpes.fr> | 2021-08-17 14:49:28 +0200 |
commit | 8ac2401ef5daea824b58e6e3424dd216a41b2d6d (patch) | |
tree | 08c9b3493ce0b46b4b7f3a623bed79b066e84535 | |
parent | f12837be269708acf02cdf1e191fd6bcc5cc26ec (diff) | |
download | compcert-kvx-8ac2401ef5daea824b58e6e3424dd216a41b2d6d.tar.gz compcert-kvx-8ac2401ef5daea824b58e6e3424dd216a41b2d6d.zip |
Modified logic to detect inner loops spanned by a superblock
-rw-r--r-- | scheduling/MyRTLpathScheduleraux.ml | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scheduling/MyRTLpathScheduleraux.ml b/scheduling/MyRTLpathScheduleraux.ml index db47797f..2cf58d2e 100644 --- a/scheduling/MyRTLpathScheduleraux.ml +++ b/scheduling/MyRTLpathScheduleraux.ml @@ -1307,11 +1307,18 @@ let scheduler f = (* sanity check; a superblock contains at least one instruction *) assert (Array.length sb.instructions >= 1); (* Check if first instruction of a superblock is the beginning of an inner loop*) - match PTree.get sb.instructions.(0) ilmap with + let first_pc = sb.instructions.(0) in + match PTree.get first_pc ilmap with | None -> false | Some(il) -> (* List.length il.body = Array.length sb.instructions *) - Option.is_some il.sb_final (* don't bother if the loop is not predicted to loop *) - && List.length il.body = Array.length sb.instructions (* Make sure the loop does not exceed the superblock *) + (match il.sb_final with + (* don't bother if the loop is not predicted to loop *) + | None -> false + | Some pc -> + pc == first_pc (* loop is spanned by the superblock *) + (* Make sure the loop does not exceed the superblock *) + && List.length il.body = Array.length sb.instructions + ) ) superblocks in |