diff options
author | Craig Topper <craig.topper@sifive.com> | 2021-02-23 09:40:30 -0800 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2021-02-23 09:40:32 -0800 |
commit | eb165090bb063cb6b73433c30adeed6fef995108 (patch) | |
tree | 4adc026e538540ecf997f7a8527f74355e5ea378 /clang/lib/Lex/ModuleMap.cpp | |
parent | 1e204ac78952cf7e4fcf335423e80007388d3979 (diff) | |
download | llvm-eb165090bb063cb6b73433c30adeed6fef995108.zip llvm-eb165090bb063cb6b73433c30adeed6fef995108.tar.gz llvm-eb165090bb063cb6b73433c30adeed6fef995108.tar.bz2 |
[LegalizeIntegerTypes] Improve ExpandIntRes_SADDSUBO codegen on targets without SADDO/SSUBO.
This code creates 3 setccs that need to be expanded. It was
creating a sign bit test as setge X, 0 which is non-canonical.
Canonical would be setgt X, -1. This misses the special case in
IntegerExpandSetCCOperands for sign bit tests that assumes
canonical form. If we don't hit this special case we end up
with a multipart setcc instead of just checking the sign of
the high part.
To fix this I've reversed the polarity of all of the setccs to
setlt X, 0 which is canonical. The rest of the logic should
still work. This seems to produce better code on RISCV which
lacks a setgt instruction.
This probably still isn't the best code sequence we could use here.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D97181
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions