summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/PeepholeOptimizer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
index d521ae8f958..11ff79cb9f3 100644
--- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp
+++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
@@ -1887,8 +1887,10 @@ ValueTrackerResult ValueTracker::getNextSourceImpl() {
assert(Def && "This method needs a valid definition");
assert(
- (DefIdx < Def->getDesc().getNumDefs() || Def->getDesc().isVariadic()) &&
- Def->getOperand(DefIdx).isDef() && "Invalid DefIdx");
+ (Def->getOperand(DefIdx).isDef() &&
+ (DefIdx < Def->getDesc().getNumDefs() || Def->getDesc().isVariadic()) ||
+ Def->getOperand(DefIdx).isImplicit()) &&
+ "Invalid DefIdx");
if (Def->isCopy())
return getNextSourceFromCopy();
if (Def->isBitcast())
OpenPOWER on IntegriCloud