OSDN Git Service

Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
authorGeoff Berry <gberry@codeaurora.org>
Fri, 1 Sep 2017 14:27:20 +0000 (14:27 +0000)
committerGeoff Berry <gberry@codeaurora.org>
Fri, 1 Sep 2017 14:27:20 +0000 (14:27 +0000)
commitd168a77ec3c791a1cf5db8bf613818eb41982300
tree6196a2a3087260958f870c1974a17f13c48e3859
parent50c7531ed47b183d1d1231cd2dbba336888fe0bb
Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"

Issues addressed since original review:
- Moved removal of dead instructions found by
  LiveIntervals::shrinkToUses() outside of loop iterating over
  instructions to avoid instructions being deleted while pointed to by
  iterator.
- Fixed ARMLoadStoreOptimizer bug exposed by this change in r311907.
- The pass no longer forwards COPYs to physical register uses, since
  doing so can break code that implicitly relies on the physical
  register number of the use.
- The pass no longer forwards COPYs to undef uses, since doing so
  can break the machine verifier by creating LiveRanges that don't
  end on a use (since the undef operand is not considered a use).

  [MachineCopyPropagation] Extend pass to do COPY source forwarding

  This change extends MachineCopyPropagation to do COPY source forwarding.

  This change also extends the MachineCopyPropagation pass to be able to
  be run during register allocation, after physical registers have been
  assigned, but before the virtual registers have been re-written, which
  allows it to remove virtual register COPY LiveIntervals that become dead
  through the forwarding of all of their uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312328 91177308-0d34-0410-b5e6-96231b3b80d8
78 files changed:
include/llvm/CodeGen/Passes.h
include/llvm/InitializePasses.h
lib/CodeGen/CodeGen.cpp
lib/CodeGen/MachineCopyPropagation.cpp
lib/CodeGen/TargetPassConfig.cpp
test/CodeGen/AArch64/aarch64-fold-lslfast.ll
test/CodeGen/AArch64/arm64-AdvSIMD-Scalar.ll
test/CodeGen/AArch64/arm64-zero-cycle-regmov.ll
test/CodeGen/AArch64/f16-instructions.ll
test/CodeGen/AArch64/flags-multiuse.ll
test/CodeGen/AArch64/merge-store-dependency.ll
test/CodeGen/AArch64/neg-imm.ll
test/CodeGen/AMDGPU/callee-special-input-sgprs.ll
test/CodeGen/AMDGPU/ret.ll
test/CodeGen/ARM/atomic-op.ll
test/CodeGen/ARM/swifterror.ll
test/CodeGen/Mips/llvm-ir/sub.ll
test/CodeGen/PowerPC/fma-mutate.ll
test/CodeGen/PowerPC/inlineasm-i64-reg.ll
test/CodeGen/PowerPC/tail-dup-layout.ll
test/CodeGen/SPARC/atomics.ll
test/CodeGen/Thumb/thumb-shrink-wrapping.ll
test/CodeGen/X86/2006-03-01-InstrSchedBug.ll
test/CodeGen/X86/arg-copy-elide.ll
test/CodeGen/X86/avg.ll
test/CodeGen/X86/avx-load-store.ll
test/CodeGen/X86/avx512-bugfix-25270.ll
test/CodeGen/X86/avx512-calling-conv.ll
test/CodeGen/X86/avx512-mask-op.ll
test/CodeGen/X86/avx512bw-intrinsics-upgrade.ll
test/CodeGen/X86/buildvec-insertvec.ll
test/CodeGen/X86/combine-fcopysign.ll
test/CodeGen/X86/complex-fastmath.ll
test/CodeGen/X86/divide-by-constant.ll
test/CodeGen/X86/fmaxnum.ll
test/CodeGen/X86/fminnum.ll
test/CodeGen/X86/fp128-i128.ll
test/CodeGen/X86/haddsub-2.ll
test/CodeGen/X86/haddsub-undef.ll
test/CodeGen/X86/half.ll
test/CodeGen/X86/inline-asm-fpstack.ll
test/CodeGen/X86/ipra-local-linkage.ll
test/CodeGen/X86/localescape.ll
test/CodeGen/X86/mul-i1024.ll
test/CodeGen/X86/mul-i512.ll
test/CodeGen/X86/mul128.ll
test/CodeGen/X86/pmul.ll
test/CodeGen/X86/powi.ll
test/CodeGen/X86/pr11334.ll
test/CodeGen/X86/pr29112.ll
test/CodeGen/X86/psubus.ll
test/CodeGen/X86/shrink-wrap-chkstk.ll
test/CodeGen/X86/sqrt-fastmath.ll
test/CodeGen/X86/sse1.ll
test/CodeGen/X86/sse3-avx-addsub-2.ll
test/CodeGen/X86/statepoint-live-in.ll
test/CodeGen/X86/statepoint-stack-usage.ll
test/CodeGen/X86/vec_fp_to_int.ll
test/CodeGen/X86/vec_int_to_fp.ll
test/CodeGen/X86/vec_minmax_sint.ll
test/CodeGen/X86/vec_shift4.ll
test/CodeGen/X86/vector-blend.ll
test/CodeGen/X86/vector-idiv-sdiv-128.ll
test/CodeGen/X86/vector-idiv-udiv-128.ll
test/CodeGen/X86/vector-rotate-128.ll
test/CodeGen/X86/vector-sext.ll
test/CodeGen/X86/vector-shift-ashr-128.ll
test/CodeGen/X86/vector-shift-lshr-128.ll
test/CodeGen/X86/vector-shift-shl-128.ll
test/CodeGen/X86/vector-shuffle-combining.ll
test/CodeGen/X86/vector-trunc-math.ll
test/CodeGen/X86/vector-zext.ll
test/CodeGen/X86/vselect-minmax.ll
test/CodeGen/X86/widen_conv-3.ll
test/CodeGen/X86/widen_conv-4.ll
test/CodeGen/X86/x86-shrink-wrap-unwind.ll
test/CodeGen/X86/x86-shrink-wrapping.ll
test/DebugInfo/X86/live-debug-variables.ll