diff --git a/lib/MCA/InstrBuilder.cpp b/lib/MCA/InstrBuilder.cpp index f79dca60d61..fa11beb711e 100644 --- a/lib/MCA/InstrBuilder.cpp +++ b/lib/MCA/InstrBuilder.cpp @@ -391,15 +391,7 @@ void InstrBuilder::populateWrites(InstrDesc &ID, const MCInst &MCI, if (!NumVariadicOps) return; - // FIXME: if an instruction opcode is flagged 'mayStore', and it has no - // "unmodeledSideEffects', then this logic optimistically assumes that any - // extra register operands in the variadic sequence is not a register - // definition. - // - // Otherwise, we conservatively assume that any register operand from the - // variadic sequence is both a register read and a register write. - bool AssumeUsesOnly = MCDesc.mayStore() && !MCDesc.mayLoad() && - !MCDesc.hasUnmodeledSideEffects(); + bool AssumeUsesOnly = !MCDesc.variadicOpsAreDefs(); CurrentDef = NumExplicitDefs + NumImplicitDefs + MCDesc.hasOptionalDef(); for (unsigned I = 0, OpIndex = MCDesc.getNumOperands(); I < NumVariadicOps && !AssumeUsesOnly; ++I, ++OpIndex) { @@ -466,12 +458,7 @@ void InstrBuilder::populateReads(InstrDesc &ID, const MCInst &MCI, CurrentUse += NumImplicitUses; - // FIXME: If an instruction opcode is marked as 'mayLoad', and it has no - // "unmodeledSideEffects", then this logic optimistically assumes that any - // extra register operand in the variadic sequence is not a register - // definition. - bool AssumeDefsOnly = !MCDesc.mayStore() && MCDesc.mayLoad() && - !MCDesc.hasUnmodeledSideEffects(); + bool AssumeDefsOnly = MCDesc.variadicOpsAreDefs(); for (unsigned I = 0, OpIndex = MCDesc.getNumOperands(); I < NumVariadicOps && !AssumeDefsOnly; ++I, ++OpIndex) { const MCOperand &Op = MCI.getOperand(OpIndex); diff --git a/test/tools/llvm-mca/ARM/cortex-a57-carryover.s b/test/tools/llvm-mca/ARM/cortex-a57-carryover.s index c058c028cbb..ec99d704f0e 100644 --- a/test/tools/llvm-mca/ARM/cortex-a57-carryover.s +++ b/test/tools/llvm-mca/ARM/cortex-a57-carryover.s @@ -80,6 +80,6 @@ # CHECK-NEXT: [3]: Average time elapsed from WB until retire stage # CHECK: [0] [1] [2] [3] -# CHECK-NEXT: 0. 10 5.5 0.1 0.0 pop {r3, r4, r5, r6, r7, pc} +# CHECK-NEXT: 0. 10 5.5 2.7 0.0 pop {r3, r4, r5, r6, r7, pc} # CHECK-NEXT: 1. 10 3.6 0.0 3.9 nop -# CHECK-NEXT: 10 4.6 0.1 2.0 +# CHECK-NEXT: 10 4.6 1.4 2.0