Page MenuHomePhabricator

[ConstantFold][SVE] Do not iterate on scalable vector for ConstantFoldSelectInstruction.
AbandonedPublic

Authored by huihuiz on Jan 29 2020, 3:57 PM.

Details

Summary

Scanning through ConstantFoldSelectInstruction, we should not fold elementwise for scalable vectors.
Although I cannot create a crashing test case for select instruction, this will require select condition
to be a ConstantVector also scalable.

Add a positive test case, as the rest of the foldings in ConstantFoldSelectInstruction is harmless for scalable vector.

Diff Detail

Event Timeline

huihuiz created this revision.Jan 29 2020, 3:57 PM

It's impossible for a ConstantDataVector or a ConstantVector to be scalable at the moment. And I don't expect that will ever change: there isn't any incentive to make any new constant representation use those types, as opposed to making a new subclass of Constant. Given that, I don't think it's worth adding guards to code that's already explicitly looking for a ConstantVector/ConstantDataVector.

Test change looks fine.

huihuiz abandoned this revision.Jan 30 2020, 10:57 AM

Make sense, merge only the test case