This hook replaces inline asm with LLVM intrinsics. It was intended to match inline assembly implementations of bswap in libc headers and replace them more optimizable implementations. At this point, it has outlived its usefulness (see https://github.com/llvm/llvm-project/issues/156571#issuecomment-3247638412), as libc implementations no longer use inline assembly for this purpose. Additionally, it breaks the "black box" property of inline assembly, which some languages like Rust would like to guarantee. Fixes https://github.com/llvm/llvm-project/issues/156571.
12 lines
295 B
LLVM
12 lines
295 B
LLVM
; RUN: llc < %s -mtriple=arm-apple-darwin -mattr=+v6 | FileCheck %s
|
|
|
|
; rev inline assembly should be preserved as-is.
|
|
|
|
define i32 @t1(i32 %x) nounwind {
|
|
; CHECK-LABEL: t1:
|
|
; CHECK: InlineAsm
|
|
; CHECK: rev
|
|
%asmtmp = tail call i32 asm "rev $0, $1\0A", "=l,l"(i32 %x) nounwind
|
|
ret i32 %asmtmp
|
|
}
|