summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/intrinsics.cc
diff options
context:
space:
mode:
authorRazvan A Lupusoru <razvan.a.lupusoru@intel.com>2015-03-27 13:44:44 -0700
committerRazvan A Lupusoru <razvan.a.lupusoru@intel.com>2015-03-27 14:56:51 -0700
commit3e90a96f403cbc353731e6687fe12a088f996cee (patch)
tree544800c12984b975ae45658093a04f5662aebfd4 /compiler/optimizing/intrinsics.cc
parentd68cef75a2b57b5c5ab33065d567446b4510b143 (diff)
downloadart-3e90a96f403cbc353731e6687fe12a088f996cee.tar.gz
art-3e90a96f403cbc353731e6687fe12a088f996cee.tar.bz2
art-3e90a96f403cbc353731e6687fe12a088f996cee.zip
[optimizing] Do not inline intrinsics
The intrinsics generally have specialized code and the code for them may be faster than what can be achieved with inlining. Thus inliner should skip intrinsics. At the same time, easy methods are not worth intrinsifying: ie String length and isEmpty. Those can be handled by inliner with no problem and can actually lead to better code since call is not kept around through all of the optimizations. Change-Id: Iab38e6c33f79efa54d845d4871cf26fa9b235ab0 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
Diffstat (limited to 'compiler/optimizing/intrinsics.cc')
-rw-r--r--compiler/optimizing/intrinsics.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/optimizing/intrinsics.cc b/compiler/optimizing/intrinsics.cc
index 36cf8568e..628a844cc 100644
--- a/compiler/optimizing/intrinsics.cc
+++ b/compiler/optimizing/intrinsics.cc
@@ -191,8 +191,10 @@ static Intrinsics GetIntrinsic(InlineMethod method) {
case kIntrinsicCompareTo:
return Intrinsics::kStringCompareTo;
case kIntrinsicIsEmptyOrLength:
- return ((method.d.data & kIntrinsicFlagIsEmpty) == 0) ?
- Intrinsics::kStringLength : Intrinsics::kStringIsEmpty;
+ // The inliner can handle these two cases - and this is the preferred approach
+ // since after inlining the call is no longer visible (as opposed to waiting
+ // until codegen to handle intrinsic).
+ return Intrinsics::kNone;
case kIntrinsicIndexOf:
return ((method.d.data & kIntrinsicFlagBase0) == 0) ?
Intrinsics::kStringIndexOfAfter : Intrinsics::kStringIndexOf;