summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-09 10:51:26 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-09 10:51:26 +0000
commit38ef296265d80f9e5403ac2058ba45d152bb1689 (patch)
tree3212055dd669d2411b39df1eebc3ab40577f3ee9 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parenta8f8d3b01e94c582346e5f3fa1f22de0a1834062 (diff)
downloadbcm5719-llvm-38ef296265d80f9e5403ac2058ba45d152bb1689.tar.gz
bcm5719-llvm-38ef296265d80f9e5403ac2058ba45d152bb1689.zip
[CodeGenPrepare] Ensure we get a non-null result from getTrueOrFalseValue. NFCI.
llvm-svn: 360328
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index fad3d4a596e..76f82c27847 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -5904,7 +5904,7 @@ static bool isFormingBranchFromSelectProfitable(const TargetTransformInfo *TTI,
static Value *getTrueOrFalseValue(
SelectInst *SI, bool isTrue,
const SmallPtrSet<const Instruction *, 2> &Selects) {
- Value *V;
+ Value *V = nullptr;
for (SelectInst *DefSI = SI; DefSI != nullptr && Selects.count(DefSI);
DefSI = dyn_cast<SelectInst>(V)) {
@@ -5912,6 +5912,8 @@ static Value *getTrueOrFalseValue(
"The condition of DefSI does not match with SI");
V = (isTrue ? DefSI->getTrueValue() : DefSI->getFalseValue());
}
+
+ assert(V && "Failed to get select true/false value");
return V;
}
OpenPOWER on IntegriCloud