RFR(S): 8085932: Fixing bugs in detecting memory alignments in SuperWord (original) (raw)

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Jun 30 22:34:22 UTC 2015


I forgot to publish updated webrev:

http://cr.openjdk.java.net/~kvn/8085932/webrev.01/

I will push it after Michael's "Vectorized loop unrolling" is reviewed and pushed.

Vladimir

On 6/25/15 5:57 PM, Vladimir Kozlov wrote:

Okay, this is better.

Thanks, Vladimir On 6/25/15 2:51 PM, Civlin, Jan wrote:

Vladimir, Here is the updated patch with trace hidden in a new nested class Trace, that contains all the messages. The Trace class is compiled only in NOTPRODUCT. Looks much simple now (of course more lines but all outside of the algorithmic part). Thank you, Jan. -----Original Message----- From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com] Sent: Thursday, June 18, 2015 5:11 PM To: Civlin, Jan; hotspot-compiler-dev at openjdk.java.net Subject: Re: RFR(S): 8085932: Fixing bugs in detecting memory alignments in SuperWord Thank you, Jan Fixes looks good but it would be nice if you replaced some tracing code with functions calls. In some place the execution code is hard to read because of big tracing code. For example, in SuperWord::memoryalignment() and in SWPointer methods. The one way to do that is to declare trace methods with empty body in product build, for example for SWPointer::scaledivplusoffset() you may have new method declaration (not under #ifdef) in superword.hpp: class SWPointer VALUEOBJCLASSSPEC { void trace1scaledivplusoffset(...) PRODUCTRETURN; and in superword.cpp you will put the method under ifdef: #ifndef PRODUCT void trace1scaledivplusoffset(...) { .... } #endif Then you can simply use it without ifdefs in code: bool SWPointer::scaledivplusoffset(Node* n) { + trace1scaledivplusoffset(...); + if (scalediv(n)) { Note, macro PRODUCTRETURN is defined as: #ifdef PRODUCT #define PRODUCTRETURN {} #else #define PRODUCTRETURN /next token must be ;/ #endif Thanks, Vladimir On 6/8/15 9:15 AM, Civlin, Jan wrote: Hi All,

We would like to contribute to Fixing bugs in detecting memory alignments in SuperWord. The contribution Bug ID: 8085932. Please review this patch: Bug-id: https://bugs.openjdk.java.net/browse/JDK-8085932 webrev: http://cr.openjdk.java.net/~kvn/8085932/webrev.00/ Description*: *Fixing bugs in detecting memory alignments in SuperWord Fixing bugs in detecting memory alignments in SuperWord: SWPointer::scaledivplusoffset (fixing here a bug in detection of "scale"), SWPointer::offsetplusk (fixing here a bug in detection of "invariant"), Add tracing output to the code that deal with memory alignment. The following routines are traceable: SWPointer::scaledivplusoffset SWPointer::offsetplusk SWPointer::scalediv, WPointer::SWPointer, SuperWord::memoryalignment Tracing is done only for NOTPRODUCT. Currently tracing is controlled by VectorizeDebug: #ifndef PRODUCT if (phase->C->method() != NULL) { phase->C->method()->hasoptionvalue("VectorizeDebug", vectorloopdebug); } #endif And VectorizeDebug may take any combination (bitwise OR) of the following values: bool istracealignment() { return (vectorloopdebug & 2) > 0; } bool istracememslice() { return (vectorloopdebug & 4) > 0; } bool istraceloop() { return (vectorloopdebug & 8) > 0; } bool istraceadjacent() { return (vectorloopdebug & 16) > 0; }



More information about the hotspot-compiler-dev mailing list