[PATCH] D137815: [DirectX backend] Fix build and test error caused by out of sync with upstream change.

Tex Riddell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 14:15:56 PST 2022


tex3d added inline comments.


================
Comment at: llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp:942
+          } else {
+            if (ME.onlyReadsMemory()) {
+              Record.push_back(0);
----------------
tex3d wrote:
> If function only reads from arg mem, won't `ME.onlyReadsMemory()` be true, leading to both attributes: `readonly` and `argmemonly`?  I think in this case you only want `argmemonly`.
> 
> I think instead, we need something like:
> ```
> if (ME.onlyAccessesArgPointees()) {
>   ...
> } else if (ME.onlyReadsMemory()) {
>   ...
> }
> ```
Then again, I do see some other case with both these attributes, so maybe this behavior is desirable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137815



More information about the llvm-commits mailing list