It does not do anything. It is an abstract function which transforms a pointer and returns another pointer of the same type. It does not visit memory or capture the pointer parameter. <br><br><div class="gmail_quote">On Thu, Oct 6, 2011 at 2:22 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">On Thu, Oct 6, 2011 at 2:20 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>> wrote:<br>
> On Thu, Oct 6, 2011 at 2:12 PM, Zeng Bin <<a href="mailto:ezengbin@gmail.com">ezengbin@gmail.com</a>> wrote:<br>
>> Hi all,<br>
>><br>
>> There might be a bug in DeadStoreElimination.cpp. This pass eliminates<br>
>> stores backwards aggressively in an end BB. It does not check dependencies<br>
>> on stores in an end BB though. For example, in this code snippet:<br>
>> ...<br>
>> 1. %sum.safe_r47.pre-phi = phi i64* [ %sum.safe_r47.pre,<br>
>> %entry.for.end_crit_edge ], [ %sum.safe_r42, %for.body ]<br>
>> 2. %call9 = call i32 @gettimeofday(%struct.timeval* %end, %struct.timeval*<br>
>> null) nounwind<br>
>> 3. %0 = bitcast %struct.timeval* %start to i64* // eliminated by<br>
>> HandleEndBlock in DeadStoreElimination.cpp<br>
>> 4. %1 = bitcast %struct.timeval* %agg.tmp to i64* // eliminated ...<br>
>> 5. %tmp49 = load i64* %0, align 8 // eliminated<br>
>> ...<br>
>> 6. store i64 %tmp49, i64* %1, align 8 // eliminated<br>
>> ...<br>
>> 7. %2 = bitcast %struct.timeval* %end to i64* // eliminated ...<br>
>> 8. %3 = bitcast %struct.timeval* %agg.tmp12 to i64* // eliminated ...<br>
>> 9. %tmp50 = load i64* %2, align 8 //<br>
>> eliminated ...<br>
>> 10. store i64 %tmp50, i64* %3, align 8 //<br>
>> eliminated ...<br>
>> 11. %tv_sec = getelementptr inbounds %struct.timeval* %agg.tmp, i32 0, i32<br>
>> 0<br>
>> 12. %tv_sec.safe_r = call i32* @llvm.guard.load.p0i32(i32* %tv_sec) //<br>
>> intrinsic function call inserted by me<br>
>> 13. %tmp15 = load i32* %tv_sec.safe_r, align 4, !tbaa<br>
>> !4 // this loads the value stored at line 6<br>
>> 14. %tv_usec = getelementptr inbounds %struct.timeval* %agg.tmp, i32 0, i32<br>
>> 1<br>
>> 15. %tv_usec.safe_r = call i32* @llvm.guard.load.p0i32(i32* %tv_usec) //<br>
>> intrinsic function call ...<br>
>> 16. %tmp16 = load i32* %tv_usec.safe_r, align 4, !tbaa !4<br>
>> 17. %tv_sec17 = getelementptr inbounds %struct.timeval* %agg.tmp12, i32 0,<br>
>> i32 0<br>
>> 18. %tv_sec17.safe_r = call i32* @llvm.guard.load.p0i32(i32* %tv_sec17) //<br>
>> intrinsic function call ...<br>
>> 19. %tmp18 = load i32* %tv_sec17.safe_r, align 4, !tbaa !4<br>
>> 20. %tv_usec19 = getelementptr inbounds %struct.timeval* %agg.tmp12, i32 0,<br>
>> i32 1<br>
>> 21. %tv_usec19.safe_r = call i32* @llvm.guard.load.p0i32(i32* %tv_usec19)<br>
>> // intrinsic function call<br>
>> 22. %tmp20 = load i32* %tv_usec19.safe_r, align 4, !tbaa !4<br>
>> 23. %call21 = call i32 @delta(i32 %tmp15, i32 %tmp16, i32 %tmp18, i32<br>
>> %tmp20)<br>
>> ...<br>
>><br>
>> It is compiled by clang 2.9. This BB is an end block in a function.<br>
>> Intrinsic function llvm.guard.load.p0i32 is defined as follows:<br>
>> let Properties = [IntrNoMem, NoCapture<0>] in {<br>
>> def int_guard_load : Intrinsic<[llvm_anyptr_ty], [LLVMMatchType<0>]><br>
>> }<br>
>><br>
>> Thanks a lot.<br>
><br>
> IntrNoMem means that your intrinsic doesn't access memory... I don't<br>
> think that is what you want.<br>
<br>
</div></div>Well, either that or the NoCapture marking is wrong. What exactly is<br>
your int_guard_load supposed to do?<br>
<font color="#888888"><br>
-Eli<br>
</font></blockquote></div><br>