[llvm] [IR] Remove the possibility of ConstantExpr having fast-math flags. (PR #94507)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 10:30:54 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-ir

Author: Joshua Cranmer (jcranmer-intel)

<details>
<summary>Changes</summary>

This possibility was added in https://reviews.llvm.org/D34303 to resolve some assertion failures with cases where FP math operations got constant-folded in constant expressions. With the change of https://github.com/llvm/llvm-project/pull/93038, however, there are no longer any constant expressions capable of being FP math operators, and thus FPMathOperator can go back to being Instruction-only.

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


1 Files Affected:

- (modified) llvm/include/llvm/IR/Operator.h (-2) 


``````````diff
diff --git a/llvm/include/llvm/IR/Operator.h b/llvm/include/llvm/IR/Operator.h
index fda26891acfa7..f63f54ef94107 100644
--- a/llvm/include/llvm/IR/Operator.h
+++ b/llvm/include/llvm/IR/Operator.h
@@ -330,8 +330,6 @@ class FPMathOperator : public Operator {
     unsigned Opcode;
     if (auto *I = dyn_cast<Instruction>(V))
       Opcode = I->getOpcode();
-    else if (auto *CE = dyn_cast<ConstantExpr>(V))
-      Opcode = CE->getOpcode();
     else
       return false;
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/94507


More information about the llvm-commits mailing list