mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 14:46:53 +00:00
GlobalISel: fall back gracefully when we hit unhandled legalizer default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288840 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3074f79595
commit
9c3d059fa2
@ -93,7 +93,9 @@ LegalizerInfo::getAction(const InstrAspect &Aspect) const {
|
||||
if (DefaultAction != DefaultActions.end() && DefaultAction->second == Legal)
|
||||
return std::make_pair(Legal, Ty);
|
||||
|
||||
assert(DefaultAction->second == NarrowScalar && "unexpected default");
|
||||
if (DefaultAction == DefaultActions.end() ||
|
||||
DefaultAction->second != NarrowScalar)
|
||||
return std::make_pair(Unsupported, LLT());
|
||||
return findLegalAction(Aspect, NarrowScalar);
|
||||
}
|
||||
|
||||
|
@ -74,3 +74,11 @@ define void @odd_type(i42* %addr) {
|
||||
define void @sequence_mapping([2 x i64] %in) {
|
||||
ret void
|
||||
}
|
||||
|
||||
; Legalizer was asserting when it enountered an unexpected default action.
|
||||
; FALLBACK-WITH-REPORT-ERR: warning: Instruction selection used fallback path for legal_default
|
||||
; FALLBACK-WITH-REPORT-LABEL: legal_default:
|
||||
define void @legal_default(i64 %in) {
|
||||
insertvalue [2 x i64] undef, i64 %in, 0
|
||||
ret void
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user