mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
CodeGenPrepare: Don't crash when TLI is not available.
This happens when codegenprepare is invoked via opt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159457 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
54d69668b2
commit
6c50551e9a
@ -1133,7 +1133,8 @@ static bool isFormingBranchFromSelectProfitable(SelectInst *SI) {
|
||||
bool CodeGenPrepare::OptimizeSelectInst(SelectInst *SI) {
|
||||
// If we have a SelectInst that will likely profit from branch prediction,
|
||||
// turn it into a branch.
|
||||
if (DisableSelectToBranch || OptSize || !TLI->isPredictableSelectExpensive())
|
||||
if (DisableSelectToBranch || OptSize || !TLI ||
|
||||
!TLI->isPredictableSelectExpensive())
|
||||
return false;
|
||||
|
||||
if (!SI->getCondition()->getType()->isIntegerTy(1) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user