@@ -1002,15 +1002,15 @@ private module DataFlowIntegrationInput implements SsaImpl::DataFlowIntegrationI
1002
1002
result instanceof FalseEdge
1003
1003
}
1004
1004
1005
- class GuardValue = Boolean ;
1005
+ class GuardValue = IRGuards :: GuardValue ;
1006
1006
1007
1007
class Guard instanceof IRGuards:: IRGuardCondition {
1008
1008
string toString ( ) { result = super .toString ( ) }
1009
1009
1010
1010
predicate hasValueBranchEdge ( IRCfg:: BasicBlock bb1 , IRCfg:: BasicBlock bb2 , GuardValue branch ) {
1011
1011
exists ( EdgeKind kind |
1012
1012
super .getBlock ( ) = bb1 and
1013
- kind = getConditionalEdge ( branch ) and
1013
+ kind = getConditionalEdge ( branch . asBooleanValue ( ) ) and
1014
1014
bb1 .getSuccessor ( kind ) = bb2
1015
1015
)
1016
1016
}
@@ -1023,7 +1023,7 @@ private module DataFlowIntegrationInput implements SsaImpl::DataFlowIntegrationI
1023
1023
}
1024
1024
1025
1025
predicate guardDirectlyControlsBlock ( Guard guard , IRCfg:: BasicBlock bb , GuardValue branch ) {
1026
- guard .( IRGuards:: IRGuardCondition ) .controls ( bb , branch )
1026
+ guard .( IRGuards:: IRGuardCondition ) .valueControls ( bb , branch )
1027
1027
}
1028
1028
1029
1029
predicate keepAllPhiInputBackEdges ( ) { any ( ) }
@@ -1050,25 +1050,35 @@ module BarrierGuardWithIntParam<guardChecksNodeSig/4 guardChecksNode> {
1050
1050
)
1051
1051
}
1052
1052
1053
- private predicate guardChecks (
1054
- DataFlowIntegrationInput :: Guard g , SsaImpl :: Definition def ,
1055
- DataFlowIntegrationInput :: GuardValue branch , int indirectionIndex
1053
+ private predicate guardChecksInstr (
1054
+ IRGuards :: Guards_v1 :: Guard g , IRGuards :: GuardsInput :: Expr instr , boolean branch ,
1055
+ int indirectionIndex
1056
1056
) {
1057
- exists ( UseImpl use |
1058
- guardChecksNode ( g , use . getNode ( ) , branch , indirectionIndex ) and
1059
- ssaDefReachesCertainUse ( def , use )
1057
+ exists ( Node node |
1058
+ nodeHasInstruction ( node , instr , indirectionIndex ) and
1059
+ guardChecksNode ( g , node , branch , indirectionIndex )
1060
1060
)
1061
1061
}
1062
1062
1063
+ private predicate guardChecksWithWrappers (
1064
+ DataFlowIntegrationInput:: Guard g , SsaImpl:: Definition def , IRGuards:: GuardValue val ,
1065
+ int indirectionIndex
1066
+ ) {
1067
+ IRGuards:: Guards_v1:: ValidationWrapperWithState< int , guardChecksInstr / 4 > :: guardChecksDef ( g , def ,
1068
+ val , indirectionIndex )
1069
+ }
1070
+
1063
1071
Node getABarrierNode ( int indirectionIndex ) {
1064
1072
// Only get the SynthNodes from the shared implementation, as the ExprNodes cannot
1065
1073
// be matched on SourceVariable.
1066
1074
result .( SsaSynthNode ) .getSynthNode ( ) =
1067
- DataFlowIntegrationImpl:: BarrierGuardDefWithState< int , guardChecks / 4 > :: getABarrierNode ( indirectionIndex )
1075
+ DataFlowIntegrationImpl:: BarrierGuardDefWithState< int , guardChecksWithWrappers / 4 > :: getABarrierNode ( indirectionIndex )
1068
1076
or
1069
1077
// Calculate the guarded UseImpls corresponding to ExprNodes directly.
1070
- exists ( DataFlowIntegrationInput:: Guard g , boolean branch , Definition def , IRBlock bb |
1071
- guardChecks ( g , def , branch , indirectionIndex ) and
1078
+ exists (
1079
+ DataFlowIntegrationInput:: Guard g , IRGuards:: GuardValue branch , Definition def , IRBlock bb
1080
+ |
1081
+ guardChecksWithWrappers ( g , def , branch , indirectionIndex ) and
1072
1082
exists ( UseImpl use |
1073
1083
ssaDefReachesCertainUse ( def , use ) and
1074
1084
use .getBlock ( ) = bb and
0 commit comments