HomePhabricator

[InstCombine] restrict funnel shift match to avoid miscompile

Authored by spatel on May 18 2021, 10:28 AM.

Description

[InstCombine] restrict funnel shift match to avoid miscompile

As noted in the post-commit discussion for:
https://reviews.llvm.org/rGabd7529625a73f405e40a63dcc446c41d51a219e

...that change exposed a logic hole that allows a miscompile
if the shift amount could exceed the narrow width:
https://alive2.llvm.org/ce/z/-i_CiM
https://alive2.llvm.org/ce/z/NaYz28

The restriction isn't necessary for a rotate (same operand for
both shifts), so we should adjust the matching for the shift
value as a follow-up enhancement:
https://alive2.llvm.org/ce/z/ahuuQb

Details

Committed
spatelMay 18 2021, 10:32 AM
Parents
rG0b031eeefa8f: [test] Speculative fix for bots (round 2)
Branches
Unknown
Tags
Unknown