Skip to content

Conversation

@cperkinsintel
Copy link
Contributor

Encountered when testing building intel/llvm with clang libc++.
Signed-off-by: Chris Perkins chris.perkins@intel.com

Signed-off-by: Chris Perkins <chris.perkins@intel.com>
@bader
Copy link
Contributor

bader commented Mar 18, 2021

Duplicate of already merged #3358.

@bader bader closed this Mar 18, 2021
@cperkinsintel cperkinsintel deleted the cperkins-minor-pragma-fix branch March 24, 2021 16:25
iclsrc pushed a commit that referenced this pull request Oct 15, 2025
With new lifetime.start/end rules, which are:
"The argument is either a pointer to an alloca instruction or a poison
    value."
it became obsolete on main branch. Note, no test is possible to add
on the main branch.

Moreover, it seem to be redundant overall, as IR like this was legal:
      %0 = alloca ...
      %1 = bitcast %0
      call void @llvm.lifetime.start(..., %1)
      %2 = bitcast %0
      call void @llvm.lifetime.end(..., %2)

Further implecations, and why this patch will be backported on older
branches. Right now there is a possibility to have a round-trip
translation failed, when it goes from main to pre-opaque pointers
branches as a bitcast from alloca to i8* will be inserted before
lifetime.start call. Later, due to the current logic, this bitcast will
be reused for lifetime.end call. But, lifetime.end won't always
post-dominate
lifetime.start (in this case the object will be considered dead at
function return block), hence the bitcast won't dominate the
lifetime.stop call, invalidating the generated module.

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>

---------

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@8ff535506896489
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants