mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
53fb41197c
Current implementation of Instruction::mayReadFromMemory() returns !doesNotAccessMemory() which is !ReadNone. This does not take into account that the writeonly attribute also indicates that the call does not read from memory. The patch changes the predicate to !doesNotReadMemory() that reflects the intended behavior. Differential Revision: https://reviews.llvm.org/D69086 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375389 91177308-0d34-0410-b5e6-96231b3b80d8
16 lines
313 B
LLVM
16 lines
313 B
LLVM
; RUN: opt -S -early-cse < %s | FileCheck %s
|
|
|
|
@var = global i32 undef
|
|
declare void @foo() nounwind
|
|
|
|
define void @test() {
|
|
; CHECK-LABEL: @test(
|
|
; CHECK-NOT: store
|
|
store i32 1, i32* @var
|
|
; CHECK: call void @foo()
|
|
call void @foo() writeonly
|
|
; CHECK: store i32 2, i32* @var
|
|
store i32 2, i32* @var
|
|
ret void
|
|
}
|