[Openmp-commits] [PATCH] D64217: [OpenMP][NFCI] Cleanup the target state queue implementation
Alexey Bataev via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Mon Jul 22 15:18:01 PDT 2019
ABataev added a comment.
In D64217#1596480 <https://reviews.llvm.org/D64217#1596480>, @jdoerfert wrote:
> In D64217#1591812 <https://reviews.llvm.org/D64217#1591812>, @ABataev wrote:
> > > If they are uninitialized in LLVM-IR, it doesn't matter what happens at the PTX level and lower, LLVM could simply get rid of the accesses.
> > They are initialized in LLVM IR, by zeroinitializer, they are not initialized in PTX file explicitly. But it is ok for PTX since, according to the documents, the memory implicitly initialized by zeros.
> > > Why do you fight so hard against zero-cost initialization that *might be* needed for correctness?
> > I'm not fighting against `zero-cost` initialization. Just it is not possible to implement `zero-cost` initialization.
> There are only two possibilities:
> 1. It is zero initialized, which you claim but which I failed to validate so far.
> 2. It is not zero initialized.
> In case 1, initializing with zero is free as it is already happening. We cannot have two zero initializers after all. In case 2, initializing with zero is *necessary* as it can otherwise be transformed by LLVM in a way that would break the behavior we need.
Short answer - it is zero initialized.
In LLVM IR form it is emitted with zeroinitializer. When this LLVM IR is compiled to ptx, this zeroinitializer is dropped. But it is ok, since, according to PTX format, the global variables are zeroinitialized by default, if they don't have intializers.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the Openmp-commits