[llvm] 4f40dfc - [IR] Remove the possibility of ConstantExpr having fast-math flags. (#94507)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 5 11:52:01 PDT 2024
Author: Joshua Cranmer
Date: 2024-06-05T14:51:57-04:00
New Revision: 4f40dfc2fdb6109702a4fcddff15d352eb216403
URL: https://github.com/llvm/llvm-project/commit/4f40dfc2fdb6109702a4fcddff15d352eb216403
DIFF: https://github.com/llvm/llvm-project/commit/4f40dfc2fdb6109702a4fcddff15d352eb216403.diff
LOG: [IR] Remove the possibility of ConstantExpr having fast-math flags. (#94507)
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. However, at no point did the IR
representation allow for expressing fast-math flags on constant
expressions.
With the change of https://github.com/llvm/llvm-project/pull/93038,
there are no longer any constant expressions capable of being FP math
operators, and thus FPMathOperator can go back to being
Instruction-only.
Added:
Modified:
llvm/include/llvm/IR/Operator.h
Removed:
################################################################################
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;
More information about the llvm-commits
mailing list