Repository navigation
Prevent a SOF in TR_InductionVariableAnalysis::getEntryValue() - #6180
Conversation
0xdaryl
left a comment
There was a problem hiding this comment.
@jdmpapin did some offline analysis on how this situation could occur. I think it would be useful to surface at least a few sentences of that analysis in this PR to motivate the fix and provide context in where the problem could occur.
| TR_PredecessorIterator pit(block); | ||
| TR::Node *defValue = (TR::Node *)-1; | ||
| for (TR::CFGEdge *edge = pit.getFirst(); edge; edge = pit.getNext()) | ||
| const int32_t maxDepth=500; |
There was a problem hiding this comment.
Can you make this settable by a environment variable, defaulting to 500?
There was a problem hiding this comment.
How does "TR_IVAMaxDepth" sound? Maybe you or @jdmpapin can think of a more appropriate env var name?
There was a problem hiding this comment.
Maybe TR_IVAEntryValueMaxDistance or TR_IVAEntryValueMaxDepth?
There was a problem hiding this comment.
TR_IVAEntryValueMaxDistance seems reasonable to me.
There was a problem hiding this comment.
TR_IVAEntryValueMaxDistanceseems reasonable to me.
@0xdaryl Oops.. I just saw your comment just after pushing a change to use TR_IVAEntryValueMaxDepth. I'll change it if you think it's worth doing??
There was a problem hiding this comment.
No problem. I'm fine with what you have.
|
|
|
@klangman, you can include my description in the commit message if you like |
In extreme cases the recursion in getEntryValue() can cause a SOF when compiling large methods. This change will prevent the SOF by introducing a depth parameter that will prevent the recursion from exceeding a maximum depth and therefore preventing a SOF condition. Signed-off-by: Kevin Langman <langman@ca.ibm.com>
|
Jenkins build all |
|
@0xdaryl Everything but RISC-V tests passed.. Maybe that's an unrelated problem that happens without my change? |
|
RISC-V timeout is not related to this PR. Merging. |
In extreme cases the recursion in getEntryValue() can cause a SOF
when compiling large methods. This change will prevent the SOF by
introducing a depth parameter that will prevent the recursion from
exceeding a maximum depth and therefore preventing a SOF condition.
Signed-off-by: Kevin Langman langman@ca.ibm.com