aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-10-16 13:31:41 -0700
committerCraig Topper <craig.topper@sifive.com>2021-10-16 13:31:43 -0700
commitbeb7862db520541fea429f27733e1993d254d76f (patch)
tree8214f846d83fe2a535d72aa728219981e8cad77f /clang/lib/CodeGen/CodeGenModule.cpp
parentecbee4804d44c0afdf97fe59e8221c30cbbf3ae7 (diff)
downloadllvm-beb7862db520541fea429f27733e1993d254d76f.zip
llvm-beb7862db520541fea429f27733e1993d254d76f.tar.gz
llvm-beb7862db520541fea429f27733e1993d254d76f.tar.bz2
[X86] Add DAG combine for negation of CMOV absolute value pattern.
This patch detects the absolute value pattern on the RHS of a subtract. If we find it we swap the CMOV true/false values and replace the subtract with an ADD. There may be a more generic way to do this, but I'm not sure. Targets that don't have legal or custom ISD::ABS use a generic expand in DAG combiner already when it sees (neg (abs(x))). I haven't checked what happens if the neg is a more general subtract. Fixes PR50991 for X86. Reviewed By: RKSimon, spatel Differential Revision: https://reviews.llvm.org/D111858
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions