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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 06:14:55 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;
----------------
nikic wrote:

Use std::optional instead?

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


More information about the llvm-commits mailing list