Author: hans Date: Fri Jan 27 10:23:36 2017 New Revision: 293296 URL: http://llvm.org/viewvc/llvm-project?rev=293296&view=rev Log: Merging r292517: ------------------------------------------------------------------------ r292517 | rserge | 2017-01-19 12:27:11 -0800 (Thu, 19 Jan 2017) | 14 lines
[XRay][Arm] Enable back XRay testing on Arm32 and fix the failing tests Summary: Testing of XRay was occasionally disabled on 32-bit Arm targets (someone assumed that XRay was supported on 64-bit targets only). This patch should fix that problem. Also here the instruction&data cache incoherency problem is fixed, because it may be causing a test to fail. This patch is one of a series: see also - https://reviews.llvm.org/D28624 Reviewers: dberris, rengolin Reviewed By: rengolin Subscribers: llvm-commits, aemerson, rengolin, dberris, iid_iunknown Differential Revision: https://reviews.llvm.org/D28623 ------------------------------------------------------------------------ Modified: compiler-rt/branches/release_40/ (props changed) compiler-rt/branches/release_40/lib/xray/xray_arm.cc compiler-rt/branches/release_40/test/xray/lit.cfg Propchange: compiler-rt/branches/release_40/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Jan 27 10:23:36 2017 @@ -1 +1 @@ -/compiler-rt/trunk:293120 +/compiler-rt/trunk:292517,293120 Modified: compiler-rt/branches/release_40/lib/xray/xray_arm.cc URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_40/lib/xray/xray_arm.cc?rev=293296&r1=293295&r2=293296&view=diff ============================================================================== --- compiler-rt/branches/release_40/lib/xray/xray_arm.cc (original) +++ compiler-rt/branches/release_40/lib/xray/xray_arm.cc Fri Jan 27 10:23:36 2017 @@ -19,6 +19,8 @@ #include <atomic> #include <cassert> +extern "C" void __clear_cache(void* start, void* end); + namespace __xray { uint64_t cycleFrequency() XRAY_NEVER_INSTRUMENT { @@ -116,8 +118,8 @@ inline static bool patchSled(const bool // B #20 uint32_t *FirstAddress = reinterpret_cast<uint32_t *>(Sled.Address); + uint32_t *CurAddress = FirstAddress + 1; if (Enable) { - uint32_t *CurAddress = FirstAddress + 1; CurAddress = Write32bitLoadR0(CurAddress, reinterpret_cast<uint32_t>(FuncId)); CurAddress = @@ -125,6 +127,7 @@ inline static bool patchSled(const bool *CurAddress = uint32_t(PatchOpcodes::PO_BlxIp); CurAddress++; *CurAddress = uint32_t(PatchOpcodes::PO_PopR0Lr); + CurAddress++; std::atomic_store_explicit( reinterpret_cast<std::atomic<uint32_t> *>(FirstAddress), uint32_t(PatchOpcodes::PO_PushR0Lr), std::memory_order_release); @@ -133,6 +136,8 @@ inline static bool patchSled(const bool reinterpret_cast<std::atomic<uint32_t> *>(FirstAddress), uint32_t(PatchOpcodes::PO_B20), std::memory_order_release); } + __clear_cache(reinterpret_cast<char*>(FirstAddress), + reinterpret_cast<char*>(CurAddress)); return true; } Modified: compiler-rt/branches/release_40/test/xray/lit.cfg URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_40/test/xray/lit.cfg?rev=293296&r1=293295&r2=293296&view=diff ============================================================================== --- compiler-rt/branches/release_40/test/xray/lit.cfg (original) +++ compiler-rt/branches/release_40/test/xray/lit.cfg Fri Jan 27 10:23:36 2017 @@ -30,8 +30,14 @@ config.substitutions.append( # Default test suffixes. config.suffixes = ['.c', '.cc', '.cpp'] -if config.host_os not in ['Linux'] or config.host_arch.find('64') == -1: +if config.host_os not in ['Linux']: config.unsupported = True +elif '64' not in config.host_arch: + if 'arm' in config.host_arch: + if '-mthumb' in config.target_cflags: + config.unsupported = True + else: + config.unsupported = True # Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL # e.g. because the test sometimes passes, sometimes fails. _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits