[llvm] [EarlyCSE] Compare GEP instructions based on offset (PR #65875)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 18:06:35 PDT 2023


================
@@ -553,6 +553,77 @@ bool DenseMapInfo<CallValue>::isEqual(CallValue LHS, CallValue RHS) {
   return LHSI->isIdenticalTo(RHSI);
 }
 
+//===----------------------------------------------------------------------===//
+// GEPValue
+//===----------------------------------------------------------------------===//
+
+namespace {
+
+struct GEPValue {
+  Instruction *Inst;
+  APInt ConstantOffset;
+  bool HasConstantOffset;
----------------
DianQK wrote:

I seem to get a poor performance. Maybe I missed something, I'll look at it again.
- Compare it to using bool: https://llvm-compile-time-tracker.com/compare.php?from=12eda5cf2df6438453683ce8c917a64786686a69&to=ff70ae265ac5ad9da12836ae954fd64ce5b38df4&stat=instructions:u
- Full: https://llvm-compile-time-tracker.com/compare.php?from=ac1daad9bb4eb083df6b215c029816d3149e00d8&to=ff70ae265ac5ad9da12836ae954fd64ce5b38df4&stat=instructions%3Au

https://github.com/llvm/llvm-project/pull/65875


More information about the llvm-commits mailing list