The equality state of a not-constant can be used to do constant
propagation. For example,
define i32 @equal_not_constant(ptr noundef %p, ptr noundef %q) { entry: %cmp = icmp ne ptr %p, null br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %cmp.then = icmp eq ptr %p, %q br i1 %cmp.then, label %if.then1, label %if.end if.then1: ; preds = %if.then %cmp.then1 = icmp ne ptr %q, null call void @use(i1 %cmp.then1) br label %if.end if.end: ret i32 0 }
In this case, we can fold %cmp.then1 as true.
Shouldn't this be getNotConstant()? Probably missing test coverage, I'd expect this to assert.