<div>Hi,</div><div><br></div><div>GVN seems to be running in an infinite loop on my example. I have attached the output of one iteration. I cant seem to reduce the testcase either. </div><div><br></div><div>Any pointers to how to reduce the test case.</div>

<div><br></div><div>THanks,</div><div>Arushi</div><div><br></div><div>GVN iteration: 8</div><div>GVN WIDENED LOAD:   %0 = load i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23), align 2, !dbg !875</div>

<div>TO:   %1 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>GVN COERCED INST:</div><div>  %0 = load i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23), align 2, !dbg !875</div>

<div>  %1 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>  %3 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div>

<div><br></div><div><br></div><div>GVN removed:   %3 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>GVN WIDENED LOAD:   %0 = load i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23), align 2, !dbg !875</div>

<div>TO:   %1 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>GVN COERCED INST:</div><div>  %0 = load i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23), align 2, !dbg !875</div>

<div>  %1 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>  %6 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div>

<div><br></div><div><br></div><div>GVN removed:   %6 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>GVN WIDENED LOAD:   %0 = load i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23), align 2, !dbg !875</div>

<div>TO:   %1 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>GVN COERCED INST:</div><div>  %0 = load i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23), align 2, !dbg !875</div>

<div>  %1 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>  %9 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div>

<div><br></div><div><br></div><div>GVN removed:   %9 = load i16* bitcast (i8* getelementptr inbounds (%struct.CHESS_POSITION* @search, i64 0, i32 23) to i16*), align 2</div><div>GVN removed:   %10 = trunc i16 %1 to i8</div>

<div>GVN removed:   %10 = trunc i16 %3 to i8</div><div>GVN removed:   %10 = trunc i16 %5 to i8</div><div>GVN iteration: 9</div><div><br></div>