Reinstate the optimization from r151449 with a fix to not turn 'gep %x' into

'gep null' when the icmp predicate is unsigned (or is signed without inbounds).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2012-02-26 02:09:49 +00:00
parent 8c727f9200
commit f7087ea508
3 changed files with 115 additions and 14 deletions

View File

@@ -634,8 +634,6 @@ define i1 @test62(i8* %a) {
%arrayidx2 = getelementptr inbounds i8* %a, i64 10
%cmp = icmp slt i8* %arrayidx1, %arrayidx2
ret i1 %cmp
; Don't turn a signed cmp of GEPs into an index compare.
; CHECK: @test62
; CHECK: %cmp = icmp slt i8* %arrayidx1, %arrayidx2
; CHECK-NEXT: ret i1 %cmp
; CHECK-NEXT: ret i1 true
}