@@ -982,7 +982,9 @@ int GCNHazardRecognizer::checkVALUHazards(MachineInstr *VALU) {
982
982
const MachineOperand *ForwardedDst = getDstSelForwardingOperand (MI, ST);
983
983
if (ForwardedDst) {
984
984
return consumesDstSelForwardingOperand (VALU, ForwardedDst, TRI);
985
- } else if (MI.isInlineAsm ()) {
985
+ }
986
+
987
+ if (MI.isInlineAsm ()) {
986
988
// Assume inline asm has dst forwarding hazard
987
989
for (auto &Def : MI.all_defs ()) {
988
990
if (consumesDstSelForwardingOperand (VALU, &Def, TRI))
@@ -1098,35 +1100,35 @@ int GCNHazardRecognizer::checkInlineAsmHazards(MachineInstr *IA) {
1098
1100
WaitStatesNeeded =
1099
1101
std::max (WaitStatesNeeded, checkVALUHazardsHelper (Op, MRI));
1100
1102
}
1103
+ }
1104
+ }
1101
1105
1102
- if (ST.hasDstSelForwardingHazard ()) {
1103
- const int Shift16DefWaitstates = 1 ;
1106
+ if (ST.hasDstSelForwardingHazard ()) {
1107
+ const int Shift16DefWaitstates = 1 ;
1104
1108
1105
- auto IsShift16BitDefFn = [this , &IA](const MachineInstr &MI) {
1106
- const MachineOperand *Dst = getDstSelForwardingOperand (MI, ST);
1107
- // Assume inline asm reads the dst
1108
- if (Dst)
1109
- return true ;
1109
+ auto IsShift16BitDefFn = [this , &IA](const MachineInstr &MI) {
1110
+ const MachineOperand *Dst = getDstSelForwardingOperand (MI, ST);
1111
+ // Assume inline asm reads the dst
1112
+ if (Dst)
1113
+ return true ;
1110
1114
1111
- if (MI.isInlineAsm ()) {
1112
- // If MI is inline asm, assume it has dst forwarding hazard
1113
- for (auto &Op :
1114
- drop_begin (MI.operands (), InlineAsm::MIOp_FirstOperand)) {
1115
- if (Op.isReg () && IA->modifiesRegister (Op.getReg (), &TRI)) {
1116
- return true ;
1117
- }
1118
- }
1115
+ if (MI.isInlineAsm ()) {
1116
+ // If MI is inline asm, assume it has dst forwarding hazard
1117
+ for (auto &Op :
1118
+ drop_begin (MI.operands (), InlineAsm::MIOp_FirstOperand)) {
1119
+ if (Op.isReg () && IA->modifiesRegister (Op.getReg (), &TRI)) {
1120
+ return true ;
1119
1121
}
1122
+ }
1123
+ }
1120
1124
1121
- return false ;
1122
- };
1125
+ return false ;
1126
+ };
1123
1127
1124
- int WaitStatesNeededForDef =
1125
- Shift16DefWaitstates -
1126
- getWaitStatesSince (IsShift16BitDefFn, Shift16DefWaitstates);
1127
- WaitStatesNeeded = std::max (WaitStatesNeeded, WaitStatesNeededForDef);
1128
- }
1129
- }
1128
+ int WaitStatesNeededForDef =
1129
+ Shift16DefWaitstates -
1130
+ getWaitStatesSince (IsShift16BitDefFn, Shift16DefWaitstates);
1131
+ WaitStatesNeeded = std::max (WaitStatesNeeded, WaitStatesNeededForDef);
1130
1132
}
1131
1133
1132
1134
return WaitStatesNeeded;
0 commit comments