[PATCH] D101177: [AMDGPU] Skip invariant loads when avoiding WAR conflicts

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 06:01:26 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1529
+        if (!Memop->isInvariant()) {
+          const Value *Ptr = Memop->getValue();
+          SLoadAddresses.insert(std::make_pair(Ptr, Inst.getParent()));
----------------
arsenm wrote:
> foad wrote:
> > Might be worth asserting that Ptr is not null here, since that's what caused the problem in the first place?
> Not having the value set is *not* an error. This should not be an assert. This is a situation that needs to work. If we had two loads if converted into a select on the pointer, it would have been correct to strip out the IR value
OK, but just removing the assert is no good, because then we'll be back in the same situation of adding nullptr as a map key and getting non-deterministic compiles.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101177/new/

https://reviews.llvm.org/D101177



More information about the llvm-commits mailing list