return ICmpInst::ICMP_UGT;
}
} else if (const GlobalValue *GV2 = dyn_cast<GlobalValue>(V2)) {
- if (isa<ConstantPointerNull>(CE1Op0)) {
- // If its not weak linkage, the GVal must have a non-zero address
- // so the result is less-than
- if (!GV2->hasExternalWeakLinkage())
- return ICmpInst::ICMP_ULT;
- } else if (const GlobalValue *GV = dyn_cast<GlobalValue>(CE1Op0)) {
+ if (const GlobalValue *GV = dyn_cast<GlobalValue>(CE1Op0)) {
if (GV != GV2) {
if (CE1GEP->hasAllZeroIndices())
return areGlobalsPotentiallyEqual(GV, GV2);
define i1 @null_gep_ne_global() {
; CHECK-LABEL: @null_gep_ne_global(
-; CHECK-NEXT: ret i1 true
+; CHECK-NEXT: ret i1 icmp ne (i8* getelementptr (i8, i8* null, i64 ptrtoint (i8* @g3 to i64)), i8* @g3)
;
%gep = getelementptr i8, i8* null, i64 ptrtoint (i8* @g3 to i64)
%cmp = icmp ne i8* %gep, @g3
define i1 @null_gep_ult_global() {
; CHECK-LABEL: @null_gep_ult_global(
-; CHECK-NEXT: ret i1 true
+; CHECK-NEXT: ret i1 icmp ult (i8* getelementptr (i8, i8* null, i64 ptrtoint (i8* @g3 to i64)), i8* @g3)
;
%gep = getelementptr i8, i8* null, i64 ptrtoint (i8* @g3 to i64)
%cmp = icmp ult i8* %gep, @g3