[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 405/437: Add a second pass to compute live register rang
From: |
Andy Wingo |
Subject: |
[Guile-commits] 405/437: Add a second pass to compute live register ranges |
Date: |
Mon, 2 Jul 2018 05:15:04 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit d7614993153b4e4da323b52acf78bd4dc3cbcfa7
Author: pcpa <address@hidden>
Date: Tue May 9 13:27:37 2017 -0400
Add a second pass to compute live register ranges
* include/lightning/jit_private.h, lib/lightning.c: Add a
second pass from start when computing register live ranges.
This should be used temporarily, and is required for certain
loop constructs, with several consecutive blocks not referencing
a live register.
---
ChangeLog | 8 ++++++++
include/lightning/jit_private.h | 1 +
lib/lightning.c | 17 ++++++++++++++++-
3 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index baf1069..97263f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-06-09 Paulo Andrade <address@hidden>
+
+ * include/lightning/jit_private.h, lib/lightning.c: Add a
+ second pass from start when computing register live ranges.
+ This should be used temporarily, and is required for certain
+ loop constructs, with several consecutive blocks not referencing
+ a live register.
+
2016-05-05 Paulo Andrade <address@hidden>
* lib/lightning.c: Correct wrong movr simplification,
diff --git a/include/lightning/jit_private.h b/include/lightning/jit_private.h
index 0730439..05db0b0 100644
--- a/include/lightning/jit_private.h
+++ b/include/lightning/jit_private.h
@@ -379,6 +379,7 @@ struct jit_block {
jit_node_t *label;
jit_regset_t reglive;
jit_regset_t regmask;
+ jit_regset_t setmask; /* Used for forward second pass */
};
struct jit_value {
diff --git a/lib/lightning.c b/lib/lightning.c
index 0dfec48..d6b033c 100644
--- a/lib/lightning.c
+++ b/lib/lightning.c
@@ -1560,8 +1560,10 @@ _jit_optimize(jit_state_t *_jit)
block = _jitc->blocks.ptr + offset;
if (!block->label)
continue;
- if (block->label->code != jit_code_epilog)
+ if (block->label->code != jit_code_epilog) {
jit_setup(block);
+ jit_regset_set(&block->setmask, &block->regmask);
+ }
}
/* call jit_update resolving undefined values in reverse
* order so that sequential code would find most data already
@@ -1575,6 +1577,19 @@ _jit_optimize(jit_state_t *_jit)
jit_update(block->label->next, &block->reglive, &_jitc->regmask);
}
}
+ /* do a second pass from start to properly handle some conditions
+ * of very long living registers that are not referenced for
+ * several blocks */
+ bmp_zero();
+ for (offset = 0; offset < _jitc->blocks.offset; offset++) {
+ block = _jitc->blocks.ptr + offset;
+ if (!block->label)
+ continue;
+ if (block->label->code != jit_code_epilog) {
+ jit_regset_set(&_jitc->regmask, &block->setmask);
+ jit_update(block->label->next, &block->reglive, &_jitc->regmask);
+ }
+ }
patch_registers();
simplify();
- [Guile-commits] 178/437: Update texinfo documentation to match current implementation., (continued)
- [Guile-commits] 178/437: Update texinfo documentation to match current implementation., Andy Wingo, 2018/07/02
- [Guile-commits] 392/437: Bump library major., Andy Wingo, 2018/07/02
- [Guile-commits] 398/437: ia64: Pass all tests for variadic jit functions, Andy Wingo, 2018/07/02
- [Guile-commits] 397/437: Implement new synthesized IR codes sequences, Andy Wingo, 2018/07/02
- [Guile-commits] 410/437: GNU lightning 2.1.2 release, Andy Wingo, 2018/07/02
- [Guile-commits] 270/437: x86: Use aligned offset for x87 to/from sse move., Andy Wingo, 2018/07/02
- [Guile-commits] 302/437: Add info menu entry for lightning, Andy Wingo, 2018/07/02
- [Guile-commits] 214/437: Remove remaining ia64 port debug code., Andy Wingo, 2018/07/02
- [Guile-commits] 331/437: mips: Do not make t9 available as a generic register, Andy Wingo, 2018/07/02
- [Guile-commits] 287/437: ARM: Do not leave early init_jit if /proc is not mounted., Andy Wingo, 2018/07/02
- [Guile-commits] 405/437: Add a second pass to compute live register ranges,
Andy Wingo <=
- [Guile-commits] 300/437: Add consistency check on temporaries during a jump, Andy Wingo, 2018/07/02
- [Guile-commits] 276/437: Rewrite jit_regset_scan1 for easier optimization., Andy Wingo, 2018/07/02
- [Guile-commits] 268/437: Sync after regenerating version.texi., Andy Wingo, 2018/07/02
- [Guile-commits] 277/437: x86_64: Correct wrong inline assembly in jit_get_cpu, Andy Wingo, 2018/07/02
- [Guile-commits] 360/437: Correct wrong check in simplify_stxi., Andy Wingo, 2018/07/02
- [Guile-commits] 389/437: alpha: Save correct offset if loading a vararg double., Andy Wingo, 2018/07/02
- [Guile-commits] 380/437: ppc: Add initial jit_va_ calls to ppc, Andy Wingo, 2018/07/02
- [Guile-commits] 239/437: Avoid possible problem if built with gcc 4.8 or newer., Andy Wingo, 2018/07/02
- [Guile-commits] 347/437: S390: Add support for 32 bit., Andy Wingo, 2018/07/02
- [Guile-commits] 428/437: Further lightning integration work, Andy Wingo, 2018/07/02