[PATCH] [PATCH]Select wide immediate offset into [Base+XReg] addressing mode
Hao Liu
Hao.Liu at arm.com
Fri Oct 10 18:52:18 PDT 2014
Hi Chad,
I think the logic about
if (isa<ConstantSDNode>(LHS) || isa<ConstantSDNode>(RHS))
can be removed as following reasons:
Firstly, only RHS can be constant. There is no situation that both LHS and RHS are constants (Such ADD will be optimized). Also, when there is only one constant operand in ADD, it will always adjust the constant to the RHS operand (See the test in my patch @t9). So my patch, only checks whether RHS is a constant node.
Then, the original logic checks and returns when the operand is constant. My patch improves this logic. When the constant is too wide to be encoded in [Register+Immdediate] addressing mode or in ADD/SUB, it will be selected in [Register+Register] addressing mode. Otherwise, it will still return false as original logic.
Is that make sense?
Thanks,
-Hao
http://reviews.llvm.org/D5477
More information about the llvm-commits
mailing list