@@ -902,21 +902,19 @@ SubtargetEmitter::FindWriteResources(const CodeGenSchedRW &SchedWrite,
902
902
for (Record *WR : ProcModel.WriteResDefs ) {
903
903
if (!WR->isSubClassOf (" WriteRes" ))
904
904
continue ;
905
- // If there is no AliasDef and we find a match, we can early exit since
906
- // there is no need to verify whether there are resources defined for both
907
- // SchedWrite and its alias.
908
905
Record *WRDef = WR->getValueAsDef (" WriteType" );
909
- if (!AliasDef && SchedWrite.TheDef == WRDef) {
910
- ResDef = WR;
911
- break ;
912
- }
913
- if (AliasDef == WRDef) {
906
+ if (AliasDef == WRDef || SchedWrite.TheDef == WRDef) {
914
907
if (ResDef) {
915
908
PrintFatalError (WR->getLoc (), " Resources are defined for both "
916
909
" SchedWrite and its alias on processor " +
917
910
ProcModel.ModelName );
918
911
}
919
912
ResDef = WR;
913
+ // If there is no AliasDef and we find a match, we can early exit since
914
+ // there is no need to verify whether there are resources defined for both
915
+ // SchedWrite and its alias.
916
+ if (!AliasDef)
917
+ break ;
920
918
}
921
919
}
922
920
// TODO: If ProcModel has a base model (previous generation processor),
@@ -963,21 +961,19 @@ Record *SubtargetEmitter::FindReadAdvance(const CodeGenSchedRW &SchedRead,
963
961
for (Record *RA : ProcModel.ReadAdvanceDefs ) {
964
962
if (!RA->isSubClassOf (" ReadAdvance" ))
965
963
continue ;
966
- // If there is no AliasDef and we find a match, we can early exit since
967
- // there is no need to verify whether there are resources defined for both
968
- // SchedRead and its alias.
969
964
Record *RADef = RA->getValueAsDef (" ReadType" );
970
- if (!AliasDef && SchedRead.TheDef == RADef) {
971
- ResDef = RA;
972
- break ;
973
- }
974
- if (AliasDef == RADef) {
965
+ if (AliasDef == RADef || SchedRead.TheDef == RADef) {
975
966
if (ResDef) {
976
967
PrintFatalError (RA->getLoc (), " Resources are defined for both "
977
968
" SchedRead and its alias on processor " +
978
969
ProcModel.ModelName );
979
970
}
980
971
ResDef = RA;
972
+ // If there is no AliasDef and we find a match, we can early exit since
973
+ // there is no need to verify whether there are resources defined for both
974
+ // SchedRead and its alias.
975
+ if (!AliasDef)
976
+ break ;
981
977
}
982
978
}
983
979
// TODO: If ProcModel has a base model (previous generation processor),
0 commit comments