aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-01-16 12:41:35 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-01-16 23:25:02 +0100
commit5238e7b302ffc40707677960da9d64e872745dac (patch)
tree588d6c36f96036023983c5f8b08355a745c8e25d /llvm/lib/Object/COFFObjectFile.cpp
parent32fc32317a31fc00e7e4086d6c93dd1eab75960c (diff)
downloadllvm-5238e7b302ffc40707677960da9d64e872745dac.zip
llvm-5238e7b302ffc40707677960da9d64e872745dac.tar.gz
llvm-5238e7b302ffc40707677960da9d64e872745dac.tar.bz2
[InstCombine] Replace one-use select operand based on condition
InstCombine already performs a fold where X == Y ? f(X) : Z is transformed to X == Y ? f(Y) : Z if f(Y) simplifies. However, if f(X) only has one use, then we can always directly replace the use inside the instruction. To actually be profitable, limit it to the case where Y is a non-expr constant. This could be further extended to replace uses further up a one-use instruction chain, but for now this only looks one level up. Among other things, this also subsumes D94860. Differential Revision: https://reviews.llvm.org/D94862
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions