aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2022-03-22 09:02:28 -0400
committerSanjay Patel <spatel@rotateright.com>2022-03-22 09:10:55 -0400
commit60820e53ec9d3be028ce315f9b630b55c670b32e (patch)
tree43b29264e6e9eb6da85f4e417cd31c1e312b797b /clang/lib/Frontend/InitPreprocessor.cpp
parent91ea247039dbcc756107616d39baecbb3a4bfb7e (diff)
downloadllvm-60820e53ec9d3be028ce315f9b630b55c670b32e.zip
llvm-60820e53ec9d3be028ce315f9b630b55c670b32e.tar.gz
llvm-60820e53ec9d3be028ce315f9b630b55c670b32e.tar.bz2
[InstCombine] try to canonicalize logical shift after bswap
When shifting by a byte-multiple: bswap (shl X, C) --> lshr (bswap X), C bswap (lshr X, C) --> shl (bswap X), C This is an IR implementation of a transform suggested in D120648. The "swaps cancel" test models the motivating optimization from that proposal. Alive2 checks (as noted in the other review, we could use knownbits to handle shift-by-variable-amount, but that can be an enhancement patch): https://alive2.llvm.org/ce/z/pXUaRf https://alive2.llvm.org/ce/z/ZnaMLf Differential Revision: https://reviews.llvm.org/D122010
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions