1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=gvn -S < %s | FileCheck %s
4 ; Check that !nontemporal metadata is preserved only if both original
5 ; instructions are marked.
6 define i64 @one_nontemporal(ptr %p) {
7 ; CHECK-LABEL: @one_nontemporal(
8 ; CHECK-NEXT: [[A:%.*]] = load i64, ptr [[P:%.*]], align 4
9 ; CHECK-NEXT: [[C:%.*]] = add i64 [[A]], [[A]]
10 ; CHECK-NEXT: ret i64 [[C]]
13 %b = load i64, ptr %p, !nontemporal !0
18 define i64 @both_nontemporal(ptr %p) {
19 ; CHECK-LABEL: @both_nontemporal(
20 ; CHECK-NEXT: [[A:%.*]] = load i64, ptr [[P:%.*]], align 4, !nontemporal !0
21 ; CHECK-NEXT: [[C:%.*]] = add i64 [[A]], [[A]]
22 ; CHECK-NEXT: ret i64 [[C]]
24 %a = load i64, ptr %p, !nontemporal !0
25 %b = load i64, ptr %p, !nontemporal !0