1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/CodeGen/X86/safestack_inline.ll
Quentin Colombet 94dff8006e Revert "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
This reverts commit r323991.

This commit breaks target that don't model all the register constraints
in TableGen. So far the workaround was to set the
hasExtraXXXRegAllocReq, but it proves that it doesn't cover all the
cases.
For instance, when mutating an instruction (like in the lowering of
COPYs) the isRenamable flag is not properly updated. The same problem
will happen when attaching machine operand from one instruction to
another.

Geoff Berry is working on a fix in https://reviews.llvm.org/D43042.

llvm-svn: 325421
2018-02-17 03:05:33 +00:00

31 lines
919 B
LLVM

; RUN: sed -e "s/ATTR//" %s | llc -mtriple=x86_64-linux -safestack-use-pointer-address | FileCheck --check-prefix=INLINE %s
; RUN: sed -e "s/ATTR/noinline/" %s | llc -mtriple=x86_64-linux -safestack-use-pointer-address | FileCheck --check-prefix=CALL %s
@p = external thread_local global i8*, align 8
define nonnull i8** @__safestack_pointer_address() local_unnamed_addr ATTR {
entry:
ret i8** @p
}
define void @_Z1fv() safestack {
entry:
%x = alloca i32, align 4
%0 = bitcast i32* %x to i8*
call void @_Z7CapturePi(i32* nonnull %x)
ret void
}
declare void @_Z7CapturePi(i32*)
; INLINE: movq p@GOTTPOFF(%rip), %[[A:.*]]
; INLINE: movq %fs:(%[[A]]), %[[B:.*]]
; INLINE: leaq -16(%[[B]]), %[[C:.*]]
; INLINE: movq %[[C]], %fs:(%[[A]])
; CALL: callq __safestack_pointer_address
; CALL: movq %rax, %[[A:.*]]
; CALL: movq (%[[A]]), %[[B:.*]]
; CALL: leaq -16(%[[B]]), %[[C:.*]]
; CALL: movq %[[C]], (%[[A]])