[PATCH] D94230: [AArch64][SVE] Add SVE IR pass to coalesce ptrue instrinsic calls

Joe Ellis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 03:18:40 PST 2021


joechrisellis added a comment.

Hi @david-arm, thanks for the review!

I have updated my local commit message, but unfortunately `arc` doesn't seem to propagate this change to phabricator. Will do it manually. Good spot though!



================
Comment at: llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp:202
+    Builder.SetInsertPoint(&BB, ++ConvertToSVBool->getIterator());
+    auto *ConvertFromSVBool =
+        Builder.CreateIntrinsic(Intrinsic::aarch64_sve_convert_from_svbool,
----------------
david-arm wrote:
> What if there are multiple ptrues with the same type as the most encompassing? We'll be needlessly creating convert_from_svbool intrinsics here I think? I think in this case we can just call replaceAllUsesWith(MostEncompassingPTrueVTy)
Good question -- this case is actually captured in the test below, see `coalesce_test_same_size`. 😄 

```                                                                                                                                                                                                                                                                                                                                                                              ; Two calls to the SVE ptrue intrinsic which are both of the same size. In this case, one should be identified
; as redundant and rewritten and an SVE reinterpret of the other via the convert.{to,from}.svbool intrinsics.
; This introduces a redundant conversion which will then be eliminated.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94230



More information about the llvm-commits mailing list