The idea of this assertion was to check the simplified value before we
assign it, not after, which caused this to trivially fail all the time.
if (Op0IsNull && Op1IsNull) {
Value *NewVal = ConstantInt::get(
Type::getInt1Ty(Ctx), ICmp->getPredicate() == CmpInst::ICMP_EQ);
- SimplifiedAssociatedValue = NewVal;
- indicateOptimisticFixpoint();
assert(!SimplifiedAssociatedValue.hasValue() &&
"Did not expect non-fixed value for constant comparison");
+ SimplifiedAssociatedValue = NewVal;
+ indicateOptimisticFixpoint();
Changed = ChangeStatus::CHANGED;
return true;
}
ret i8 %c
}
+
+define i1 @icmp() {
+; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
+; IS__TUNIT____-LABEL: define {{[^@]+}}@icmp
+; IS__TUNIT____-SAME: () [[ATTR1]] {
+; IS__TUNIT____-NEXT: ret i1 true
+;
+; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
+; IS__CGSCC____-LABEL: define {{[^@]+}}@icmp
+; IS__CGSCC____-SAME: () [[ATTR1]] {
+; IS__CGSCC____-NEXT: ret i1 true
+;
+ %c = icmp eq i8* null, null
+ ret i1 %c
+}