<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p style="margin-top:0; margin-bottom:0">Hi, </p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">I am trying to find out instances of confused dependencies in my program. <span style="font-size: 16px; font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">According
to LLVM's doxygen page, 'confused dependencies' are detected by function </span><span style="color: rgb(85, 85, 85); font-size: 14px; font-family: Roboto, sans-serif, serif, EmojiFont; background-color: rgb(249, 250, 252);">isConfused() - Returns true if this
dependence is confused (the compiler understands nothing and makes worst-case assumptions) (<a href="http://llvm.org/doxygen/classllvm_1_1Dependence.html#a5c65e22ef4b0368ab040d1bd4ead382d" target="_blank" rel="noopener noreferrer" data-auth="NotApplicable" id="LPlnk688487" previewremoved="true">http://llvm.org/doxygen/classllvm_1_1Dependence.html#a5c65e22ef4b0368ab040d1bd4ead382d</a>)</span></p>
<p style="margin-top:0; margin-bottom:0"><br>
</p>
<p style="margin-top:0; margin-bottom:0">For the following code snippet:</p>
<p style="margin-top:0; margin-bottom:0"></p>
<div> for (int i = 0; i < 10; i++)</div>
<div> {</div>
<div> a = 1;</div>
<div> for (int j = 0; j < 9; j++)</div>
<div> {</div>
<div> b = 2;</div>
<div> for (int k = 0; k < 8; k++)</div>
<div> {</div>
<div> c = 3;</div>
<div> }</div>
<div> }</div>
<div> }</div>
<div><span style="font-size: 12pt;">We are constructing dependencies between the corresponding IR of the above code and checking whether it is confused or not:</span><br>
</div>
<div><br>
</div>
<p></p>
<p style="margin-top:0; margin-bottom:0"></p>
<div> store i32 1, i32* @a, align 4</div>
<div> store i32 2, i32* @b, align 4</div>
<div>Confused Dependence or Not: 1</div>
<div><br>
</div>
Since the variables 'a' and 'b' are in different memory locations, why is LLVM's isConfused method gives us True?
<p></p>
</div>
</body>
</html>