This patch fixes some crashes coming from
X86ISelLowering::getSetCCResultType, which would occasionally return
an EVT constructed from an invalid MVT, which has a null Type pointer.
This patch refers to D95434.
Differential D97036
[X86] Fix a codegen crash in getSetCCResultType pengfei on Feb 19 2021, 12:50 AM. Authored by
Details This patch fixes some crashes coming from This patch refers to D95434.
Diff Detail
Event TimelineComment Actions I don’t think I understand. VT is an EVT. Why does changeVectorElementType involve MVT? Comment Actions Oh I see. changeVectorElementType assumes that if the type is simple and type to change to is simple it will succeed in MVT. That seems like a poor implementation. Maybe it should check the result and fallback to the extended implementation of it fails on MVT? This patch seems fine though. LGTM Comment Actions If I'm not mistaken, changeTypeToInteger and changeVectorElementTypeToInteger could in theory suffer from the same problem. Though less likely, as any MVT is most likely going to have an MVT with the same-sized integer type. Comment Actions Grrr. We can't make this change. The extended implementation relies on there being an LLVMTy to get context from. I think there's a bug in EVT::changeVectorElementType if the vector type is simple, but the element type is not. We'll fall into extended implementation, but LLVMTy is null. |