diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 179f29cdafa..130b876ee96 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -171,8 +171,10 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions) { SwitchInst::CaseIt FirstCase = SI->case_begin(); ConstantRangesSet CRS = FirstCase.getCaseValueEx(); if (CRS.getNumItems() == 1 && CRS.isSingleNumber(0)) { + // FIXME: Currently work with ConstantInt based numbers. Value *Cond = Builder.CreateICmpEQ(SI->getCondition(), - CRS.getItem(0).Low, "cond"); + CRS.getItem(0).Low.toConstantInt(), + "cond"); // Insert the new branch. Builder.CreateCondBr(Cond, FirstCase.getCaseSuccessor(), |