summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-07-30 02:41:01 +0000
committerJim Grosbach <grosbach@apple.com>2010-07-30 02:41:01 +0000
commit6ccfc507dc1f7ad8c8964193a2407264ca644f0d (patch)
treeb4787ea45b22034f291c85e70fd1650dc01d7955 /utils
parent436ed471cc70f632dbcd1e82cb8e90d2c0f91ccd (diff)
downloadllvm-6ccfc507dc1f7ad8c8964193a2407264ca644f0d.tar.gz
llvm-6ccfc507dc1f7ad8c8964193a2407264ca644f0d.tar.bz2
llvm-6ccfc507dc1f7ad8c8964193a2407264ca644f0d.tar.xz
Many Thumb2 instructions can reference the full ARM register set (i.e.,
have 4 bits per register in the operand encoding), but have undefined behavior when the operand value is 13 or 15 (SP and PC, respectively). The trivial coalescer in linear scan sometimes will merge a copy from SP into a subsequent instruction which uses the copy, and if that instruction cannot legally reference SP, we get bad code such as: mls r0,r9,r0,sp instead of: mov r2, sp mls r0, r9, r0, r2 This patch adds a new register class for use by Thumb2 that excludes the problematic registers (SP and PC) and is used instead of GPR for those operands which cannot legally reference PC or SP. The trivial coalescer explicitly requires that the register class of the destination for the COPY instruction contain the source register for the COPY to be considered for coalescing. This prevents errant instructions like that above. PR7499 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/EDEmitter.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/utils/TableGen/EDEmitter.cpp b/utils/TableGen/EDEmitter.cpp
index 93786ee0de..50ff9ea070 100644
--- a/utils/TableGen/EDEmitter.cpp
+++ b/utils/TableGen/EDEmitter.cpp
@@ -578,6 +578,7 @@ static void X86ExtractSemantics(
static int ARMFlagFromOpName(LiteralConstantEmitter *type,
const std::string &name) {
REG("GPR");
+ REG("rGPR");
REG("tcGPR");
REG("cc_out");
REG("s_cc_out");