AlwaysInlineIntrinsics and AbstractInliningPolicy.isIntrinsic

Christian Thalinger cthalinger at twitter.com
Thu Aug 10 12:20:02 UTC 2017


> On Aug 10, 2017, at 12:11 PM, Doug Simon <doug.simon at oracle.com> wrote:
> 
> 
>> On 10 Aug 2017, at 10:08, Christian Thalinger <cthalinger at twitter.com> wrote:
>> 
>> Currently looking at some inlining stuff and I noticed that AlwaysInlineIntrinsics in AbstractInliningPolicy.isIntrinsic doesn’t do anything since the two methods called (onlyIntrinsics and onlyForcedIntrinsics) have exactly the same implementation:
>> 
>>   protected boolean isIntrinsic(Replacements replacements, InlineInfo info) {
>>       if (AlwaysInlineIntrinsics.getValue(info.graph().getOptions())) {
>>           return onlyIntrinsics(replacements, info);
>>       } else {
>>           return onlyForcedIntrinsics(replacements, info);
>>       }
>>   }
>> 
>>   private static boolean onlyIntrinsics(Replacements replacements, InlineInfo info) {
>>       for (int i = 0; i < info.numberOfMethods(); i++) {
>>           if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) {
>>               return false;
>>           }
>>       }
>>       return true;
>>   }
>> 
>>   private static boolean onlyForcedIntrinsics(Replacements replacements, InlineInfo info) {
>>       for (int i = 0; i < info.numberOfMethods(); i++) {
>>           if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) {
>>               return false;
>>           }
>>       }
>>       return true;
>>   }
>> 
>> Am I missing something?
> 
> I don't think so - that code just looks wrong. I don't even know what a "force intrinsic" means.

Doug and I had an offline discussion about this.  AlwaysInlineIntrinsics can be useful if the inlining heuristic decides to not inline you intrinsic because in that case you are falling back to Java code.


More information about the graal-dev mailing list