1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/tools/llvm-mca
Kai Nacke 02764e0318 Fix the triple used in llvm-mca.
lookupTarget() can update the passed triple argument. This happens
when no triple is given on the command line, and the architecture
argument does not match the architecture in the default triple.

For example, passing -march=aarch64 on the command line, and the
default triple being x86_64-windows-msvc, the triple is changed
to aarch64-windows-msvc.

However, this triple is not saved, and later in the code, the
triple is constructed again from the triple name, which is the
default triple at this point. Thus the default triple is passed
to constructor of MCSubtargetInfo instance.

The triple is only used determine the object file format, and by
chance, the AArch64 target also uses the COFF file format, and
all is fine. Obviously, the AArch64 target does not support all
available binary file formats, e.g. XCOFF and GOFF, and llvm-mca
crashes in this case.

The fix is to update the triple name with the changed triple
name for the target lookup. Then the default object file format
for the architecture is used, in the example ELF.

Reviewed By: andreadb, abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D100992
2021-04-22 14:27:09 -04:00
..
Views [MCA] Disable RCU for InOrderIssueStage 2021-03-24 13:54:04 +03:00
CMakeLists.txt [llvm-mca] Initial implementation of serialization using JSON. The views 2021-01-21 15:15:54 -08:00
CodeRegion.cpp [llvm] Remove redundant return and continue statements (NFC) 2021-01-14 20:30:34 -08:00
CodeRegion.h Avoid including FileSystem.h from MemoryBuffer.h 2020-02-29 12:30:23 -08:00
CodeRegionGenerator.cpp [MC] Make MCStreamer aware of AsmParser's StartTokLoc 2020-11-02 12:32:07 -08:00
CodeRegionGenerator.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-mca.cpp Fix the triple used in llvm-mca. 2021-04-22 14:27:09 -04:00
PipelinePrinter.cpp [llvm-mca] Initial implementation of serialization using JSON. The views 2021-01-21 15:15:54 -08:00
PipelinePrinter.h [llvm-mca] Initial implementation of serialization using JSON. The views 2021-01-21 15:15:54 -08:00