mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-05 18:49:06 +00:00
[llvm-mca] pass the correct set of used registers in checkRAT.
We were incorrectly initializing the array of used registers in method checkRAT. As a consequence, the number of register file stalls was misreported. Added a test to cover this case. llvm-svn: 328629
This commit is contained in:
parent
8cd5d49067
commit
85c1e6c6b2
33
test/tools/llvm-mca/X86/BtVer2/register-files-3.s
Normal file
33
test/tools/llvm-mca/X86/BtVer2/register-files-3.s
Normal file
@ -0,0 +1,33 @@
|
||||
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -register-file-size=5 -iterations=2 -verbose -timeline < %s | FileCheck %s
|
||||
|
||||
idiv %eax
|
||||
|
||||
# CHECK: Iterations: 2
|
||||
# CHECK-NEXT: Instructions: 2
|
||||
|
||||
# CHECK: Instruction Info:
|
||||
# CHECK-NEXT: [1]: #uOps
|
||||
# CHECK-NEXT: [2]: Latency
|
||||
# CHECK-NEXT: [3]: RThroughput
|
||||
# CHECK-NEXT: [4]: MayLoad
|
||||
# CHECK-NEXT: [5]: MayStore
|
||||
# CHECK-NEXT: [6]: HasSideEffects
|
||||
|
||||
# CHECK: [1] [2] [3] [4] [5] [6] Instructions:
|
||||
# CHECK-NEXT: 2 25 25.00 * idivl %eax
|
||||
|
||||
|
||||
# CHECK: RAT - Register unavailable: 26
|
||||
|
||||
# CHECK: Register File statistics.
|
||||
# CHECK-NEXT: Register File #0
|
||||
# CHECK-NEXT: Total number of mappings created: 6
|
||||
# CHECK-NEXT: Max number of mappings used: 3
|
||||
|
||||
|
||||
# CHECK: Timeline view:
|
||||
# CHECK-NEXT: 0123456789 0123456789 01234
|
||||
# CHECK-NEXT: Index 0123456789 0123456789 0123456789
|
||||
|
||||
# CHECK: [0,0] DeeeeeeeeeeeeeeeeeeeeeeeeeER . . . . . . idivl %eax
|
||||
# CHECK: [1,0] . . . . . . DeeeeeeeeeeeeeeeeeeeeeeeeeER idivl %eax
|
@ -274,9 +274,11 @@ void RetireControlUnit::dump() const {
|
||||
#endif
|
||||
|
||||
bool DispatchUnit::checkRAT(unsigned Index, const Instruction &Instr) {
|
||||
const InstrDesc &Desc = Instr.getDesc();
|
||||
unsigned NumWrites = Desc.Writes.size();
|
||||
unsigned RegisterMask = RAT->isAvailable(NumWrites);
|
||||
SmallVector<unsigned, 4> RegDefs;
|
||||
for (const std::unique_ptr<WriteState> &RegDef : Instr.getDefs())
|
||||
RegDefs.emplace_back(RegDef->getRegisterID());
|
||||
|
||||
unsigned RegisterMask = RAT->isAvailable(RegDefs);
|
||||
// A mask with all zeroes means: register files are available.
|
||||
if (RegisterMask) {
|
||||
Owner->notifyStallEvent(
|
||||
|
Loading…
Reference in New Issue
Block a user