[llvm-branch-commits] [llvm-branch] r322645 - Merging r322056:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 17 05:01:33 PST 2018


Author: hans
Date: Wed Jan 17 05:01:33 2018
New Revision: 322645

URL: http://llvm.org/viewvc/llvm-project?rev=322645&view=rev
Log:
Merging r322056:
------------------------------------------------------------------------
r322056 | skatkov | 2018-01-08 20:37:06 -0800 (Mon, 08 Jan 2018) | 13 lines

[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


------------------------------------------------------------------------

Added:
    llvm/branches/release_60/test/Transforms/CodeGenPrepare/X86/sink-addrmode-select.ll
      - copied unchanged from r322056, llvm/trunk/test/Transforms/CodeGenPrepare/X86/sink-addrmode-select.ll
Modified:
    llvm/branches/release_60/   (props changed)
    llvm/branches/release_60/lib/CodeGen/CodeGenPrepare.cpp

Propchange: llvm/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 17 05:01:33 2018
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,321789,321980,322103
+/llvm/trunk:155241,321789,321980,322056,322103

Modified: llvm/branches/release_60/lib/CodeGen/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/lib/CodeGen/CodeGenPrepare.cpp?rev=322645&r1=322644&r2=322645&view=diff
==============================================================================
--- llvm/branches/release_60/lib/CodeGen/CodeGenPrepare.cpp (original)
+++ llvm/branches/release_60/lib/CodeGen/CodeGenPrepare.cpp Wed Jan 17 05:01:33 2018
@@ -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;
     }




More information about the llvm-branch-commits mailing list