mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-27 06:54:30 +00:00
eb996ef33b
Summary: This change extends MachineCopyPropagation to do COPY source forwarding and adds an additional run of the pass to the default pass pipeline just after register allocation. This version of this patch uses the newly added MachineOperand::isRenamable bit to avoid forwarding registers is such a way as to violate constraints that aren't captured in the Machine IR (e.g. ABI or ISA constraints). This change is a continuation of the work started in D30751. Reviewers: qcolombet, javed.absar, MatzeB, jonpa, tstellar Subscribers: tpr, mgorny, mcrosier, nhaehnle, nemanjai, jyknight, hfinkel, arsenm, inouehrs, eraman, sdardis, guyblank, fedor.sergeev, aheejin, dschuff, jfb, myatsina, llvm-commits Differential Revision: https://reviews.llvm.org/D41835 llvm-svn: 323991
31 lines
917 B
LLVM
31 lines
917 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 (%rax), %[[B:.*]]
|
|
; CALL: leaq -16(%[[B]]), %[[C:.*]]
|
|
; CALL: movq %[[C]], (%[[A]])
|