aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorluxufan <luxufan@iscas.ac.cn>2022-09-12 01:02:09 +0000
committerluxufan <luxufan@iscas.ac.cn>2022-09-29 00:51:56 +0000
commitf079ba76cf0fe0c105f1ce05636342bc2dbe57b4 (patch)
tree76bc49eceb5e3b0b3023b65fd70ab889bc047e5e /clang/lib/Frontend/InitPreprocessor.cpp
parent4c4e544cd8fc1da610bf69ee6524e88a8401cdba (diff)
downloadllvm-f079ba76cf0fe0c105f1ce05636342bc2dbe57b4.zip
llvm-f079ba76cf0fe0c105f1ce05636342bc2dbe57b4.tar.gz
llvm-f079ba76cf0fe0c105f1ce05636342bc2dbe57b4.tar.bz2
[DSE] Eliminate noop store even through has clobbering between LoadI and StoreI
For noop store of the form of LoadI and StoreI, An invariant should be kept is that the memory state of the related MemoryLoc before LoadI is the same as before StoreI. For this example: ``` define void @pr49927(i32* %q, i32* %p) { %v = load i32, i32* %p, align 4 store i32 %v, i32* %q, align 4 store i32 %v, i32* %p, align 4 ret void } ``` Here the definition of the store's destination is different with the definition of the load's destination, which it seems that the invariant mentioned above is broken. But the definition of the store's destination would write a value that is LoadI, actually, the invariant is still kept. So we can safely ignore it. Fixes https://github.com/llvm/llvm-project/issues/49271 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D132657
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions