[PATCH] D51032: [ARM] Avoid injecting constant islands in movw+movt pairs on Windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 03:30:38 PDT 2018


mstorsjo created this revision.
mstorsjo added reviewers: peter.smith, compnerd, efriedma, smeenai, ruiu.
Herald added a reviewer: javed.absar.
Herald added subscribers: chrib, kristof.beyls.

On Windows, movw+movt pairs with relocations are handled with a single relocation that covers them both. Therefore we can't  inject anything between these instructions, otherwise the relocation (which in LLVM only is treated as the movw instruction's relocation, while the movt instruction's relocation is dropped) will end up bogus.

The test case (which is based on compiling LLVM itself for ARM/windows) isn't great though; after reducing it in size, I had to randomly tweak the test case until the code generator happened to produce instructions in exactly the right order so that the constant island pass otherwise would inject the middle of the movw+movt pair. Any scheduler/optimizer change can potentially make the testcase useless.


Repository:
  rL LLVM

https://reviews.llvm.org/D51032

Files:
  lib/Target/ARM/ARMConstantIslandPass.cpp
  test/CodeGen/ARM/constant-island-movwt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51032.161680.patch
Type: text/x-patch
Size: 34326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180821/4e49b771/attachment-0001.bin>


More information about the llvm-commits mailing list