Page MenuHomePhabricator

[X86] Exclude invalid element types for bitcast/broadcast folding.
ClosedPublic

Authored by fhahn on Jun 23 2021, 9:52 AM.

Details

Summary

It looks like the fold introduced in 63f3383ece25efa can cause crashes
if the type of the bitcasted value is not a valid vector element type,
like x86_mmx.

To resolve the crash, reject invalid vector element types. The way it is
done in the patch is a bit clunky. Perhaps there's a better way to
check?

Diff Detail

Event Timeline

fhahn created this revision.Jun 23 2021, 9:52 AM
fhahn requested review of this revision.Jun 23 2021, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2021, 9:52 AM
RKSimon accepted this revision.Jun 24 2021, 1:49 AM

LGTM - with one minor - cheers!

llvm/test/CodeGen/X86/avx-vbroadcast.ll
975

nounwind

This revision is now accepted and ready to land.Jun 24 2021, 1:49 AM
This revision was landed with ongoing or failed builds.Jun 24 2021, 4:41 AM
This revision was automatically updated to reflect the committed changes.
fhahn added inline comments.Jun 24 2021, 4:41 AM
llvm/test/CodeGen/X86/avx-vbroadcast.ll
975

Thanks! I added unwind and I also added the same test to avx2-vbroadcast.ll