Commit ea56dcb7 authored by Sanjay Patel's avatar Sanjay Patel
Browse files

[InstCombine] fix miscompile from dropRedundantMaskingOfLeftShiftInput()

The test is from https://llvm.org/PR51351.

There are 2 related logic bugs from over-generalizing "lshr" to "any shr",
but I'm not sure how to expose the difference for "MaskC" because instsimplify
already folds ashr of -1.

I'll extend instsimplify to catch the MaskD pattern as a follow-up, but this
patch should be enough to avoid the miscompile.
parent d3e2067c
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment