luxufan
b0f7876917
[SCCP] Propagate equality of a not-constant
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`.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D139289
2022-12-05 19:54:13 +08:00
..
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-06-30 09:25:03 +02:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-06-30 09:25:03 +02:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-09-15 13:54:52 -04:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-09-07 11:56:29 -04:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-12-05 19:54:13 +08:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-09-07 11:56:29 -04:00
2022-09-07 11:56:29 -04:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-06-07 10:20:24 +02:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-06-22 10:28:27 +02:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-07-01 09:14:37 +02:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-04 10:21:38 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-06-30 09:25:03 +02:00
2022-11-01 17:13:31 +01:00
2022-11-04 10:21:38 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-06-22 10:28:27 +02:00
2022-11-01 17:13:31 +01:00
2022-06-30 09:25:03 +02:00
2022-09-30 09:28:57 -04:00
2022-10-24 11:43:20 -04:00
2022-10-24 11:43:20 -04:00
2022-06-22 10:28:27 +02:00
2022-06-22 10:28:27 +02:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-11-01 17:13:31 +01:00
2022-12-05 12:00:22 +01:00