[PATCH] D147599: [MLIR][OpenMP] Update OpenMPIRBuilderTest to use opaque pointers

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 11:09:36 PDT 2023


zero9178 added a comment.

In D147599#4248913 <https://reviews.llvm.org/D147599#4248913>, @TIFitis wrote:

> @gysit @zero9178 I am looking at updating these tests to use `opaque` pointers. I have updated all of the ones that had issues except the `CreateReductions` and `CreateTwoReductions` tests which I am facing some difficulty in changing.
> The source of issues for most if not all of these tests are the deletion of `bitcast` instructions which are made redundant by opaque pointers.
> Any insights or suggestions would be highly appreciated.

I am not at all familiar with this code but a quick look at the module reveleaed that since a bitcast gets deleted, `FirstPrivatized` gets a new use in the value operand of a store instruction. Looking at `isSimpleBinaryReduction`, it seems the intention of the test is to check whether a binary instruction is stored into `Accum`.

What you could do is use `findStoredValue` instead of `findSingleUserInBlock` within `isSimplyBinaryReduction` and adjust the code in `findStoredValue` to 1) only check uses where `AllocaValue` is used as the pointer operand (this should filter the new use created by the removal of the bitcast as that is in the value operand position) and 2) add an optional `BasicBlock*` argument to allow only checking stored values within a basic block (similar to how `findSingleUserInBlock`) currently does it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147599



More information about the llvm-commits mailing list