2014-05-05 07:13:21 +08:00
|
|
|
; RUN: llc -mtriple thumbv7--windows-itanium -filetype asm -o - %s | FileCheck %s
|
|
|
|
|
|
|
|
@source = common global [512 x i8] zeroinitializer, align 4
|
|
|
|
|
2015-11-19 13:56:52 +08:00
|
|
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
2014-05-05 07:13:21 +08:00
|
|
|
|
|
|
|
define void @function() {
|
|
|
|
entry:
|
2015-11-19 13:56:52 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* bitcast ([512 x i8]* @source to i8*), i8 0, i32 512, i32 0, i1 false)
|
2014-05-05 07:13:21 +08:00
|
|
|
unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: movw r0, :lower16:source
|
|
|
|
; CHECK: movt r0, :upper16:source
|
ARM: correct bundle generation for MOV32T relocations
Although the previous code would construct a bundle and add the correct elements
to it, it would not finalise the bundle. This resulted in the InternalRead
markers not being added to the MachineOperands nor, more importantly, the
externally visible defs to the bundle itself. So, although the bundle was not
exposing the def, the generated code would be correct because there was no
optimisations being performed. When optimisations were enabled, the post
register allocator would kick in, and the hazard recognizer would reorder
operations around the load which would define the value being operated upon.
Rather than manually constructing the bundle, simply construct and finalise the
bundle via the finaliseBundle call after both MIs have been emitted. This
improves the code generation with optimisations where IMAGE_REL_ARM_MOV32T
relocations are emitted.
The changes to the other tests are the result of the bundle generation
preventing the scheduler from hoisting the moves across the loads. The net
effect of the generated code is equivalent, but, is much more identical to what
is actually being lowered.
llvm-svn: 209267
2014-05-21 09:25:24 +08:00
|
|
|
; CHECK: movs r1, #0
|
|
|
|
; CHECK: mov.w r2, #512
|
2014-05-05 07:13:21 +08:00
|
|
|
; CHECK: memset
|
|
|
|
|