Skip to content

Commit

Permalink
[IR] Mark FP casts constant exprs as undesirable
Browse files Browse the repository at this point in the history
We will no longer generate these constant expressions by default,
but they can still be explicitly created.
  • Loading branch information
nikic committed Nov 6, 2023
1 parent 1275683 commit 3a12f35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/IR/Constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3a12f35

Please sign in to comment.