Skip to content

Commit 775f644

Browse files
fixup! cache local variable
1 parent d70b201 commit 775f644

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

llvm/utils/TableGen/SubtargetEmitter.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -905,11 +905,12 @@ SubtargetEmitter::FindWriteResources(const CodeGenSchedRW &SchedWrite,
905905
// If there is no AliasDef and we find a match, we can early exit since
906906
// there is no need to verify whether there are resources defined for both
907907
// SchedWrite and its alias.
908-
if (!AliasDef && SchedWrite.TheDef == WR->getValueAsDef("WriteType")) {
908+
Record *WRDef = WR->getValueAsDef("WriteType");
909+
if (!AliasDef && SchedWrite.TheDef == WRDef) {
909910
ResDef = WR;
910911
break;
911-
}
912-
if (AliasDef == WR->getValueAsDef("WriteType")) {
912+
}
913+
if (AliasDef == WRDef) {
913914
if (ResDef) {
914915
PrintFatalError(WR->getLoc(), "Resources are defined for both "
915916
"SchedWrite and its alias on processor " +
@@ -965,11 +966,12 @@ Record *SubtargetEmitter::FindReadAdvance(const CodeGenSchedRW &SchedRead,
965966
// If there is no AliasDef and we find a match, we can early exit since
966967
// there is no need to verify whether there are resources defined for both
967968
// SchedRead and its alias.
968-
if (!AliasDef && SchedRead.TheDef == RA->getValueAsDef("ReadType")) {
969+
Record *RADef = RA->getValueAsDef("ReadType");
970+
if (!AliasDef && SchedRead.TheDef == RADef) {
969971
ResDef = RA;
970972
break;
971973
}
972-
if (AliasDef == RA->getValueAsDef("ReadType")) {
974+
if (AliasDef == RADef) {
973975
if (ResDef) {
974976
PrintFatalError(RA->getLoc(), "Resources are defined for both "
975977
"SchedRead and its alias on processor " +

0 commit comments

Comments
 (0)