[PATCH] D74581: [llvm][CodeGen][aarch64] Add contiguous prefetch intrinsics for SVE.

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 14:02:11 PST 2020


fpetrogalli marked 2 inline comments as done.
fpetrogalli added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:4491
 
-  EVT MemVT = cast<MemSDNode>(Root)->getMemoryVT();
+  if (MemVT == EVT())
+    return false;
----------------
andwar wrote:
> What's this check for? Wouldn't some hard-coded null-value be more idiomatic?
I think `EVT()` is there to simulate a `nullptr`, see http://llvm.org/doxygen/ValueTypes_8h_source.html:

```
   struct EVT {
   private:
     MVT V = MVT::INVALID_SIMPLE_VALUE_TYPE;
     Type *LLVMTy = nullptr;
 
   public:
     constexpr EVT() = default;
```

Essentially, if statement checks that the `MemVT` is not `{ MVT::INVALID_SIMPLE_VALUE_TYPE, nullptr}`.


================
Comment at: llvm/test/CodeGen/AArch64/sve-intrinsics-contiguous-prefetches.ll:100
+; CHECK-LABEL: test_svprf_vnum_under
+; CHECK-NOT: prfb pstl3strm, p0, [x0, #-33, mul vl]
+entry:
----------------
andwar wrote:
> Would it make sense to add checks for what's expected instead?
I guess you are right. We could miss  a failure in the addressing mode generation if we have (at the same time) a failure in the rendering of the immediate constant... quite a remote possibility, which I am sure it will be caught in time in some other tests.

So I think we can leave it as it is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74581





More information about the llvm-commits mailing list