[llvm] [Attributor] Skip AS specialization for volatile memory instructions (PR #107250)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 4 09:00:36 PDT 2024
================
@@ -12509,6 +12509,34 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
/// ------------------------ Address Space ------------------------------------
namespace {
+
+template <typename InstType>
+static bool makeChange(Attributor &A, InstType *MemInst, const Use &U,
+ Value *OriginalValue, PointerType *NewPtrTy,
+ bool UseOriginalValue) {
+ if (U.getOperandNo() != InstType::getPointerOperandIndex())
+ return false;
+
+ auto *TTI = A.getInfoCache().getAnalysisResultForFunction<TargetIRAnalysis>(
+ *MemInst->getFunction());
+ if (!TTI)
+ return false;
+
+ unsigned OldAS = MemInst->getPointerAddressSpace();
+ if (MemInst->isVolatile() && !TTI->hasVolatileVariant(MemInst, OldAS))
----------------
arsenm wrote:
I still think the existence of hasVolatileVariant is dubious; my original interpretation of volatile was never change the memory instruction emitted and then this got benchmark hacked for PTX
https://github.com/llvm/llvm-project/pull/107250
More information about the llvm-commits
mailing list