HomePhabricator

[InstCombine] Fix a nasty miscompile introduced w/masked.gather demanded elts

Description

[InstCombine] Fix a nasty miscompile introduced w/masked.gather demanded elts

This fixes a miscompile which was introduced in r356510 (https://reviews.llvm.org/D57372).

The problem is that the original patch removed pointer operands where the load results we're demanded, but without considering the legality of the load itself. If the masked.gather had active, but undemanded, lanes, then we could end up creating a load which loaded from an undef address. The result could be a segfault, or, in theory, an arbitrary read from a random memory location into an used register.

Details

Committed
reamesApr 12 2019, 11:26 AM
Parents
rL358298: [CVP] Set NSW/NUW flags when simplifying with.overflow
Branches
Unknown
Tags
Unknown