ARM: correct bundle generation for MOV32T relocations
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 21 May 2014 01:25:24 +0000 (01:25 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 21 May 2014 01:25:24 +0000 (01:25 +0000)
commit91bbc253bd8748562e082da37232c8d283f6f3b5
tree57ce9d7f6abf87d55eefbc2b265ac9d8fa3d8b62
parente648d75c607378d55765103c2ac554a2964b6280
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209267 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMExpandPseudoInsts.cpp
test/CodeGen/ARM/Windows/chkstk.ll
test/CodeGen/ARM/Windows/memset.ll
test/CodeGen/ARM/Windows/mov32t-bundling.ll [new file with mode: 0644]