Hi all,<br><br>I put a case into llvm and got the following .ll code:<br><br>...<br> %r1419_0_0_0_i376 = alloca i32 ; <i32*> [#uses=2]<br>...<br> %tmp1476_i = lshr i32 %tmp1226_i, 24 ; <i32> [#uses=1]<br>
<br> store i32 %tmp1476_i, i32* %r1419_0_0_0_i376, align 4<br> %tmp1505_i = volatile load i32* %r1419_0_0_0_i376, align 4 ; <i32> [#uses=1]<br><br> %tmp1542_i = getelementptr [256 x i8]* @Te, i32 0, i32 %tmp1505_i<br>
...<br><br><br>llvm opt can't remove the redundant store-load pair to just use the value %tmp1476 as the load is volatile.<br>But I think for the above situation, it's safe to remove store-load, as the allocad %r1419_0_0_0_i376 just has two users (the one load and one store), correct?<br>
<br>Can I add some code to instcombine or dce for this?<br>