This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Add an AArch64 target
ClosedPublic

Authored by john.brawn on Jun 29 2018, 10:46 AM.

Details

Summary

The target does just enough to be able to run llvm-exegesis in latency mode for at least some opcodes.

Diff Detail

Repository
rL LLVM

Event Timeline

john.brawn created this revision.Jun 29 2018, 10:46 AM

Nice ! Can you please create an LLVMExegesisAArch64Test library in unittests/tools/llvm-exegesis/AArch64 with a Target.cpp test similar to what's in unittests/tools/llvm_exegesis/X86/Target.cpp ?

john.brawn updated this revision to Diff 153726.Jul 2 2018, 8:56 AM

Add a simple unit test.

eastig added a subscriber: eastig.Jul 2 2018, 9:05 AM
courbet accepted this revision.Jul 2 2018, 11:19 PM
This revision is now accepted and ready to land.Jul 2 2018, 11:19 PM
This revision was automatically updated to reflect the committed changes.
bjope added a subscriber: bjope.Jul 3 2018, 3:50 AM

Can't build unittests (I suspect this patch):

ninja: Entering directory `build-all'
[1/5] Preparing lit tests
[2/5] Linking CXX executable unittests/Target/AArch64/AArch64Tests
[3/5] Building CXX object unittests/tools/llvm-exegesis/AArch64/CMakeFiles/LLVMExegesisAArch64Tests.dir/TargetTest.cpp.o
FAILED: unittests/tools/llvm-exegesis/AArch64/CMakeFiles/LLVMExegesisAArch64Tests.dir/TargetTest.cpp.o 
/repo/app/clang/3.6/bin/clang++  -march=corei7  -DGTEST_HAS_RTTI=0 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_LANG_CXX11=1 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iunittests/tools/llvm-exegesis/AAr h64 -I../unittests/tools/llvm-exegesis/AArch64 -I/usr/include/libxml2 -Iinclude -I../include -I../tools/llvm-exegesis/lib -I../utils/unittest/googletest/include -I../utils/unittest/googlemock/include -I../lib/Target/AArch64 -Ilib/Target/AAr h64 -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wd lete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O3    -UNDEBUG  -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -fno-rtti -MMD -MT unittests/tools/llvm-exegesis/ Arch64/CMakeFiles/LLVMExegesisAArch64Tests.dir/TargetTest.cpp.o -MF unittests/tools/llvm-exegesis/AArch64/CMakeFiles/LLVMExegesisAArch64Tests.dir/TargetTest.cpp.o.d -o unittests/tools/llvm-exegesis/AArch64/CMakeFiles/LLVMExegesisAArch64Test .dir/TargetTest.cpp.o -c ../unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp
../unittests/tools/llvm-exegesis/AArch64/TargetTest.cpp:33:65: error: too few arguments to function call, expected 2, have 1
  const auto Insts = Target_->setRegToConstant(llvm::AArch64::X0);
                     ~~~~~~~~~~~~~~~~~~~~~~~~~                  ^
../tools/llvm-exegesis/lib/Target.h:37:3: note: 'setRegToConstant' declared here
  virtual std::vector<llvm::MCInst>
  ^
1 error generated.

Fixed in r336188.

John

bjope added a comment.Jul 3 2018, 4:01 AM

Fixed in r336188.

John

Great! Thanks alot for the quick fix!