[PATCH] [TTI/CostModel] improve TTI::getGEPCost and use it in CostModel::getInstructionCost

hfinkel at anl.gov hfinkel at anl.gov
Mon Jun 22 16:59:35 PDT 2015


================
Comment at: include/llvm/Analysis/TargetTransformInfoImpl.h:397
@@ +396,3 @@
+    if (Ptr != nullptr) {
+      // TODO: will remove this when a pointer can have an opaque type.
+      assert(Ptr->getType()->getScalarType()->getPointerElementType() ==
----------------
pointer can have -> pointers have

================
Comment at: include/llvm/Analysis/TargetTransformInfoImpl.h:410
@@ +409,3 @@
+    for (const Value *Operand : Operands0)
+      Operands.push_back(const_cast<Value *>(Operand));
+
----------------
I don't understand why you're doing this. Will gep_type_begin not compile with an ArrayRef<const Value *>? If so, we should just fix that.


================
Comment at: include/llvm/Analysis/TargetTransformInfoImpl.h:413
@@ +412,3 @@
+    // The address space of the starting pointer type is unimportant; its
+    // address space won't be used.
+    generic_gep_type_iterator<Value *const *> GTI = gep_type_begin(
----------------
That's not right. isLegalAddressingMode takes the address space as an optional last parameter. Please propagate it.

http://reviews.llvm.org/D9819

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list