Skip to content

[CIR] Add Pure trait to IsFPClassOp#186625

Open
xlauko wants to merge 1 commit intomainfrom
users/xlauko/cir-pure-traits
Open

[CIR] Add Pure trait to IsFPClassOp#186625
xlauko wants to merge 1 commit intomainfrom
users/xlauko/cir-pure-traits

Conversation

@xlauko
Copy link
Contributor

@xlauko xlauko commented Mar 14, 2026

IsFPClassOp is a pure classification check on a floating-point value
with no memory effects.

IsFPClassOp is a pure classification check on a floating-point value
with no memory effects. Mark it Pure to enable DCE and other
optimizations.
Copy link
Contributor Author

xlauko commented Mar 14, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@xlauko xlauko marked this pull request as ready for review March 14, 2026 21:46
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Mar 14, 2026
@llvmbot
Copy link
Member

llvmbot commented Mar 14, 2026

@llvm/pr-subscribers-clangir

Author: Henrich Lauko (xlauko)

Changes

IsFPClassOp is a pure classification check on a floating-point value
with no memory effects.


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

1 Files Affected:

  • (modified) clang/include/clang/CIR/Dialect/IR/CIROps.td (+1-1)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index d9c4356ba95b9..9b04d4aa4773f 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -5624,7 +5624,7 @@ def FPClassTestEnum : CIR_I32EnumAttr<"FPClassTest", "floating-point class test
   let cppNamespace = "::cir";
 }
 
-def CIR_IsFPClassOp : CIR_Op<"is_fp_class"> {
+def CIR_IsFPClassOp : CIR_Op<"is_fp_class", [Pure]> {
   let summary = "Corresponding to the `__builtin_fpclassify` builtin function in clang";
 
   let description = [{

@llvmbot
Copy link
Member

llvmbot commented Mar 14, 2026

@llvm/pr-subscribers-clang

Author: Henrich Lauko (xlauko)

Changes

IsFPClassOp is a pure classification check on a floating-point value
with no memory effects.


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

1 Files Affected:

  • (modified) clang/include/clang/CIR/Dialect/IR/CIROps.td (+1-1)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index d9c4356ba95b9..9b04d4aa4773f 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -5624,7 +5624,7 @@ def FPClassTestEnum : CIR_I32EnumAttr<"FPClassTest", "floating-point class test
   let cppNamespace = "::cir";
 }
 
-def CIR_IsFPClassOp : CIR_Op<"is_fp_class"> {
+def CIR_IsFPClassOp : CIR_Op<"is_fp_class", [Pure]> {
   let summary = "Corresponding to the `__builtin_fpclassify` builtin function in clang";
 
   let description = [{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants