summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorSerguei Katkov <serguei.katkov@azul.com>2018-01-09 04:37:06 +0000
committerSerguei Katkov <serguei.katkov@azul.com>2018-01-09 04:37:06 +0000
commit4d1dd6b53abd47be71bd3001f2937d9b8ad11ecb (patch)
tree4bdbb69b8424d661b81bcef1caf37c3bbad10a42 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent33a17762bb0977d9c919505a6d3f3215f132d113 (diff)
downloadbcm5719-llvm-4d1dd6b53abd47be71bd3001f2937d9b8ad11ecb.tar.gz
bcm5719-llvm-4d1dd6b53abd47be71bd3001f2937d9b8ad11ecb.zip
[CGP] Fix Complex addressing mode for offset
If the offset is differ in two addressing mode we can continue only if ScaleReg is not set due to we will use it as merge of different offsets. It should fix PR35799 and PR35805. Reviewers: john.brawn, reames Reviewed By: reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41227 llvm-svn: 322056
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 9dc1ab4e6bb..26ca8d4ee88 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -2700,8 +2700,13 @@ public:
// we still need to collect it due to original value is different.
// And later we will need all original values as anchors during
// finding the common Phi node.
+ // We also must reject the case when base offset is different and
+ // scale reg is not null, we cannot handle this case due to merge of
+ // different offsets will be used as ScaleReg.
if (DifferentField != ExtAddrMode::MultipleFields &&
- DifferentField != ExtAddrMode::ScaleField) {
+ DifferentField != ExtAddrMode::ScaleField &&
+ (DifferentField != ExtAddrMode::BaseOffsField ||
+ !NewAddrMode.ScaledReg)) {
AddrModes.emplace_back(NewAddrMode);
return true;
}
OpenPOWER on IntegriCloud