Skip to content

Commit 4f71252

Browse files
committed
[TTI] Let getOperationCost assume that Freeze is free
1 parent 14aef53 commit 4f71252

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ class TargetTransformInfoImplBase {
6262
// Otherwise, the default basic cost is used.
6363
return TTI::TCC_Basic;
6464

65+
case Instruction::Freeze:
66+
// Freeze operation is free because it should be lowered into a register
67+
// use without any register copy in assembly code.
68+
return TTI::TCC_Free;
69+
6570
case Instruction::FDiv:
6671
case Instruction::FRem:
6772
case Instruction::SDiv:

0 commit comments

Comments
 (0)