forked from OSchip/llvm-project
[TTI] Make assertion compatible with opaque pointers
Dropping the TODO here because it applies to all uses of this method.
This commit is contained in:
parent
3ee6f1a4fa
commit
cfb1cb4491
|
@ -857,9 +857,8 @@ public:
|
||||||
ArrayRef<const Value *> Operands,
|
ArrayRef<const Value *> Operands,
|
||||||
TTI::TargetCostKind CostKind = TTI::TCK_SizeAndLatency) {
|
TTI::TargetCostKind CostKind = TTI::TCK_SizeAndLatency) {
|
||||||
assert(PointeeType && Ptr && "can't get GEPCost of nullptr");
|
assert(PointeeType && Ptr && "can't get GEPCost of nullptr");
|
||||||
// TODO: will remove this when pointers have an opaque type.
|
assert(cast<PointerType>(Ptr->getType()->getScalarType())
|
||||||
assert(Ptr->getType()->getScalarType()->getPointerElementType() ==
|
->isOpaqueOrPointeeTypeMatches(PointeeType) &&
|
||||||
PointeeType &&
|
|
||||||
"explicit pointee type doesn't match operand's pointee type");
|
"explicit pointee type doesn't match operand's pointee type");
|
||||||
auto *BaseGV = dyn_cast<GlobalValue>(Ptr->stripPointerCasts());
|
auto *BaseGV = dyn_cast<GlobalValue>(Ptr->stripPointerCasts());
|
||||||
bool HasBaseReg = (BaseGV == nullptr);
|
bool HasBaseReg = (BaseGV == nullptr);
|
||||||
|
|
Loading…
Reference in New Issue