summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IndirectBrExpandPass.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-08-01 17:17:08 +0000
committerSanjay Patel <spatel@rotateright.com>2018-08-01 17:17:08 +0000
commit8aac22e06a196541961cd6d6cc46ffd4f39b60c3 (patch)
treece54e012d6bc3a7d3f1e697f5ab4cdd9fdb69bbd /llvm/lib/CodeGen/IndirectBrExpandPass.cpp
parent0bb8d83c89321c0bfe955c5e2b2069a2870912d4 (diff)
downloadbcm5719-llvm-8aac22e06a196541961cd6d6cc46ffd4f39b60c3.tar.gz
bcm5719-llvm-8aac22e06a196541961cd6d6cc46ffd4f39b60c3.zip
[SelectionDAG] fix bug in translating funnel shift with non-power-of-2 type
The bug is visible in the constant-folded x86 tests. We can't use the negated shift amount when the type is not power-of-2: https://rise4fun.com/Alive/US1r ...so in that case, use the regular lowering that includes a select to guard against a shift-by-bitwidth. This path is improved by only calculating the modulo shift amount once now. Also, improve the rotate (with power-of-2 size) lowering to use a negate rather than subtract from bitwidth. This improves the codegen whether we have a rotate instruction or not (although we can still see that we're not matching to a legal rotate in all cases). llvm-svn: 338592
Diffstat (limited to 'llvm/lib/CodeGen/IndirectBrExpandPass.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud