@@ -201,18 +201,16 @@ private static boolean deriveRomForScalarMethod(SSAInvokeInstruction invokeInstr
201
201
return deriveRomForVoidMethod (invokeInstruction );
202
202
}
203
203
204
- private static boolean deriveRomForVoidMethod (SSAInvokeInstruction invokeInstruction ) {
204
+ private static boolean deriveRomForVoidMethod (SSAInvokeInstruction invokeInstruction )
205
+ throws UnknownIfReduceOrderMattersException {
205
206
MethodReference declaredTarget = invokeInstruction .getCallSite ().getDeclaredTarget ();
206
207
207
208
if (isTerminalOperationWhereReduceOrderMatters (declaredTarget ))
208
209
return true ;
209
210
else if (isTerminalOperationWhereReduceOrderDoesNotMatter (declaredTarget ))
210
211
return false ;
211
- else {
212
- boolean ret = true ;
213
- LOGGER .warning (() -> "Can't decipher ROM for method: " + declaredTarget + ". Defaulting to: " + ret );
214
- return ret ;
215
- }
212
+ else
213
+ throw new UnknownIfReduceOrderMattersException ("Can't decipher ROM for method: " + declaredTarget + "." );
216
214
}
217
215
218
216
/**
@@ -576,41 +574,39 @@ private void discoverIfReduceOrderingPossiblyMatters(EclipseProjectAnalysisEngin
576
574
577
575
Boolean rom = null ;
578
576
579
- if ( isVoid ( possibleReturnTypes ))
580
- rom = deriveRomForVoidMethod ( invokeInstruction );
581
- else {
582
- boolean scalar = Util . isScalar ( possibleReturnTypes );
583
- if ( scalar )
584
- try {
577
+ try {
578
+ if ( isVoid ( possibleReturnTypes ))
579
+ rom = deriveRomForVoidMethod ( invokeInstruction );
580
+ else {
581
+ boolean scalar = Util . isScalar ( possibleReturnTypes );
582
+ if ( scalar )
585
583
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
- + "." );
608
- }
609
- }
584
+ else // !scalar
585
+ rom = this .deriveRomForNonScalarMethod (possibleReturnTypes , orderingInference );
586
+ }
587
+ } catch (UnknownIfReduceOrderMattersException e ) {
588
+ // for each possible receiver associated with the terminal block.
589
+ OrdinalSet <InstanceKey > receivers = this .terminalBlockToPossibleReceivers .get (block );
590
+
591
+ for (InstanceKey instanceKey : receivers ) {
592
+ // get the stream for the instance key.
593
+ Set <InstanceKey > originStreams = this .computePossibleOriginStreams (instanceKey );
594
+
595
+ // for each origin stream.
596
+ for (InstanceKey origin : originStreams ) {
597
+ // get the "Stream" representing it.
598
+ Stream stream = this .instanceToStreamMap .get (origin );
599
+
600
+ if (stream == null )
601
+ LOGGER .warning (() -> "Can't find Stream instance for instance key: " + instanceKey
602
+ + " using origin: " + origin );
603
+ else {
604
+ LOGGER .log (Level .WARNING , "Unable to derive ROM for: " + stream .getCreation (), e );
605
+ stream .addStatusEntry (PreconditionFailure .NON_DETERMINABLE_REDUCTION_ORDERING ,
606
+ "Cannot derive reduction ordering for stream: " + stream .getCreation () + "." );
610
607
}
611
608
}
612
- else // !scalar
613
- rom = this .deriveRomForNonScalarMethod (possibleReturnTypes , orderingInference );
609
+ }
614
610
}
615
611
616
612
// if reduce ordering matters.
0 commit comments