brintos

brintos / llvm-project-archived public Read only

0
0
Text · 530 B · e8f570b Raw
16 lines · plain
1; Test to make sure malloc's bitcast does not block detection of a store 2; to aliased memory; GVN should not optimize away the load in this program.3; RUN: opt < %s -passes=gvn -S | FileCheck %s4 5define i64 @test() {6  %mul = mul i64 4, ptrtoint (ptr getelementptr (i64, ptr null, i64 1) to i64)7  %1 = tail call ptr @malloc(i64 %mul)8  store i8 42, ptr %19  %Y = load i64, ptr %1                               ; <i64> [#uses=1]10  ret i64 %Y11; CHECK: %Y = load i64, ptr %112; CHECK: ret i64 %Y13}14 15declare noalias ptr @malloc(i64)16