Re-commit: [MachineLICM] Add functions to MachineLICM to hoist invariant stores
authorZaara Syeda <syzaara@ca.ibm.com>
Fri, 23 Mar 2018 15:28:15 +0000 (15:28 +0000)
committerZaara Syeda <syzaara@ca.ibm.com>
Fri, 23 Mar 2018 15:28:15 +0000 (15:28 +0000)
commit65359936259224a1bdbc424445537d4f72f6180a
treeff00a665c9574fe95c889d2a62dd52d5e0b0dd08
parentd189b596ae313c500fee974a261939658cd7136a
Re-commit: [MachineLICM] Add functions to MachineLICM to hoist invariant stores

This patch adds functions to allow MachineLICM to hoist invariant stores.
Currently, MachineLICM does not hoist any store instructions, however
when storing the same value to a constant spot on the stack, the store
instruction should be considered invariant and be hoisted. The function
isInvariantStore iterates each operand of the store instruction and checks
that each register operand satisfies isCallerPreservedPhysReg. The store
may be fed by a copy, which is hoisted by isCopyFeedingInvariantStore.
This patch also adds the PowerPC changes needed to consider the stack
register as caller preserved.

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

llvm-svn: 328326
llvm/include/llvm/CodeGen/TargetRegisterInfo.h
llvm/lib/CodeGen/MachineLICM.cpp
llvm/lib/CodeGen/TargetRegisterInfo.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
llvm/lib/Target/PowerPC/PPCInstrInfo.h
llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
llvm/test/CodeGen/PowerPC/extra-toc-reg-deps.ll
llvm/test/CodeGen/PowerPC/loop-hoist-toc-save.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/ppc64-func-desc-hoist.ll