https://llvm.org/bugs/show_bug.cgi?id=31142
Bug ID: 31142 Summary: SROA is dropping !nonnull/!range metadata Product: libraries Version: 3.9 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Scalar Optimizations Assignee: unassignedb...@nondot.org Reporter: arie...@mail.tau.ac.il CC: llvm-bugs@lists.llvm.org Classification: Unclassified When SROA optimizes out an alloca whose load contains a !nonnull metadata, the load is dropped on the floor. This can lead to the metadata being dropped in cases such as define float* @yummy_nonnull(float**) { entry-block: %buf = alloca float* %_0_i8 = bitcast float** %0 to i8* %_buf_i8 = bitcast float** %buf to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %_buf_i8, i8* %_0_i8, i64 8, i32 8, i1 false) %ret = load float*, float** %buf, align 8, !nonnull !0 ret float* %ret } declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) !0 = !{} Which is optimized to define float* @yummy_nonnull(float** nocapture readonly) local_unnamed_addr #0 { entry-block: %buf.0.copyload = load float*, float** %0, align 8 ret float* %buf.0.copyload } If this function is later inlined, the !nonnull metadata will no longer be present to help further optimizations. This is the cause of Rust bug https://github.com/rust-lang/rust/issues/37945. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs