aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorAmara Emerson <amara@apple.com>2020-10-13 23:41:32 -0700
committerAmara Emerson <amara@apple.com>2020-10-23 10:18:36 -0700
commit0f0fd383b487e004fd616ac941307422bd09c261 (patch)
tree785f490706213199a4ea45abd3056679024f89ea /clang/lib/Basic/SourceManager.cpp
parentbf44d3689a0b101914e7088b9671c90e72b8a4e8 (diff)
downloadllvm-0f0fd383b487e004fd616ac941307422bd09c261.zip
llvm-0f0fd383b487e004fd616ac941307422bd09c261.tar.gz
llvm-0f0fd383b487e004fd616ac941307422bd09c261.tar.bz2
[AArch64][GlobalISel] Introduce a new post-isel optimization pass.
There are two optimizations here: 1. Consider the following code: FCMPSrr %0, %1, implicit-def $nzcv %sel1:gpr32 = CSELWr %_, %_, 12, implicit $nzcv %sub:gpr32 = SUBSWrr %_, %_, implicit-def $nzcv FCMPSrr %0, %1, implicit-def $nzcv %sel2:gpr32 = CSELWr %_, %_, 12, implicit $nzcv This kind of code where we have 2 FCMPs each feeding a CSEL can happen when we have a single IR fcmp being used by two selects. During selection, to ensure that there can be no clobbering of nzcv between the fcmp and the csel, we have to generate an fcmp immediately before each csel is selected. However, often we can essentially CSE these together later in MachineCSE. This doesn't work though if there are unrelated flag-setting instructions in between the two FCMPs. In this case, the SUBS defines NZCV but it doesn't have any users, being overwritten by the second FCMP. Our solution here is to try to convert flag setting operations between a interval of identical FCMPs, so that CSE will be able to eliminate one. 2. SelectionDAG imported patterns for arithmetic ops currently select the flag-setting ops for CSE reasons, and add the implicit-def $nzcv operand to those instructions. However if those impdef operands are not marked as dead, the peephole optimizations are not able to optimize them into non-flag setting variants. The optimization here is to find these dead imp-defs and mark them as such. This pass is only enabled when optimizations are enabled. Differential Revision: https://reviews.llvm.org/D89415
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
0 files changed, 0 insertions, 0 deletions