llvm / llvm/llvm-project

behavior of noinline with const prop optimization

Open
#207,000 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

llvm:optimizations question
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

I think there are currently two contradicting issues open for llvm regarding the behavior
of the noinline attribute when constant propagation is available.

  1. https://github.com/llvm/llvm-project/issues/60368
    Want's const prop of a no inline function to happen to avoid a tail call.

  2. https://github.com/llvm/llvm-project/issues/80032
    Doesn't want const prop to happen and complains that the value of value() is constant propagated back into main even though the function was annotated with noinline.

What is the desired behavior of this in llvm when paired with the noinline attribute ? Or maybe I'm missing something..

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading LLVM issues #60368 and #80032, then compare their expectations for constant propagation and the noinline attribute. Done means the project has a maintainer-backed decision that reconciles the two behaviors and is recorded on this issue or in the relevant LLVM documentation.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.