[llvm] [InstCombine][AMDGPU] Disable PtrReplacer when select has mismatch AS. (PR #98456)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 23:26:36 PDT 2024
================
@@ -270,16 +270,54 @@ class PointerReplacer {
unsigned ToAS = ASC->getDestAddressSpace();
return (FromAS == ToAS) || IC.isValidAddrSpaceCast(FromAS, ToAS);
}
+ bool foundASC(const Value *Op) const;
+ bool hasConflictingAS(const SelectInst *I) const;
SmallPtrSet<Instruction *, 32> ValuesToRevisit;
+ SmallPtrSet<SelectInst *, 32> ValuesToRevisitAS;
SmallSetVector<Instruction *, 4> Worklist;
MapVector<Value *, Value *> WorkMap;
InstCombinerImpl &IC;
Instruction &Root;
unsigned FromAS;
+ bool HasASC = false;
};
} // end anonymous namespace
+/// Return true iff valid addrspacecast is found on
+/// path from end of branch to root of tree.
+bool PointerReplacer::foundASC(const Value *Op) const {
+ const Instruction *TI;
----------------
arsenm wrote:
Can you just check if the access address space matches the root address space?
https://github.com/llvm/llvm-project/pull/98456
More information about the llvm-commits
mailing list