This patch updates all tests to use to use the opaque pointers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp | ||
---|---|---|
4303–4308 | This returns false now as isSimpleBinaryReduction expects a single StoreInst user within the block for FirstPrivatized and SecondPrivatized but with the BitCast Inst's removed they have two StoreInst. |
@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 revealed 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.
This returns false now as isSimpleBinaryReduction expects a single StoreInst user within the block for FirstPrivatized and SecondPrivatized but with the BitCast Inst's removed they have two StoreInst.