[PATCH] D139415: [RFC][WebAssembly] Optimize GEPs

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 05:31:55 PST 2022


samparker added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyOptimizeGEPs.cpp:109
+  IntegerType *ArithTy = nullptr;
+  SmallVector<BaseOffsetPair, 4> BasePairs;
+  DenseMap<BaseOffsetPair, SmallVector<RebaseCandidate, 4>> Candidates;
----------------
tlively wrote:
> Do we need `BasePairs`? It looks like we could remove it if we iterate through the `Candidates` keys instead.
IIUC, we then won't have a stable iteration order - I originally tried doing this but I got intermittent test failures. 


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp:455
+  // Modify GetElementPtr before LoopStrengthReduce.
+  if (getOptLevel() != CodeGenOpt::None)
+    addPass(createWebAssemblyOptimizeGEPs());
----------------
dschuff wrote:
> Does this pass fix up debug info when necessary?
> If feasible, it should; but if not, maybe we should restrict it to CodeGenOpt::Default and higher.
No, it doesn't. I'm going to update the patch to not add it into the backend pipeline yet.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139415/new/

https://reviews.llvm.org/D139415



More information about the llvm-commits mailing list