if (StoreSDNode *ST1 = dyn_cast<StoreSDNode>(Chain)) {
if (ST->isUnindexed() && ST->isSimple() &&
ST1->isUnindexed() && ST1->isSimple()) {
- if (OptLevel != CodeGenOpt::None && ST1->getBasePtr() == Ptr &&
- ST1->getValue() == Value && ST->getMemoryVT() == ST1->getMemoryVT() &&
+ if (ST1->getBasePtr() == Ptr && ST1->getValue() == Value &&
+ ST->getMemoryVT() == ST1->getMemoryVT() &&
ST->getAddressSpace() == ST1->getAddressSpace()) {
// If this is a store followed by a store with the same value to the
// same location, then the store is dead/noop.
+++ /dev/null
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s | FileCheck %s
-
-; This test case makes sure that the same store will not get optimize out by DAGCombiner
-; and verify that codegen has those stores in it. It will help to improve debug experience.
-
-define dso_local void @foo(i32* %p) noinline nounwind optnone {
-; CHECK-LABEL: foo:
-; CHECK: # %bb.0:
-; CHECK-NEXT: li a1, 8
-; CHECK-NEXT: sw a1, 0(a0)
-; CHECK-NEXT: sw a1, 0(a0)
-; CHECK-NEXT: ret
- store i32 8, i32* %p, align 4
- store i32 8, i32* %p, align 4
- ret void
-}