This reverts commit754f3ae655. Unfortunately the change can cause regressions due to dropping flags from instructions (like nuw,nsw,inbounds), prevent further optimizations depending on those flags. A simple example is the IR below, where `inbounds` is dropped with the patch and the phase-ordering test added in7c91d82ab9. define i1 @test(ptr %base, i64 noundef %len, ptr %p2) { bb: %gep = getelementptr inbounds i32, ptr %base, i64 %len %c.1 = icmp uge ptr %p2, %base %c.2 = icmp ult ptr %p2, %gep %select = select i1 %c.1, i1 %c.2, i1 false ret i1 %select } For more discussion, see D149404.
5.9 KiB
5.9 KiB