summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 13bdad71252..51f2a320b29 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -2751,17 +2751,16 @@ struct ExtAddrMode : public TargetLowering::AddrMode {
return static_cast<FieldName>(Result);
}
- // AddrModes with a base reg or gv where the reg/gv is just the original
- // value are trivial.
+ // AddrModes with a baseReg or gv where the reg/gv is
+ // the only populated field are trivial.
bool isTrivial() {
- bool Trivial = (BaseGV && BaseGV == OriginalValue) ||
- (BaseReg && BaseReg == OriginalValue);
- // If the AddrMode is trivial it shouldn't have an offset or be scaled.
- if (Trivial) {
- assert(BaseOffs == 0);
- assert(Scale == 0);
- }
- return Trivial;
+ if (BaseGV && !BaseOffs && !Scale && !BaseReg)
+ return true;
+
+ if (!BaseGV && !BaseOffs && !Scale && BaseReg)
+ return true;
+
+ return false;
}
};
OpenPOWER on IntegriCloud