[PATCH] D66165: Move isPointerOffset function to ValueTracking.

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 19:50:47 PDT 2019


vitalybuka accepted this revision.
vitalybuka added a comment.
This revision is now accepted and ready to land.

It's does not change code, but looks like it can be improved in followup patches



================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5700
+
+static int64_t getOffsetFromIndex(const GEPOperator *GEP, unsigned Idx,
+                                  bool &VariableIdxFound,
----------------
pair<int64_t, bool>


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5713
+    if (!OpC)
+      return VariableIdxFound = true;
+    if (OpC->isZero())
----------------
This line is confusing:
```
return VariableIdxFound = true;
```


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5732
+
+bool llvm::isPointerOffset(Value *Ptr1, Value *Ptr2, int64_t &Offset,
+                           const DataLayout &DL) {
----------------
```
pair<bool, int64_t> llvm::isPointerOffset(const Value *Ptr1, const Value *Ptr2,
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66165





More information about the llvm-commits mailing list