llvm-project/llvm/test/CodeGen/LoongArch
wanglei 407b613d73 [LoongArch] Add support for selecting constant materializations.
Integer materializing can generate LU12I_W, ORI, LU32I_D, LU52I_D and
ADDI_W instructions.

According to the sign-extended behavior of these instructions
(except ORI), the generated instruction sequence can be improved.

For example, load -1 into general register:
The ADDI_W instruction performs the operation that the [31:0] bit data
in the general register `rj` plus the 12-bit immediate `simm12` sign
extension 32-bit data; the resultant [31:0] bit is sign extension, then
written into the general register `rd`.

Normal sequence:

```
lu12i.w $a0, -1
ori $a0, $a0, 2048
```

Improved with sign-extended instruction:

```
addi.w $a0, $zero,  -1
```

Reviewed By: SixWeining, MaskRay

Differential Revision: https://reviews.llvm.org/D123290
2022-04-15 12:04:35 +08:00
..
ir-instruction [LoongArch] Construct codegen infra and generate first add instruction. 2022-03-31 11:57:07 +08:00
1ri.mir [LoongArch] Fix instruction definition 2022-04-02 18:08:29 +08:00
2r.mir [LoongArch] Add missing dollar prefix to register name in InstPrinter 2022-02-18 09:41:08 +08:00
2ri.mir [LoongArch] Add EncoderMethods for transformed immediate operands 2022-03-07 16:47:26 +08:00
3r.mir [LoongArch] Fix atomic instructions operands sequence 2022-02-19 09:22:10 +08:00
3ri.mir [LoongArch] Add EncoderMethods for transformed immediate operands 2022-03-07 16:47:26 +08:00
imm.ll [LoongArch] Add support for selecting constant materializations. 2022-04-15 12:04:35 +08:00
lit.local.cfg [LoongArch][test] (6/6) Add encoding and mnemonics tests 2022-02-10 10:23:34 +00:00
misc.mir [LoongArch] Add EncoderMethods for transformed immediate operands 2022-03-07 16:47:26 +08:00
target_support.ll