aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Constants.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-11-06 15:55:59 +0100
committerNikita Popov <npopov@redhat.com>2023-11-06 16:04:32 +0100
commit3a12f355ab418baff9fd48a541ab86128960d3cb (patch)
treea0698678737107b22f4292281d67fa74d521faf2 /llvm/lib/IR/Constants.cpp
parent12756831e4a96aed78e8724bb982e47444ff2ffc (diff)
downloadllvm-3a12f355ab418baff9fd48a541ab86128960d3cb.zip
llvm-3a12f355ab418baff9fd48a541ab86128960d3cb.tar.gz
llvm-3a12f355ab418baff9fd48a541ab86128960d3cb.tar.bz2
[IR] Mark FP casts constant exprs as undesirable
We will no longer generate these constant expressions by default, but they can still be explicitly created.
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r--llvm/lib/IR/Constants.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index cca4811..16072d2 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -2270,14 +2270,14 @@ bool ConstantExpr::isDesirableCastOp(unsigned Opcode) {
switch (Opcode) {
case Instruction::ZExt:
case Instruction::SExt:
- return false;
- case Instruction::Trunc:
case Instruction::FPTrunc:
case Instruction::FPExt:
case Instruction::UIToFP:
case Instruction::SIToFP:
case Instruction::FPToUI:
case Instruction::FPToSI:
+ return false;
+ case Instruction::Trunc:
case Instruction::PtrToInt:
case Instruction::IntToPtr:
case Instruction::BitCast: