[ARM] Fix correctness checks in promoteToConstantPool.
authorEli Friedman <efriedma@codeaurora.org>
Fri, 28 Sep 2018 20:27:31 +0000 (20:27 +0000)
committerEli Friedman <efriedma@codeaurora.org>
Fri, 28 Sep 2018 20:27:31 +0000 (20:27 +0000)
commit5ab09a684fd8759bac3cc824bb4550b0e5d7f4b8
treee133f4a45df8c997819a53e79a34f3f2c4bcf4ca
parent6f11db137034b38dbe2aabfa823ac0f2a7e3f9b9
[ARM] Fix correctness checks in promoteToConstantPool.

Correctly check for relocations in the constant to promote. And don't
allow promoting a constant multiple times.

This partially fixes https://bugs.llvm.org//show_bug.cgi?id=32780 ;
it's not a complete fix because we also need to prevent
ARMConstantIslands from cloning the constant.

(-arm-promote-constant is currently off by default, and it stays off
with this patch. I'll look into turning it on again when all the known
issues are fixed.)

Differential Revision: https://reviews.llvm.org/D51472

llvm-svn: 343361
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/constantpool-promote-dbg.ll
llvm/test/CodeGen/ARM/constantpool-promote.ll