diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-08-14 15:55:43 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-08-14 15:55:43 +0000 |
commit | 92653865e605ef3d588bddcf1b595bb9d901180e (patch) | |
tree | 96a9df2c9b1180f80f83389a619c6185028f247b /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | 7b78f5e52db77c618d8499fa64e065d26163219c (diff) | |
download | bcm5719-llvm-92653865e605ef3d588bddcf1b595bb9d901180e.tar.gz bcm5719-llvm-92653865e605ef3d588bddcf1b595bb9d901180e.zip |
[x86] fold the mask op on 8- and 16-bit rotates
Ref the post-commit thread for r310770:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170807/478507.html
The motivating cases as 'C' source examples can look like this:
unsigned char rotate_right_8(unsigned char v, int shift) {
// shift &= 7;
v = ( v >> shift ) | ( v << ( 8 - shift ) );
return v;
}
https://godbolt.org/g/K6rc1A
Notice that the source doesn't contain UB-safe masked shift amounts, but instcombine created those
in order to produce narrow rotate patterns. This should be the last step needed to resolve PR34046:
https://bugs.llvm.org/show_bug.cgi?id=34046
Differential Revision: https://reviews.llvm.org/D36644
llvm-svn: 310849
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
0 files changed, 0 insertions, 0 deletions