]> granicus.if.org Git - llvm/commit
Elide stores which are overwritten without being observed.
authorNirav Dave <niravd@google.com>
Tue, 16 May 2017 19:43:56 +0000 (19:43 +0000)
committerNirav Dave <niravd@google.com>
Tue, 16 May 2017 19:43:56 +0000 (19:43 +0000)
commitacc2c1d71dada4b03aab20bebb325af3e7fb65cd
tree8546e2dbbb2d12a23c0db52d1554e6e98d490324
parent34eb467434a593e5a5218b9892b8692845e69069
Elide stores which are overwritten without being observed.

Summary:
In SelectionDAG, when a store is immediately chained to another store
to the same address, elide the first store as it has no observable
effects. This is causes small improvements dealing with intrinsics
lowered to stores.

Test notes:

* Many testcases overwrite store addresses multiple times and needed
  minor changes, mainly making stores volatile to prevent the
  optimization from optimizing the test away.

* Many X86 test cases optimized out instructions associated with
  associated with va_start.

* Note that test_splat in CodeGen/AArch64/misched-stp.ll no longer has
  dependencies to check and can probably be removed and potentially
  replaced with another test.

Reviewers: rnk, john.brawn

Subscribers: aemerson, rengolin, qcolombet, jyknight, nemanjai, nhaehnle, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303198 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/ldst-zero.ll
test/CodeGen/AArch64/misched-stp.ll
test/CodeGen/AMDGPU/global-constant.ll
test/CodeGen/ARM/2011-02-04-AntidepMultidef.ll
test/CodeGen/ARM/2012-10-04-AAPCS-byval-align8.ll
test/CodeGen/ARM/dag-combine-ldst.ll
test/CodeGen/MSP430/vararg.ll
test/CodeGen/Mips/msa/bmzi_bmnzi.ll
test/CodeGen/PowerPC/ppcf128sf.ll
test/CodeGen/SPARC/32abi.ll
test/CodeGen/SPARC/64abi.ll
test/CodeGen/SystemZ/swift-return.ll
test/CodeGen/Thumb/stack-access.ll
test/CodeGen/Thumb2/ldr-str-imm12.ll
test/CodeGen/X86/arg-copy-elide.ll
test/CodeGen/X86/nontemporal.ll
test/CodeGen/X86/store-narrow.ll
test/CodeGen/X86/swift-return.ll
test/CodeGen/X86/win32-spill-xmm.ll
test/CodeGen/X86/win64_sibcall.ll
test/CodeGen/X86/win64_vararg.ll
test/CodeGen/X86/x86-64-ms_abi-vararg.ll