1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -S -globals-aa -early-cse-memssa -earlycse-debug-hash | FileCheck %s
3
4define i16 @f1() readonly {
5  ret i16 0
6}
7
8declare void @f2()
9
10; Check that EarlyCSE correctly handles function calls that don't have
11; a MemoryAccess.  In this case the calls to @f1 have no
12; MemoryAccesses since globals-aa determines that @f1 doesn't
13; read/write memory at all.
14
15define void @f3() {
16; CHECK-LABEL: @f3(
17; CHECK-NEXT:    [[CALL1:%.*]] = call i16 @f1()
18; CHECK-NEXT:    call void @f2()
19; CHECK-NEXT:    ret void
20;
21  %call1 = call i16 @f1()
22  call void @f2()
23  %call2 = call i16 @f1()
24  ret void
25}
26