Revision d5f74cddc3d367baafa49077f931281fc61e3c3f authored by Milan Bouchet-Valat on 15 December 2017, 21:22:28 UTC, committed by Milan Bouchet-Valat on 04 January 2018, 15:52:53 UTC
1 parent 93eef2d
llvm-Yet-another-fix.patch
From e92be5eb5c60dfdeb5d41d81c82f0aca0c1e4aa9 Mon Sep 17 00:00:00 2001
From: Yichao Yu <yyc1992@gmail.com>
Date: Sat, 17 Jun 2017 17:29:53 -0400
Subject: [PATCH] 4.0 fix
---
lib/CodeGen/CodeGenPrepare.cpp | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/lib/CodeGen/CodeGenPrepare.cpp b/lib/CodeGen/CodeGenPrepare.cpp
index 44d6b3e264c..4177819e989 100644
--- a/lib/CodeGen/CodeGenPrepare.cpp
+++ b/lib/CodeGen/CodeGenPrepare.cpp
@@ -4067,6 +4067,23 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
// non-integral pointers, so in that case bail out now.
if (DL->isNonIntegralPointerType(Addr->getType()))
return false;
+ if (AddrMode.BaseReg) {
+ Type *BaseTy = AddrMode.BaseReg->getType();
+ if (BaseTy->isPointerTy() && DL->isNonIntegralPointerType(BaseTy)) {
+ return false;
+ }
+ }
+ if (AddrMode.Scale) {
+ Type *ScaleTy = AddrMode.ScaledReg->getType();
+ if (ScaleTy->isPointerTy() && DL->isNonIntegralPointerType(ScaleTy)) {
+ return false;
+ }
+ }
+ if (AddrMode.BaseGV) {
+ if (DL->isNonIntegralPointerType(AddrMode.BaseGV->getType())) {
+ return false;
+ }
+ }
DEBUG(dbgs() << "CGP: SINKING nonlocal addrmode: " << AddrMode << " for "
<< *MemoryInst << "\n");
--
2.13.1
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...