aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-02-20 09:46:54 +0100
committerNikita Popov <npopov@redhat.com>2023-02-27 12:23:06 +0100
commitee2f9d6dfb6f1360d2dc68d151c84e80252a40ec (patch)
tree95b5e111f82868cdb2600026023f1fdef8a19051 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent7f635b90e7bdf1378fd9a65fc62b99e8e07d4aaf (diff)
downloadllvm-ee2f9d6dfb6f1360d2dc68d151c84e80252a40ec.zip
llvm-ee2f9d6dfb6f1360d2dc68d151c84e80252a40ec.tar.gz
llvm-ee2f9d6dfb6f1360d2dc68d151c84e80252a40ec.tar.bz2
Reapply [InstCombine] Remove early constant fold
The reported compile-time regression has been address in 47f9109dff80a1abbe2705ee71dc0882b1d62274. Additionally, this contains a change to immediately fold zext with constant operand, even if it's used in a trunc. I'm not sure if this is relevant for anything, but I noticed it as a behavioral discrepancy when investigating this issue. ----- InstCombine currently performs a constant folding attempt as part of the main InstCombine loop, before visiting the instruction. However, each visit method will also attempt to simplify the instruction, which will in turn constant fold it. (Additionally, we also constant fold instructions before the main InstCombine loop and use a constant folding IR builder, so this is doubly redundant.) There is one place where InstCombine visit methods currently don't call into simplification, and that's casts. To be conservative, I've added an explicit constant folding call there (though it has no impact on tests). This makes for a mild compile-time improvement and in particular mitigates the compile-time regression from enabling load simplification in be88b5814d9efce131dbc0c8e288907e2e6c89be. Differential Revision: https://reviews.llvm.org/D144369
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions