@@ -904,14 +904,17 @@ SubtargetEmitter::FindWriteResources(const CodeGenSchedRW &SchedWrite,
904
904
continue ;
905
905
if (AliasDef == WR->getValueAsDef (" WriteType" ) ||
906
906
SchedWrite.TheDef == WR->getValueAsDef (" WriteType" )) {
907
- if (ResDef) {
908
- PrintFatalError (WR->getLoc (), " Resources are defined for both "
909
- " SchedWrite and its alias on processor " +
910
- ProcModel.ModelName );
911
- }
912
907
ResDef = WR;
908
+ break ;
913
909
}
914
910
}
911
+
912
+ if (ResDef && AliasDef) {
913
+ PrintFatalError (ResDef->getLoc (), " Resources are defined for both "
914
+ " SchedWrite and its alias on processor " +
915
+ ProcModel.ModelName );
916
+ }
917
+
915
918
// TODO: If ProcModel has a base model (previous generation processor),
916
919
// then call FindWriteResources recursively with that model here.
917
920
if (!ResDef) {
@@ -958,14 +961,16 @@ Record *SubtargetEmitter::FindReadAdvance(const CodeGenSchedRW &SchedRead,
958
961
continue ;
959
962
if (AliasDef == RA->getValueAsDef (" ReadType" ) ||
960
963
SchedRead.TheDef == RA->getValueAsDef (" ReadType" )) {
961
- if (ResDef) {
962
- PrintFatalError (RA->getLoc (), " Resources are defined for both "
963
- " SchedRead and its alias on processor " +
964
- ProcModel.ModelName );
965
- }
966
964
ResDef = RA;
965
+ break ;
967
966
}
968
967
}
968
+ if (ResDef && AliasDef) {
969
+ PrintFatalError (ResDef->getLoc (), " Resources are defined for both "
970
+ " SchedRead and its alias on processor " +
971
+ ProcModel.ModelName );
972
+ }
973
+
969
974
// TODO: If ProcModel has a base model (previous generation processor),
970
975
// then call FindReadAdvance recursively with that model here.
971
976
if (!ResDef && SchedRead.TheDef ->getName () != " ReadDefault" ) {
0 commit comments