Skip to content

Commit 3a12f35

Browse files
committed
[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.
1 parent 1275683 commit 3a12f35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/IR/Constants.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,14 +2270,14 @@ bool ConstantExpr::isDesirableCastOp(unsigned Opcode) {
22702270
switch (Opcode) {
22712271
case Instruction::ZExt:
22722272
case Instruction::SExt:
2273-
return false;
2274-
case Instruction::Trunc:
22752273
case Instruction::FPTrunc:
22762274
case Instruction::FPExt:
22772275
case Instruction::UIToFP:
22782276
case Instruction::SIToFP:
22792277
case Instruction::FPToUI:
22802278
case Instruction::FPToSI:
2279+
return false;
2280+
case Instruction::Trunc:
22812281
case Instruction::PtrToInt:
22822282
case Instruction::IntToPtr:
22832283
case Instruction::BitCast:

0 commit comments

Comments
 (0)