Files
clang-p2996/llvm/test/Transforms/DeadStoreElimination/atomic-overlapping.ll
Nikita Popov 176bbcae11 [DSE] Remove MemDep-based implementation
The MemorySSA-based implementation has been enabled without issue
for a while now, so keeping the old implementation around doesn't
seem useful anymore. This drops the MemDep-based implementation.

Differential Revision: https://reviews.llvm.org/D97877
2021-03-07 18:17:31 +01:00

26 lines
1018 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -dse %s -S | FileCheck %s
target datalayout = "e-m:o-p:32:32-Fi8-i64:64-a:0:32-n32-S128"
define void @widget(i8* %ptr) {
; CHECK-LABEL: @widget(
; CHECK-NEXT: bb:
; CHECK-NEXT: [[PTR1:%.*]] = getelementptr inbounds i8, i8* [[PTR:%.*]], i32 4
; CHECK-NEXT: [[PTR1_CAST:%.*]] = bitcast i8* [[PTR1]] to i32*
; CHECK-NEXT: store atomic i32 0, i32* [[PTR1_CAST]] monotonic, align 4
; CHECK-NEXT: [[PTR2:%.*]] = getelementptr inbounds i8, i8* [[PTR]], i32 0
; CHECK-NEXT: [[PTR2_CAST:%.*]] = bitcast i8* [[PTR2]] to i64**
; CHECK-NEXT: store i64* null, i64** [[PTR2_CAST]], align 4
; CHECK-NEXT: ret void
;
bb:
%ptr1 = getelementptr inbounds i8, i8* %ptr, i32 4
%ptr1.cast = bitcast i8* %ptr1 to i32*
store atomic i32 0, i32* %ptr1.cast monotonic, align 4
%ptr2 = getelementptr inbounds i8, i8* %ptr, i32 0
%ptr2.cast = bitcast i8* %ptr2 to i64**
store i64* null, i64** %ptr2.cast, align 4
ret void
}