Skip to content

Edit Semantics Description of @llvm.is.constant.* #77519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

NCGThompson
Copy link
Contributor

Fixes #77517

I edited it from browser and didn't run any checks due to the triviality of the change.

Removed a sentence from the functions description because it was neither true or helpful.
Copy link

github-actions bot commented Jan 9, 2024

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the llvm:ir label Jan 9, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2024

@llvm/pr-subscribers-llvm-ir

Author: Nic (NCGThompson)

Changes

Fixes #77517

I edited it from browser and didn't run any checks due to the triviality of the change.


Full diff: https://github.com/llvm/llvm-project/pull/77519.diff

1 Files Affected:

  • (modified) llvm/docs/LangRef.rst (-3)
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index c90b6becae5254..a16899205b22e5 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -27220,9 +27220,6 @@ obviously not constant. However, a call like
 function is inlined, if the value passed to the function parameter was
 a constant.
 
-On the other hand, if constant folding is not run, it will never
-evaluate to true, even in simple cases.
-
 .. _int_ptrmask:
 
 '``llvm.ptrmask``' Intrinsic

Copy link
Member

@jyknight jyknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may have been true at one point, but hasn't been for some time.

@jyknight jyknight merged commit cd101ab into llvm:main Jan 9, 2024
@NCGThompson NCGThompson deleted the is-constant-doc branch January 9, 2024 22:14
justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this pull request Jan 28, 2024
@jsonn
Copy link
Contributor

jsonn commented Feb 28, 2024

The Lower-Constant-Intrinsic pass will remove all instructions that haven't been folded otherwise. It folds to true for material constants and false otherwise. As such, the statement is false for all normal optimization pipelines.

@NCGThompson
Copy link
Contributor Author

The Lower-Constant-Intrinsic pass will remove all instructions that haven't been folded otherwise. It folds to true for material constants and false otherwise. As such, the statement is false for all normal optimization pipelines.

There is an exception with alwaysinline if @llvm.is.constant is called directly on a function's input. @llvm.is.constant while be optimized to true, but the true won't be propagated further with -O0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IR Language Reference for is.constant.* is potentially unclear
4 participants