[PATCH] D114940: [OMPIRBuilder] Support ordered clause specified without parameter

Peixin Qiao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 28 03:41:25 PDT 2022


peixin added a comment.

@Meinersbur This is ready for review now.



================
Comment at: llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp:2025-2028
+  AllocaInst *PLastIter = dyn_cast<AllocaInst>(&*(AllocaIter++));
+  AllocaInst *PLowerBound = dyn_cast<AllocaInst>(&*(AllocaIter++));
+  AllocaInst *PUpperBound = dyn_cast<AllocaInst>(&*(AllocaIter++));
+  AllocaInst *PStride = dyn_cast<AllocaInst>(&*(AllocaIter++));
----------------
Meinersbur wrote:
> I think assuming a specific order of allocas and other instructions is not that useful. They break easily with any change and are hard to repair since the instruction order has no meaning. The code here effectively only tests "there are 4 alloca instructions at the beginning of the function"
> 
> I would prefer we only have few, but significant tests such as "there is a call to __kmpc_dispatch_init_4u somewhere". Even searching for an instruction with a specific name is more meaningful than relying on the order.
Fixed.


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

https://reviews.llvm.org/D114940



More information about the llvm-commits mailing list