[PATCH] D38278: [CGP] Make optimizeMemoryInst capable of handling multiple AddrModes

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 22:04:36 PDT 2017


skatkov added inline comments.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:2696
 
-  bool operator==(const ExtAddrMode& O) const {
-    return (BaseReg == O.BaseReg) && (ScaledReg == O.ScaledReg) &&
-           (BaseGV == O.BaseGV) && (BaseOffs == O.BaseOffs) &&
-           (HasBaseReg == O.HasBaseReg) && (Scale == O.Scale);
+  FieldName compare(const ExtAddrMode &other) {
+    unsigned Result = NoField;
----------------
Don't you want to check type compatibility also here?
Say if type of base regs are different we can return Incompatible types here.

The similar for others...

Or we can do it as a separate patch...


Repository:
  rL LLVM

https://reviews.llvm.org/D38278





More information about the llvm-commits mailing list