[PATCH] D62229: [TargetTransformInfo] assert on nullptr

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 1 10:54:30 PDT 2019


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

LGTM with a couple of optional minor cleanups



================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:684
                  ArrayRef<const Value *> Operands) {
+    assert(Ptr && "can't get GEPCost of nullptr");
     const GlobalValue *BaseGV = nullptr;
----------------
assert for a non-null PointeeType as well ?


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:690
+           "explicit pointee type doesn't match operand's pointee type");
+    BaseGV = dyn_cast<GlobalValue>(Ptr->stripPointerCasts());
     bool HasBaseReg = (BaseGV == nullptr);
----------------
auto *BaseGV = dyn_cast<GlobalValue>(Ptr->stripPointerCasts());


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62229





More information about the llvm-commits mailing list