[LoongArch] Merge the 12bit constant address into the offset field of the instruction
authorgonglingqin <gonglingqin@loongson.cn>
Wed, 8 Feb 2023 08:08:08 +0000 (16:08 +0800)
committergonglingqin <gonglingqin@loongson.cn>
Wed, 8 Feb 2023 08:57:11 +0000 (16:57 +0800)
commit653d823ad22b83fea3019e94e02f8ad99a33b4c0
tree9634c8641062e266934a5edfa694c5b9455b2022
parent1782e8f9e882e8f4fb59968ff555c8c93827ea02
[LoongArch] Merge the 12bit constant address into the offset field of the instruction

There are 12bit offset fields in the ld.[b/h/w/d] and st.[b/h/w/d].
When the constant address is less than 12 bits, the address
calculation is incorporated into the offset field of the instruction.

Differential Revision: https://reviews.llvm.org/D143470
llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp
llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.h
llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
llvm/test/CodeGen/LoongArch/load-store-offset.ll