This is an archive of the discontinued LLVM Phabricator instance.

[ValueTypes] Assert if changeVectorElementType is called on a simple type with an extended element type.
ClosedPublic

Authored by craig.topper on Feb 19 2021, 11:30 AM.

Details

Summary

Previously we would use the extended implementation, but
the extended implementation requires the vector type to be extended
so that we can access the LLVMContext. In theory we could
detect this case and use the context from the element type instead,
but since I know of no cases hitting this in practice today
I've done the simplest thing.

Also add asserts to several extended EVT functions that assume
LLVMTy is non-null.

Follow from discussion in D97036

Diff Detail

Event Timeline

craig.topper created this revision.Feb 19 2021, 11:30 AM
craig.topper requested review of this revision.Feb 19 2021, 11:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2021, 11:30 AM
pengfei accepted this revision.Feb 19 2021, 5:03 PM

LGTM.

llvm/lib/CodeGen/ValueTypes.cpp
18

It seems all the 3 functions are checked for not simple before called. But adding assertions are fine.

This revision is now accepted and ready to land.Feb 19 2021, 5:03 PM
This revision was landed with ongoing or failed builds.Feb 19 2021, 5:35 PM
This revision was automatically updated to reflect the committed changes.