let TargetPrefix = "wasm" in { // All intrinsics start with "llvm.wasm.".
-def int_wasm_memory_size : Intrinsic<[llvm_anyint_ty], [], [IntrNoMem]>;
+// Note that memory_size is not IntrNoMem because it must be sequenced with
+// respect to grow_memory calls.
+def int_wasm_memory_size : Intrinsic<[llvm_anyint_ty], [], [IntrReadMem]>;
def int_wasm_grow_memory : Intrinsic<[], [llvm_anyint_ty], []>;
}
target datalayout = "e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
-declare i32 @llvm.wasm.memory.size.i32() nounwind readnone
+declare i32 @llvm.wasm.memory.size.i32() nounwind readonly
declare void @llvm.wasm.grow.memory.i32(i32) nounwind
; CHECK-LABEL: memory_size:
target datalayout = "e-p:64:64-i64:64-n32:64-S128"
target triple = "wasm64-unknown-unknown"
-declare i64 @llvm.wasm.memory.size.i64() nounwind readnone
+declare i64 @llvm.wasm.memory.size.i64() nounwind readonly
declare void @llvm.wasm.grow.memory.i64(i64) nounwind
; CHECK-LABEL: memory_size: