[llvm] 4f71252 - [TTI] Let getOperationCost assume that Freeze is free

Juneyoung Lee via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 09:56:19 PST 2020


Author: Juneyoung Lee
Date: 2020-02-27T02:56:11+09:00
New Revision: 4f71252cf8430e60837e0e030c3d40db4c79eb99

URL: https://github.com/llvm/llvm-project/commit/4f71252cf8430e60837e0e030c3d40db4c79eb99
DIFF: https://github.com/llvm/llvm-project/commit/4f71252cf8430e60837e0e030c3d40db4c79eb99.diff

LOG: [TTI] Let getOperationCost assume that Freeze is free

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index 09bd13aea26a..5c51d30384b7 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -62,6 +62,11 @@ class TargetTransformInfoImplBase {
       // Otherwise, the default basic cost is used.
       return TTI::TCC_Basic;
 
+    case Instruction::Freeze:
+      // Freeze operation is free because it should be lowered into a register
+      // use without any register copy in assembly code.
+      return TTI::TCC_Free;
+
     case Instruction::FDiv:
     case Instruction::FRem:
     case Instruction::SDiv:


        


More information about the llvm-commits mailing list