From 476b604150ff83df738d87e6b809c485446af0fa Mon Sep 17 00:00:00 2001 From: Sarwat Shaheen Date: Tue, 13 Feb 2024 11:57:21 -0500 Subject: [PATCH] Support enabling the inlining of OpenJ9 fmax/fmin/dmax/dmin nodes Add Math.max/min/F/D to list of recognized Java methods to: - Disable special aliasing rules since they are intrinsically optimized - Disable implicit asynchronous checks Signed-off-by: Sarwat Shaheen --- compiler/il/Aliases.cpp | 8 ++++++++ compiler/optimizer/RedundantAsyncCheckRemoval.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/compiler/il/Aliases.cpp b/compiler/il/Aliases.cpp index 4a531aca2f0..68cdfa8082b 100644 --- a/compiler/il/Aliases.cpp +++ b/compiler/il/Aliases.cpp @@ -238,6 +238,10 @@ OMR::SymbolReference::getUseonlyAliasesBV(TR::SymbolReferenceTable * symRefTab) case TR::java_lang_Math_min_I: case TR::java_lang_Math_max_L: case TR::java_lang_Math_min_L: + case TR::java_lang_Math_max_F: + case TR::java_lang_Math_min_F: + case TR::java_lang_Math_max_D: + case TR::java_lang_Math_min_D: case TR::java_lang_Math_abs_I: case TR::java_lang_Math_abs_L: case TR::java_lang_Math_abs_F: @@ -473,6 +477,10 @@ OMR::SymbolReference::getUseDefAliasesBV(bool isDirectCall, bool includeGCSafePo case TR::java_lang_Math_min_I: case TR::java_lang_Math_max_L: case TR::java_lang_Math_min_L: + case TR::java_lang_Math_max_F: + case TR::java_lang_Math_min_F: + case TR::java_lang_Math_max_D: + case TR::java_lang_Math_min_D: case TR::java_lang_Math_abs_I: case TR::java_lang_Math_abs_L: case TR::java_lang_Math_abs_F: diff --git a/compiler/optimizer/RedundantAsyncCheckRemoval.cpp b/compiler/optimizer/RedundantAsyncCheckRemoval.cpp index 72a74de7450..188dba8892c 100644 --- a/compiler/optimizer/RedundantAsyncCheckRemoval.cpp +++ b/compiler/optimizer/RedundantAsyncCheckRemoval.cpp @@ -402,6 +402,10 @@ bool TR_RedundantAsyncCheckRemoval::callDoesAnImplicitAsyncCheck(TR::Node *callN (symbol->getRecognizedMethod()==TR::java_lang_Math_min_I) || (symbol->getRecognizedMethod()==TR::java_lang_Math_max_L) || (symbol->getRecognizedMethod()==TR::java_lang_Math_min_L) || + (symbol->getRecognizedMethod()==TR::java_lang_Math_max_D) || + (symbol->getRecognizedMethod()==TR::java_lang_Math_min_D) || + (symbol->getRecognizedMethod()==TR::java_lang_Math_max_F) || + (symbol->getRecognizedMethod()==TR::java_lang_Math_min_F) || (symbol->getRecognizedMethod()==TR::java_lang_Math_abs_L) || (symbol->getRecognizedMethod()==TR::java_lang_Math_abs_D) || (symbol->getRecognizedMethod()==TR::java_lang_Math_abs_F) ||