HomePhabricator

[QTOOL-37352] Consider isLegalAddressingImm in Constant Hoisting

Authored by Zhaoshi Zheng <zhaoshiz@coduaurora.org> on Aug 28 2018, 4:00 PM.

Description

[QTOOL-37352] Consider isLegalAddressingImm in Constant Hoisting

In Thumb1, legal imm range is [0, 255] for ADD/SUB instructions. However, the
legal imm range for LD/ST in (R+Imm) addressing mode is [0, 127]. Imms in
[128, 255] are materialized by mov R, #imm, and LD/STs use them in (R+R)
addressing mode.

This patch checks if a constant is used as offset in (R+Imm), if so, it checks
isLegalAddressingMode passing the constant value as BaseOffset.

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

llvm-svn: 340882

Details

Event Timeline

Zhaoshi Zheng <zhaoshiz@coduaurora.org> committed rG35818e27894d: [QTOOL-37352] Consider isLegalAddressingImm in Constant Hoisting (authored by Zhaoshi Zheng <zhaoshiz@coduaurora.org>).Aug 28 2018, 4:00 PM