This is an archive of the discontinued LLVM Phabricator instance.

[X86] Prevent multiple calls to ISD::isConstantSplatVector from returning a narrower APInt than the original scalar type
AbandonedPublic

Authored by craig.topper on Aug 21 2017, 8:16 PM.

Details

Reviewers
chandlerc
Summary

ISD::isConstantSplatVector can shrink to the smallest splat width. But we don't check the size of the resulting APInt at all. This can cause us to misinterpret the results.

This patch just adds a flag to prevent the APInt from changing width.

Still need to collect test cases.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 21 2017, 8:16 PM
chandlerc edited edge metadata.Aug 21 2017, 8:23 PM

comment on the false parameters to help clarify what is false?

Yeah that too. I posted this a little hastily since you asked about it.

chandlerc added inline comments.Aug 21 2017, 8:25 PM
include/llvm/CodeGen/SelectionDAGNodes.h
86–87

Also probably worth some comments about shrinking.

craig.topper abandoned this revision.Aug 21 2017, 10:15 PM