forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV][TTI] Avoid an infinite recursion issue in getCastInstrCost (l…
…lvm#110164) Calling into BasicTTI is not always safe. In particular, BasicTTI does not have a full legalization implementation (vector widening is missing), and falls back on scalarization. The problem is that scalarization for <N x i1> vectors is cost in terms of the cast API and we can end up in an infinite recursive cycle. The "right" fix for this would be teach BasicTTI how to model the full legalization state machine, but several attempts at doing so have resulted in dead ends or undesirable cost changes for targets I don't understand. This patch instead papers over the issue by avoiding the call to the base class when dealing with an i1 source or dest. This doesn't necessarily produce correct costs, but it should at least return something semi-sensible and not crash. Fixes llvm#108708
- Loading branch information
Showing
3 changed files
with
158 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.