16 Commits

Author SHA1 Message Date
Andrea Di Biagio
3d7ae45ca1 [MCA] consistently use MCPhysReg instead of unsigned as register type. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369648 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-22 13:32:17 +00:00
Jonas Devlieghere
114087caa6 [llvm] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369013 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 15:54:37 +00:00
Andrea Di Biagio
955f528e07 [MCA] Slightly refactor the logic in ResourceManager. NFCI
This patch slightly changes the API in the attempt to simplify resource buffer
queries. It is done in preparation for a patch that will enable support for
macro fusion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368994 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 12:39:55 +00:00
Andrea Di Biagio
749bf3be5e [MCA] Ignore invalid processor resource writes of zero cycles. NFCI
In debug mode, the tool also raises a warning and prints out a message which
helps identify the problematic MCWriteProcResEntry from the scheduling class.
This message would have been useful to have when triaging PR42282.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363387 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 13:31:21 +00:00
Andrea Di Biagio
9943bec72b [MCA] Remove dead assignment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360237 91177308-0d34-0410-b5e6-96231b3b80d8
2019-05-08 10:28:56 +00:00
Andrea Di Biagio
6db31ea72b [MCA] Correctly update the UsedResourceGroups mask in the InstrBuilder.
Found by inspection when looking at the debug output of MCA.
This problem was latent, and none of the upstream models were affected by it.
No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357000 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 15:38:37 +00:00
Andrea Di Biagio
e9cd1e556a [MCA] Store a bitmask of used groups in the instruction descriptor.
This is to speedup 'checkAvailability' queries in class ResourceManager.
No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353949 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 14:56:06 +00:00
Andrea Di Biagio
6b6a90fb85 [MC][X86] Correctly model additional operand latency caused by transfer delays from the integer to the floating point unit.
This patch adds a new ReadAdvance definition named ReadInt2Fpu.
ReadInt2Fpu allows x86 scheduling models to accurately describe delays caused by
data transfers from the integer unit to the floating point unit.
ReadInt2Fpu currently defaults to a delay of zero cycles (i.e. no delay) for all
x86 models excluding BtVer2. That means, this patch is only a functional change
for the Jaguar cpu model only.

Tablegen definitions for instructions (V)PINSR* have been updated to account for
the new ReadInt2Fpu. That read is mapped to the the GPR input operand.
On Jaguar, int-to-fpu transfers are modeled as a +6cy delay. Before this patch,
that extra delay was added to the opcode latency. In practice, the insert opcode
only executes for 1cy. Most of the actual latency is actually contributed by the
so-called operand-latency. According to the AMD SOG for family 16h, (V)PINSR*
latency is defined by expression f+1, where f is defined as a forwarding delay
from the integer unit to the fpu.

When printing instruction latency from MCA (see InstructionInfoView.cpp) and LLC
(only when flag -print-schedule is speified), we now need to account for any
extra forwarding delays. We do this by checking if scheduling classes declare
any negative ReadAdvance entries. Quoting a code comment in TargetSchedule.td:
"A negative advance effectively increases latency, which may be used for
cross-domain stalls". When computing the instruction latency for the purpose of
our scheduling tests, we now add any extra delay to the formula. This avoids
regressing existing codegen and mca schedule tests. It comes with the cost of an
extra (but very simple) hook in MCSchedModel.

Differential Revision: https://reviews.llvm.org/D57056


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351965 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 16:35:07 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Andrea Di Biagio
437f3bdb23 [MCA] Fix wrong definition of ResourceUnitMask in DefaultResourceStrategy.
Field ResourceUnitMask was incorrectly defined as a 'const unsigned' mask. It
should have been a 64 bit quantity instead. That means, ResourceUnitMask was
always implicitly truncated to a 32 bit quantity.
This issue has been found by inspection. Surprisingly, that bug was latent, and
it never negatively affected any existing upstream targets.

This patch fixes  the wrong definition of ResourceUnitMask, and adds a bunch of
extra debug prints to help debugging potential issues related to invalid
processor resource masks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350820 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-10 13:59:13 +00:00
Evandro Menezes
bb50ac5e3f [llvm-mca] Display masks in hex
Display the resources masks as hexadecimal.  Otherwise, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350777 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 23:57:15 +00:00
Evandro Menezes
6fbbd583d5 [llvm-mca] Improve debugging (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350661 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 22:29:38 +00:00
Andrea Di Biagio
7fccc80ce9 [MCA] Improved handling of in-order issue/dispatch resources.
Added field 'MustIssueImmediately' to the instruction descriptor of instructions
that only consume in-order issue/dispatch processor resources.
This speeds up queries from the hardware Scheduler, and gives an average ~5%
speedup on a release build.

No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350397 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-04 15:08:38 +00:00
Andrea Di Biagio
765a7627d9 [MCA] Add support for BeginGroup/EndGroup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349354 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 14:27:33 +00:00
Andrea Di Biagio
4ed822d160 [MCA] Don't assume that createMCInstrAnalysis() always returns a valid pointer.
Class InstrBuilder wrongly assumed that llvm targets were always able to return
a non-null pointer when createMCInstrAnalysis() was called on them.
This was causing crashes when simulating executions for targets that don't
provide an MCInstrAnalysis object.
This patch fixes the issue by making MCInstrAnalysis optional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349352 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 14:00:37 +00:00
Clement Courbet
8178ac881e [llvm-mca] Move llvm-mca library to llvm/lib/MCA.
Summary: See PR38731.

Reviewers: andreadb

Subscribers: mgorny, javed.absar, tschuett, gbedwell, andreadb, RKSimon, llvm-commits

Differential Revision: https://reviews.llvm.org/D55557

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349332 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-17 08:08:31 +00:00