]> granicus.if.org Git - llvm/commit
[MIR] Add simple PRE pass to MachineCSE
authorAnton Afanasyev <anton.a.afanasyev@gmail.com>
Fri, 3 May 2019 10:30:59 +0000 (10:30 +0000)
committerAnton Afanasyev <anton.a.afanasyev@gmail.com>
Fri, 3 May 2019 10:30:59 +0000 (10:30 +0000)
commitcc60a82400ced0576612dc57e3e9c4fe48b9ad8f
tree57644215606f0100fc68dbfb0b30dc3e36e3cf6d
parent88f274d0c01112c6c105da23b37c2bd1e796fe07
[MIR] Add simple PRE pass to MachineCSE

This is the second part of the commit fixing PR38917 (hoisting
partitially redundant machine instruction). Most of PRE (partitial
redundancy elimination) and CSE work is done on LLVM IR, but some of
redundancy arises during DAG legalization. Machine CSE is not enough
to deal with it. This simple PRE implementation works a little bit
intricately: it passes before CSE, looking for partitial redundancy
and transforming it to fully redundancy, anticipating that the next
CSE step will eliminate this created redundancy. If CSE doesn't
eliminate this, than created instruction will remain dead and eliminated
later by Remove Dead Machine Instructions pass.

The third part of the commit is supposed to refactor MachineCSE,
to make it more clear and to merge MachinePRE with MachineCSE,
so one need no rely on further Remove Dead pass to clear instrs
not eliminated by CSE.

First step: https://reviews.llvm.org/D54839

Fixes llvm.org/PR38917

Reviewers: RKSimon

Subscribers: hfinkel, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359870 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineCSE.cpp
test/CodeGen/Mips/internalfunc.ll
test/CodeGen/X86/avx2-masked-gather.ll
test/CodeGen/X86/masked_compressstore.ll
test/CodeGen/X86/masked_gather.ll
test/CodeGen/X86/masked_store.ll
test/CodeGen/X86/masked_store_trunc.ll
test/CodeGen/X86/masked_store_trunc_ssat.ll
test/CodeGen/X86/masked_store_trunc_usat.ll