<div dir="ltr">Hi <div><br></div><div>Sorry, that the previous email is sent out before I complete it due to my mistake. Please read this</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">I am using the LLVM function pass to help me to do code analysis. However, I found that the block LLVM identified will ignore the function call.</span><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">For example, the below IR should not be a basic block. </span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline;font-size:14px"><div><br></div><div>  %call17 = call i32* @__errno_location() #14, !dbg !1384</div><div>  %18 = load i32, i32* %call17, align 4, !dbg !1384</div><div>  %19 = load i8*, i8** %dest_dirname, align 4, !dbg !1386</div><div>  call void (i32, i32, i8*, ...) @error(i32 1, i32 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.389, i32 0, i    32 0), i8* %19), !dbg !1387</div><div>  br label %if.end18, !dbg !1388</div></span></div><div><br></div><div>The corresponding binary i s below</div><div><br></div><div><div>.text:0001A530                 BL      __errno_location</div><div>.text:0001A534                 LDR     R1, [R0]        ; errnum</div><div>.text:0001A538                 LDR     R3, [SP,#0x100+var_100]</div><div>.text:0001A53C                 LDR     R2, =aS_1       ; "%s"</div><div>.text:0001A540                 MOV     R0, #1          ; status</div><div>.text:0001A544                 BL      error</div><div>.text:0001A548                 B       loc_1A54C</div></div><div><br></div><div>Here you can see it obviously should not be a basic block because you called two functions! So the control flow graph LLVM generated is also not the real control flow graph, right? Do anyone know why or give me some suggestions?</div><div><br></div><div>Regards</div><div>Muhui</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-29 20:35 GMT+08:00 Muhui Jiang <span dir="ltr"><<a href="mailto:jiangmuhui@gmail.com" target="_blank">jiangmuhui@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><br></div><div>I am using the LLVM function pass to help me to do code analysis. I use </div><div><br></div></div>
</blockquote></div><br></div>