@@ -208,8 +208,11 @@ private static boolean deriveRomForVoidMethod(SSAInvokeInstruction invokeInstruc
208
208
return true ;
209
209
else if (isTerminalOperationWhereReduceOrderDoesNotMatter (declaredTarget ))
210
210
return false ;
211
- else
212
- throw new IllegalStateException ("Can't decipher ROM for method: " + declaredTarget );
211
+ else {
212
+ boolean ret = true ;
213
+ LOGGER .warning (() -> "Can't decipher ROM for method: " + declaredTarget + ". Defaulting to: " + ret );
214
+ return ret ;
215
+ }
213
216
}
214
217
215
218
/**
@@ -558,7 +561,6 @@ private void discoverIfReduceOrderingPossiblyMatters(EclipseProjectAnalysisEngin
558
561
assert numOfRetVals <= 1 : "How could you possibly return " + numOfRetVals + " values?" ;
559
562
560
563
Collection <TypeAbstraction > possibleReturnTypes = null ;
561
- Boolean rom = null ;
562
564
563
565
// if it's a non-void method.
564
566
if (numOfRetVals > 0 ) {
@@ -567,63 +569,49 @@ private void discoverIfReduceOrderingPossiblyMatters(EclipseProjectAnalysisEngin
567
569
possibleReturnTypes = Util .getPossibleTypesInterprocedurally (block .getNode (), returnValue , engine ,
568
570
orderingInference );
569
571
570
- // if no return types can be found.
571
- if (possibleReturnTypes .isEmpty ()) {
572
- // default to true.
573
- rom = true ;
574
-
575
- LOGGER .warning ("Number of returned values is: " + numOfRetVals
576
- + " but cannot find possible return types for node: " + block .getNode ()
577
- + " and return value: " + returnValue + ". Defaulting ROM to: " + rom + " for block: "
578
- + block + "." );
579
- } else
580
- LOGGER .info ("While determining ROM, found number of possible return types: "
581
- + possibleReturnTypes .size ());
582
-
583
572
LOGGER .fine ("Possible reduce types are: " + possibleReturnTypes );
584
573
} else
585
574
// it's a void method.
586
575
possibleReturnTypes = Collections .singleton (JavaPrimitiveType .VOID );
587
576
588
- // if we haven't determined ROM yet.
589
- if (rom == null )
590
- if (isVoid (possibleReturnTypes ))
591
- rom = deriveRomForVoidMethod (invokeInstruction );
592
- else {
593
- boolean scalar = Util .isScalar (possibleReturnTypes );
594
- if (scalar )
595
- try {
596
- rom = deriveRomForScalarMethod (invokeInstruction );
597
- } catch (UnknownIfReduceOrderMattersException e ) {
598
- // for each possible receiver associated with the terminal block.
599
- OrdinalSet <InstanceKey > receivers = this .terminalBlockToPossibleReceivers .get (block );
600
-
601
- for (InstanceKey instanceKey : receivers ) {
602
- // get the stream for the instance key.
603
- Set <InstanceKey > originStreams = this .computePossibleOriginStreams (instanceKey );
604
-
605
- // for each origin stream.
606
- for (InstanceKey origin : originStreams ) {
607
- // get the "Stream" representing it.
608
- Stream stream = this .instanceToStreamMap .get (origin );
609
-
610
- if (stream == null )
611
- LOGGER .warning (() -> "Can't find Stream instance for instance key: "
612
- + instanceKey + " using origin: " + origin );
613
- else {
614
- LOGGER .log (Level .WARNING ,
615
- "Unable to derive ROM for : " + stream .getCreation (), e );
616
- stream .addStatusEntry (
617
- PreconditionFailure .NON_DETERMINABLE_REDUCTION_ORDERING ,
618
- "Cannot derive reduction ordering for stream: "
619
- + stream .getCreation () + "." );
620
- }
577
+ Boolean rom = null ;
578
+
579
+ if (isVoid (possibleReturnTypes ))
580
+ rom = deriveRomForVoidMethod (invokeInstruction );
581
+ else {
582
+ boolean scalar = Util .isScalar (possibleReturnTypes );
583
+ if (scalar )
584
+ try {
585
+ rom = deriveRomForScalarMethod (invokeInstruction );
586
+ } catch (UnknownIfReduceOrderMattersException e ) {
587
+ // for each possible receiver associated with the terminal block.
588
+ OrdinalSet <InstanceKey > receivers = this .terminalBlockToPossibleReceivers .get (block );
589
+
590
+ for (InstanceKey instanceKey : receivers ) {
591
+ // get the stream for the instance key.
592
+ Set <InstanceKey > originStreams = this .computePossibleOriginStreams (instanceKey );
593
+
594
+ // for each origin stream.
595
+ for (InstanceKey origin : originStreams ) {
596
+ // get the "Stream" representing it.
597
+ Stream stream = this .instanceToStreamMap .get (origin );
598
+
599
+ if (stream == null )
600
+ LOGGER .warning (() -> "Can't find Stream instance for instance key: "
601
+ + instanceKey + " using origin: " + origin );
602
+ else {
603
+ LOGGER .log (Level .WARNING , "Unable to derive ROM for : " + stream .getCreation (),
604
+ e );
605
+ stream .addStatusEntry (PreconditionFailure .NON_DETERMINABLE_REDUCTION_ORDERING ,
606
+ "Cannot derive reduction ordering for stream: " + stream .getCreation ()
607
+ + "." );
621
608
}
622
609
}
623
610
}
624
- else // !scalar
625
- rom = this .deriveRomForNonScalarMethod (possibleReturnTypes , orderingInference );
626
- }
611
+ }
612
+ else // !scalar
613
+ rom = this .deriveRomForNonScalarMethod (possibleReturnTypes , orderingInference );
614
+ }
627
615
628
616
// if reduce ordering matters.
629
617
if (rom != null )
0 commit comments