OSDN Git Service

Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
authorGeoff Berry <gberry@codeaurora.org>
Mon, 2 Oct 2017 22:01:37 +0000 (22:01 +0000)
committerGeoff Berry <gberry@codeaurora.org>
Mon, 2 Oct 2017 22:01:37 +0000 (22:01 +0000)
commitd990d2886427e26b1037906378edc25af7ea1e8e
treee87373ca52ff429f235e757763e67eae6ca20361
parent311d8cc3a28d9e5a7fb836b2e99f9ad5fcf8b3a8
Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"

Issues addressed since original review:
- Avoid bug in regalloc greedy/machine verifier when forwarding to use
  in an instruction that re-defines the same virtual register.
- Fixed bug when forwarding to use in EarlyClobber instruction slot.
- Fixed incorrect forwarding to register definitions that showed up in
  explicit_uses() iterator (e.g. in INLINEASM).
- 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@314729 91177308-0d34-0410-b5e6-96231b3b80d8
90 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/mad-mix.ll
test/CodeGen/AMDGPU/ret.ll
test/CodeGen/ARM/atomic-op.ll
test/CodeGen/ARM/intrinsics-overflow.ll
test/CodeGen/ARM/swifterror.ll
test/CodeGen/Mips/llvm-ir/sub.ll
test/CodeGen/PowerPC/fma-mutate.ll
test/CodeGen/PowerPC/gpr-vsr-spill.ll
test/CodeGen/PowerPC/inlineasm-i64-reg.ll
test/CodeGen/PowerPC/opt-li-add-to-addi.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/avx512-schedule.ll
test/CodeGen/X86/avx512bw-intrinsics-upgrade.ll
test/CodeGen/X86/buildvec-insertvec.ll
test/CodeGen/X86/combine-fcopysign.ll
test/CodeGen/X86/combine-shl.ll
test/CodeGen/X86/complex-fastmath.ll
test/CodeGen/X86/divide-by-constant.ll
test/CodeGen/X86/fmaxnum.ll
test/CodeGen/X86/fmf-flags.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/machine-cp.ll
test/CodeGen/X86/mul-i1024.ll
test/CodeGen/X86/mul-i512.ll
test/CodeGen/X86/mul128.ll
test/CodeGen/X86/mulvi32.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-mul.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-interleaved-access.ll
test/CodeGen/X86/x86-shrink-wrap-unwind.ll
test/CodeGen/X86/x86-shrink-wrapping.ll
test/DebugInfo/X86/live-debug-variables.ll
test/DebugInfo/X86/spill-nospill.ll