JDK-8001336 : C2: Implement Bitwise Liveness Analysis
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs25,9,10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2012-10-23
  • Updated: 2021-04-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
In the long term, we should think about adding bitwise liveness analysis into the system, instead of using pattern matching.  If the live bits out of a LoadB are contained in 0xFF, then we can transform to LoadUB.

Doing this would require a type system that can represent per-bit liveness, and an analysis phase that pushes such types backwards through the graph.  That is a straightforward extension of our existing type system, augmenting the existing arithmetic range endpoints with corresponding bit masks.

��� John

Comments
Here is an example, adapted from a Panama benchmark posted by Maurizio: public int align_loop() { int sum = 0; int i1 = 0; // T_i1 = Int(0,0,0,0) //lo/hi/dn/up int i2 = phi(i1, __); for (;;) { // T_i2 = Int(0, (ES-1)&~AM, 0, BITSUPP(ES-1)&~AM) int i3 = i2 + AL; // T_i3 = Int(0, T_i2.hi + AL, 0, BITSUPP(T_i2.up + AL)&~AM) if (!(i3 < ES)) break; // T_i3 = T_i2 int tval = i3 & AM; // T_tval = Int(0,0,0,0) if (tval != 0) // if (0 != 0) { throw new AssertionError(); } sum += i; i2 = phi(i1, i3); } return sum; } // where Int(lo,hi,dn,up) := // type of x:int requiring // lo<=x && x<=hi && (~x|dn)==-1 && (~x&up)==0 // where BITSUPP(x) := HOBIT(x)*2 - 1 -- bit support mask // where HOBIT(x) := 1<<floor(lg(x)) -- highest one bit // Internal formula used to derive T_i3 in CCP: // T(x+y) := Int(lo, hi, dn, up) where // T_x = T(x), T_y = T(y), // lo = T_x.lo + T_y.lo, up = T_x.lo + T_y.up, --(ignoring overflow!) // p = T_x.up + T_y.up, q = T_x.dn ^ T_x.up, r = T_y.dn ^ T_y.up, // dn = p&~(q|r), up = p|q|r
28-05-2020

Back propagation of bitwise types may provide a framework for liveness analysis. Non-live bits can be represented as top (_dn = 1, _up = 0).
24-10-2012

Related changes: http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/67f4c477c9ab
23-10-2012