[llvm] r211588 - [mips] Use __clear_cache builtin instead of cacheflush() in Unix Memory::InvalidateInstructionCache()

Daniel Sanders Daniel.Sanders at imgtec.com
Tue Jun 24 07:08:25 PDT 2014


Hi Duane, 

Buildbot has reported a failure on the llvm-mips-linux builder which is most likely caused by this commit. I've reverted it in r211594 to confirm whether it is this commit or r211587 (which was tested along with r211588 but for some reason doesn't appear on the blamelist).

The details are at http://lab.llvm.org:8011/builders/llvm-mips-linux/builds/9196. This test passed when I tested on a different MIPS host before commit.

> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
> bounces at cs.uiuc.edu] On Behalf Of Daniel Sanders
> Sent: 24 June 2014 13:27
> To: llvm-commits at cs.uiuc.edu
> Subject: [llvm] r211588 - [mips] Use __clear_cache builtin instead of
> cacheflush() in Unix Memory::InvalidateInstructionCache()
> 
> Author: dsanders
> Date: Tue Jun 24 07:26:49 2014
> New Revision: 211588
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=211588&view=rev
> Log:
> [mips] Use __clear_cache builtin instead of cacheflush() in Unix
> Memory::InvalidateInstructionCache()
> 
> MIPS64 Android bionic has removed cacheflush(). Use __clear_cache()
> instead for 32-bit and 64-bit MIPS
> 
> Patch by Duane Sand <Duane.Sand at imgtec.com>
> 
> 
> Modified:
>     llvm/trunk/lib/Support/Unix/Memory.inc
> 
> Modified: llvm/trunk/lib/Support/Unix/Memory.inc
> URL: http://llvm.org/viewvc/llvm-
> project/llvm/trunk/lib/Support/Unix/Memory.inc?rev=211588&r1=211587&r
> 2=211588&view=diff
> ==========================================================
> ====================
> --- llvm/trunk/lib/Support/Unix/Memory.inc (original)
> +++ llvm/trunk/lib/Support/Unix/Memory.inc Tue Jun 24 07:26:49 2014
> @@ -333,23 +333,15 @@ void Memory::InvalidateInstructionCache(
>    for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
>      asm volatile("icbi 0, %0" : : "r"(Line));
>    asm volatile("isync");
> -#  elif (defined(__arm__) || defined(__aarch64__)) &&
> defined(__GNUC__)
> +#  elif (defined(__arm__) || defined(__aarch64__) || defined(__mips__))
> +&& defined(__GNUC__)
>    // FIXME: Can we safely always call this for __GNUC__ everywhere?
> +  // Use compiler's builtin
>    const char *Start = static_cast<const char *>(Addr);
>    const char *End = Start + Len;
>    __clear_cache(const_cast<char *>(Start), const_cast<char *>(End));  #  elif
> defined(__mips__)
>    const char *Start = static_cast<const char *>(Addr);
> -#    if defined(ANDROID)
> -  // The declaration of "cacheflush" in Android bionic:
> -  // extern int cacheflush(long start, long end, long flags);
> -  const char *End = Start + Len;
> -  long LStart = reinterpret_cast<long>(const_cast<char *>(Start));
> -  long LEnd = reinterpret_cast<long>(const_cast<char *>(End));
> -  cacheflush(LStart, LEnd, BCACHE);
> -#    else
>    cacheflush(const_cast<char *>(Start), Len, BCACHE);
> -#    endif
>  #  endif
> 
>  #endif  // end apple
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list