1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=gvn -pass-remarks-analysis=gvn -S < %s | FileCheck %s
4 define ptr @ReplaceWithTidy(ptr %one, ptr %two, ptr %three) {
5 ; CHECK-LABEL: @ReplaceWithTidy(
7 ; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ONE:%.*]], align 8
8 ; CHECK-NEXT: store ptr [[TMP0]], ptr [[TMP0]], align 8
9 ; CHECK-NEXT: store ptr null, ptr [[TWO:%.*]], align 8
10 ; CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[TMP0]], align 8
11 ; CHECK-NEXT: store ptr [[TMP1]], ptr [[THREE:%.*]], align 8
12 ; CHECK-NEXT: ret ptr null
15 %0 = load ptr, ptr %one, align 8
16 store ptr %0, ptr %0, align 8
17 store ptr null, ptr %two, align 8
18 %1 = load ptr, ptr %0, align 8
19 store ptr %1, ptr %three, align 8