@@ -905,11 +905,12 @@ SubtargetEmitter::FindWriteResources(const CodeGenSchedRW &SchedWrite,
905
905
// If there is no AliasDef and we find a match, we can early exit since
906
906
// there is no need to verify whether there are resources defined for both
907
907
// SchedWrite and its alias.
908
- if (!AliasDef && SchedWrite.TheDef == WR->getValueAsDef (" WriteType" )) {
908
+ Record *WRDef = WR->getValueAsDef (" WriteType" );
909
+ if (!AliasDef && SchedWrite.TheDef == WRDef) {
909
910
ResDef = WR;
910
911
break ;
911
- }
912
- if (AliasDef == WR-> getValueAsDef ( " WriteType " ) ) {
912
+ }
913
+ if (AliasDef == WRDef ) {
913
914
if (ResDef) {
914
915
PrintFatalError (WR->getLoc (), " Resources are defined for both "
915
916
" SchedWrite and its alias on processor " +
@@ -965,11 +966,12 @@ Record *SubtargetEmitter::FindReadAdvance(const CodeGenSchedRW &SchedRead,
965
966
// If there is no AliasDef and we find a match, we can early exit since
966
967
// there is no need to verify whether there are resources defined for both
967
968
// SchedRead and its alias.
968
- if (!AliasDef && SchedRead.TheDef == RA->getValueAsDef (" ReadType" )) {
969
+ Record *RADef = RA->getValueAsDef (" ReadType" );
970
+ if (!AliasDef && SchedRead.TheDef == RADef) {
969
971
ResDef = RA;
970
972
break ;
971
973
}
972
- if (AliasDef == RA-> getValueAsDef ( " ReadType " ) ) {
974
+ if (AliasDef == RADef ) {
973
975
if (ResDef) {
974
976
PrintFatalError (RA->getLoc (), " Resources are defined for both "
975
977
" SchedRead and its alias on processor " +
0 commit comments