This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Don't pass on DemandedElts when handling SCALAR_TO_VECTOR
ClosedPublic

Authored by pendingchaos on Dec 3 2018, 8:01 AM.

Details

Summary

Fixes an assertion:

llc: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2200: llvm::KnownBits llvm::SelectionDAG::computeKnownBits(llvm::SDValue, const llvm::APInt&, unsigned int) const: Assertion `(!Op.getValueType().isVector() || NumElts == Op.getValueType().getVectorNumElements()) && "Unexpected vector size"' failed.

Diff Detail

Event Timeline

pendingchaos created this revision.Dec 3 2018, 8:01 AM
RKSimon added inline comments.Dec 3 2018, 8:09 AM
test/CodeGen/AMDGPU/computeKnownBits-scalar-to-vector-crash.ll
1

Even though this is a crash test its probably worth adding at least some basic FileCheck CHECKS (or just run update_llc_test_checks)

Makes the test case use FileCheck.

I don't have commit access.

pendingchaos marked an inline comment as done.Dec 6 2018, 8:32 AM
RKSimon accepted this revision.Dec 6 2018, 9:52 AM

LGTM - I'll commit shortly but please make sure you've requested commit access

This revision is now accepted and ready to land.Dec 6 2018, 9:52 AM
This revision was automatically updated to reflect the committed changes.