OSDN Git Service

[PowerPC] fold addi's imm operand to its imm form consumer's displacement
authorChen Zheng <czhengsz@cn.ibm.com>
Fri, 19 Jun 2020 03:31:51 +0000 (23:31 -0400)
committerChen Zheng <czhengsz@cn.ibm.com>
Tue, 23 Jun 2020 10:28:18 +0000 (06:28 -0400)
commit7ab05d9a60b00556fc3510f1695648dfbd8c457e
tree4548f31f3d4915e50691f64006ce06f09604082b
parentc8fae2bb4afed8073096860d23e5759055c9bf88
[PowerPC] fold addi's imm operand to its imm form consumer's displacement

This patch adds a function to do following transformation:

%0:g8rc_and_g8rc_nox0 = ADDI8 %5:g8rc_and_g8rc_nox0, 144
STD killed %7:g8rc, 16, %0:g8rc_and_g8rc_nox0 :: (store 8 into %ir.8)

------>

STD killed %7:g8rc, 160, %5:g8rc_and_g8rc_nox0 :: (store 8 into %ir.8)

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D81723
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.h
llvm/test/CodeGen/PowerPC/convert-ri-addi-to-ri.mir [new file with mode: 0644]