This is an archive of the discontinued LLVM Phabricator instance.

X86: Fixed assertion failure in 32-bit mode
ClosedPublic

Authored by delena on Jul 22 2015, 6:54 AM.

Details

Summary

The DAG Node "SCALAR_TO_VECTOR" may be created if the type of scalar element is legal.
Added a check for scalar type before creating this node.
Added a test that fails with assertion on the current version.

Diff Detail

Repository
rL LLVM

Event Timeline

delena updated this revision to Diff 30345.Jul 22 2015, 6:54 AM
delena retitled this revision from to X86: Fixed assertion failure in 32-bit mode.
delena updated this object.
delena added a reviewer: mkuper.
delena set the repository for this revision to rL LLVM.
delena added a subscriber: llvm-commits.
mkuper added inline comments.Jul 22 2015, 7:09 AM
lib/Target/X86/X86ISelLowering.cpp
7385 ↗(On Diff #30345)

This seems a bit odd - if getScalarValueForVectorElement() returned a non-null value, there was already a SCALAR_TO_VECTOR or a BUILD_VECTOR there. So why would forming a SCALAR_TO_VECTOR be wrong?

(I'm not saying it's not, I just don't understand why.)

delena added inline comments.Jul 22 2015, 11:45 PM
lib/Target/X86/X86ISelLowering.cpp
7385 ↗(On Diff #30345)

The pattern here is " BITCAST(v2f64 (SCALAR_TO_VECTOR (f64 Val))) to v2i64."
So, the original "scalar_to_vector" was legal.

mkuper accepted this revision.Jul 23 2015, 12:30 AM
mkuper edited edge metadata.

LGTM.

lib/Target/X86/X86ISelLowering.cpp
7385 ↗(On Diff #30345)

Ah, ok, makes sense.

This revision is now accepted and ready to land.Jul 23 2015, 12:30 AM
This revision was automatically updated to reflect the committed changes.