aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGen.cpp
diff options
context:
space:
mode:
authorluxufan <luxufan@iscas.ac.cn>2022-12-05 19:38:25 +0800
committerluxufan <luxufan@iscas.ac.cn>2022-12-05 19:54:13 +0800
commitb0f78769178ebb5e0691aca5143fead7f79ee55c (patch)
tree05d73c16d621076102d42712603b420f14c8a61d /llvm/lib/CodeGen/CodeGen.cpp
parentfc85ccd7b3cf7e6a7e7aef9e04c181df15b543e3 (diff)
downloadllvm-b0f78769178ebb5e0691aca5143fead7f79ee55c.zip
llvm-b0f78769178ebb5e0691aca5143fead7f79ee55c.tar.gz
llvm-b0f78769178ebb5e0691aca5143fead7f79ee55c.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
0 files changed, 0 insertions, 0 deletions