[PATCH] Added a new register class for Thumb PC-rel loads

Daniel Stewart stewartd at codeaurora.org
Thu Aug 8 07:30:23 PDT 2013


This patch is for allowing a jump table (in Thumb mode) to not use the LR
register, which can branch mispredicts during a mov lr, pc. If it could be
reviewed, I'd appreciate it.

 

This patch does the following:

 

- Query for the GPRPair with gsub_1 in rGPR class.

This replaces the hard-coded reference

 

- Add jtGPR register class to be used by load PC relative

address for jump table that avoids the use of LR register.

This prevents the codegen from generating mov pc, lr

which causes the target to think it is returning

from a function and predict that the next address will

be in the calling function.

 

Daniel Stewart

-- 

Qualcomm Innovation Center, Inc is a member of Code Aurora Forum, hosted by
The Linux Foundation

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130808/f6e577b6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-register-class-with-no-LR-used-by-PC-rel-load.patch
Type: application/octet-stream
Size: 3762 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130808/f6e577b6/attachment.obj>


More information about the llvm-commits mailing list