<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Shuxin<div><br></div><div>I think i might have written that test.  And yeah, no matter what values you get you’ll get a 0.0.  Its probably a bad test case, but i can’t remember if it exposed a bug in this form or not.  Since writing it Chandler rewrote SROA anyway so the original bug is long gone.</div><div><br></div><div>Thanks,</div><div>Pete<br><div><div>On Apr 5, 2013, at 11:57 AM, Shuxin Yang <<a href="mailto:shuxin.llvm@gmail.com">shuxin.llvm@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi,<br><br>  Following is excerpted from dynamic-vector-gep.ll.<br>The resulting "extractelement" seems to always return 0.0f regardless the value idx1 and idx2 is holding.<br>Am I missing something here or there is something fishy take place?<br><br>Thanks<br>Shuxin<br><br><br>101 ; CHECK: test6<br>102 ; CHECK: insertelement <4 x float> zeroinitializer, float 1.000000e+00, i32 %idx1<br>103 ; CHECK: extractelement <4 x float> zeroinitializer, i32 %idx2<br>104<br>105 %vector.pair = type { %vector.anon, %vector.anon }<br>106 %vector.anon = type { %vector }<br>107 %vector = type { <4 x float> }<br>108<br>109 ; Dynamic GEPs on vectors were crashing when the vector was inside a struct<br>110 ; as the new GEP for the new alloca might not include all the indices from<br>111 ; the original GEP, just the indices it needs to get to the correct offset of<br>112 ; some type, not necessarily the dynamic vector.<br>113 ; This test makes sure we don't have this crash.<br>114 define float @test6(i32 %idx1, i32 %idx2) {<br>115 entry:<br>116   %0 = alloca %vector.pair<br>117   store %vector.pair zeroinitializer, %vector.pair* %0<br>118   %ptr1 = getelementptr %vector.pair* %0, i32 0, i32 0, i32 0, i32 0, i32 %idx1<br>119   store float 1.0, float* %ptr1<br>120   %ptr2 = getelementptr %vector.pair* %0, i32 0, i32 1, i32 0, i32 0, i32 %idx2<br>121   %ret = load float* %ptr2<br>122   ret float %ret<br>123 }<br><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>        <a href="http://llvm.cs.uiuc.edu/">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div></blockquote></div><br></div></body></html>