[PATCH] D26437: Use -fno-unit-at-a-time and -funit-at-a-time

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 09:33:18 PST 2016


jlebar added a comment.

> Thank you. The issue appeared while building opencl library

First, can you provide a testcase that demonstrates the problem?

Second, I am pretty sure this is not the change that you want to make to solve your problem, see below.

> This pass has removeConvergentAttrs function which removes unused convergent attribute from functions.

clang adds the "convergent" attribute to every function it emits.  llvm then removes this attribute from functions that do not contain convergent instructions or call convergent functions.

This should be a safe optimization to perform when building a library.  It should not remove the attribute from functions because they are unused.

It's entirely possible there's a bug in the pass, though; I can have a look if you can provide a testcase.  Another possibility is that your barrier function, which presumably calls some llvm intrinsic, is getting "convergent" removed because the llvm intrinsic is not marked as convergent.  That would be working as intended for the pass -- the solution there would be to properly annotate the intrinsic.


Repository:
  rL LLVM

https://reviews.llvm.org/D26437





More information about the llvm-commits mailing list