aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2023-01-25 19:45:01 +0000
committerGuozhi Wei <carrot@google.com>2023-01-25 19:45:01 +0000
commit5f1448fe1585b5677d5f0064e4eeac3b493d8a18 (patch)
tree83a88f858377d631f6b445d157297a798756b0dc /llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp
parent287508cd9c4396c8845d92310d258879202a179e (diff)
downloadllvm-5f1448fe1585b5677d5f0064e4eeac3b493d8a18.zip
llvm-5f1448fe1585b5677d5f0064e4eeac3b493d8a18.tar.gz
llvm-5f1448fe1585b5677d5f0064e4eeac3b493d8a18.tar.bz2
[GVN] Improve PRE on load instructions
This patch implements the enhancement proposed by https://github.com/llvm/llvm-project/issues/59312. Suppose we have following code v0 = load %addr br %LoadBB LoadBB: v1 = load %addr ... PredBB: ... br %cond, label %LoadBB, label %SuccBB SuccBB: v2 = load %addr ... Instruction v1 in LoadBB is partially redundant, edge (PredBB, LoadBB) is a critical edge. SuccBB is another successor of PredBB, it contains another load v2 which is identical to v1. Current GVN splits the critical edge (PredBB, LoadBB) and inserts a new load in it. A better method is move the load of v2 into PredBB, then v1 can be changed to a PHI instruction. If there are two or more similar predecessors, like the test case in the bug entry, current GVN simply gives up because otherwise it needs to split multiple critical edges. But we can move all loads in successor blocks into predecessors. Differential Revision: https://reviews.llvm.org/D141712
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMappingReader.cpp')
0 files changed, 0 insertions, 0 deletions