summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorQuentin Colombet <quentin.colombet@gmail.com>2019-07-06 00:34:54 +0000
committerQuentin Colombet <quentin.colombet@gmail.com>2019-07-06 00:34:54 +0000
commit0ffe0db6fab479bd0d988d84a40ec8626cf6e426 (patch)
treef2607b82ce083c7c07f5363f65f8a54f21792eab /llvm/lib
parent705e46f449e6b01ffd7ac033e670fe15a6f52058 (diff)
downloadbcm5719-llvm-0ffe0db6fab479bd0d988d84a40ec8626cf6e426.tar.gz
bcm5719-llvm-0ffe0db6fab479bd0d988d84a40ec8626cf6e426.zip
[RegisterCoalescer] Fix an overzealous assert
Although removeCopyByCommutingDef deals with full copies, it is still possible to copy undef lanes and thus, we wouldn't have any a value number for these lanes. This fixes PR40215. llvm-svn: 365256
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index 0dc5ae188eb..535e5bd7628 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -935,7 +935,14 @@ RegisterCoalescer::removeCopyByCommutingDef(const CoalescerPair &CP,
const SlotIndexes &Indexes = *LIS->getSlotIndexes();
for (LiveInterval::SubRange &SA : IntA.subranges()) {
VNInfo *ASubValNo = SA.getVNInfoAt(AIdx);
- assert(ASubValNo != nullptr);
+ // Even if we are dealing with a full copy, some lanes can
+ // still be undefined.
+ // E.g.,
+ // undef A.subLow = ...
+ // B = COPY A <== A.subHigh is undefined here and does
+ // not have a value number.
+ if (!ASubValNo)
+ continue;
MaskA |= SA.LaneMask;
IntB.refineSubRanges(
OpenPOWER on IntegriCloud