================
@@ -2216,6 +2216,46 @@ static bool hasUniformPointerOperand(const Instruction
*I,
return isa<Constant>(Ptr);
}
+static std::pair<bool, bool> getKnownBufferOobProperties(const GCNSubtarget
&ST,
+ const DataLayout &DL,
+ const Instruction *I,
+ unsigned Bytes) {
+ const Value *Ptr = I ? getLoadStorePointerOperand(I) : nullptr;
+ if (!Ptr ||
+ Ptr->getType()->getPointerAddressSpace() != AMDGPUAS::BUFFER_FAT_POINTER)
+ return {false, false};
+ APInt Offset(DL.getIndexTypeSizeInBits(Ptr->getType()), 0);
+ while (const auto *GEP = dyn_cast<GEPOperator>(Ptr)) {
+ if (!GEP->accumulateConstantOffset(DL, Offset))
----------------
krzysz00 wrote:
> Well, lowering lowering does not use the flags today, but generally speaking
> - you are right. I'd teach analyzeOobProperties first in a separate patch and
> have TTI follow.
Good point - I'll look into that when I've got a moment
(and I think it *might* be using the flags by way of scev - I'd need to check)
https://github.com/llvm/llvm-project/pull/238842
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits