aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2024-09-27 07:47:09 -0700
committerGitHub <noreply@github.com>2024-09-27 07:47:09 -0700
commit1a9569c4f025ef72a427a6c03be6d4b5db72cf1c (patch)
tree32390f37eded51d2da79fbbb8bd557ac813be51f /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent296901fd00825f5a8f6b3358865b0f21f6803b5d (diff)
downloadllvm-1a9569c4f025ef72a427a6c03be6d4b5db72cf1c.zip
llvm-1a9569c4f025ef72a427a6c03be6d4b5db72cf1c.tar.gz
llvm-1a9569c4f025ef72a427a6c03be6d4b5db72cf1c.tar.bz2
[RISCV][TTI] Avoid an infinite recursion issue in getCastInstrCost (#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 https://github.com/llvm/llvm-project/issues/108708
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
0 files changed, 0 insertions, 0 deletions