1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 21:13:02 +02:00
llvm-mirror/test/CodeGen/ARM/Windows/if-cvt-bundle.ll
Saleem Abdulrasool 4fbf1a0ae8 ARM: workaround bundled operation predication
This is a Windows ARM specific issue.  If the code path in the if conversion
ends up using a relocation which will form a IMAGE_REL_ARM_MOV32T, we end up
with a bundle to ensure that the mov.w/mov.t pair is not split up.  This is
normally fine, however, if the branch is also predicated, then we end up trying
to predicate the bundle.

For now, report a bundle as being unpredicatable.  Although this is false, this
would trigger a failure case previously anyways, so this is no worse.  That is,
there should not be any code which would previously have been if converted and
predicated which would not be now.

Under certain circumstances, it may be possible to "predicate the bundle".  This
would require scanning all bundle instructions, and ensure that the bundle
contains only predicatable instructions, and converting the bundle into an IT
block sequence.  If the bundle is larger than the maximal IT block length (4
instructions), it would require materializing multiple IT blocks from the single
bundle.

llvm-svn: 280689
2016-09-06 04:00:12 +00:00

25 lines
533 B
LLVM

; RUN: llc -mtriple thumbv7--windows-itanium -filetype asm -o - %s | FileCheck %s
declare void @llvm.trap()
declare arm_aapcs_vfpcc zeroext i1 @g()
define arm_aapcs_vfpcc i8* @f() {
entry:
%call = tail call arm_aapcs_vfpcc zeroext i1 @g()
br i1 %call, label %if.then, label %if.end
if.then:
ret i8* bitcast (i1 ()* @g to i8*)
if.end:
tail call void @llvm.trap()
unreachable
}
; CHECK: push.w {r11, lr}
; CHECK: bl g
; CHECK: movw [[REG:r[0-9]+]], :lower16:g
; CHECK: movt [[REG]], :upper16:g
; CHECK: pop.w {r11, pc}