summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-29 19:56:26 +0000
committerngie <ngie@FreeBSD.org>2015-12-29 19:56:26 +0000
commit48b72481dba08c5185c1dd6a70b82b326be43d6b (patch)
treebfa4f047c73b138c59732a37297737fa1ffd3e91 /contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp
parentf8c5cd12c37a92500da3f42f1d25bae9cc70e30a (diff)
parentc0ae58548ada98f553239a091b8764ea9e1b474b (diff)
downloadFreeBSD-src-48b72481dba08c5185c1dd6a70b82b326be43d6b.zip
FreeBSD-src-48b72481dba08c5185c1dd6a70b82b326be43d6b.tar.gz
MFhead @ r292618
Diffstat (limited to 'contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp')
-rw-r--r--contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp b/contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp
index 58d3c3d..46b8d13 100644
--- a/contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp
+++ b/contrib/llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp
@@ -103,6 +103,11 @@ protected:
VNInfo *AddendValNo =
LIS->getInterval(MI->getOperand(1).getReg()).Query(FMAIdx).valueIn();
+ if (!AddendValNo) {
+ // This can be null if the register is undef.
+ continue;
+ }
+
MachineInstr *AddendMI = LIS->getInstructionFromIndex(AddendValNo->def);
// The addend and this instruction must be in the same block.
@@ -181,11 +186,14 @@ protected:
if (!KilledProdOp)
continue;
- // For virtual registers, verify that the addend source register
- // is live here (as should have been assured above).
- assert((!TargetRegisterInfo::isVirtualRegister(AddendSrcReg) ||
- LIS->getInterval(AddendSrcReg).liveAt(FMAIdx)) &&
- "Addend source register is not live!");
+ // If the addend copy is used only by this MI, then the addend source
+ // register is likely not live here. This could be fixed (based on the
+ // legality checks above, the live range for the addend source register
+ // could be extended), but it seems likely that such a trivial copy can
+ // be coalesced away later, and thus is not worth the effort.
+ if (TargetRegisterInfo::isVirtualRegister(AddendSrcReg) &&
+ !LIS->getInterval(AddendSrcReg).liveAt(FMAIdx))
+ continue;
// Transform: (O2 * O3) + O1 -> (O2 * O1) + O3.
OpenPOWER on IntegriCloud