[llvm] 035eb39 - Update TTI's getUserCost to return TCC_Free on freeze

Juneyoung Lee via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 20:57:04 PST 2020


Author: Juneyoung Lee
Date: 2020-02-04T13:56:53+09:00
New Revision: 035eb393f7d6efad66831b42efa2ac8a070fedf3

URL: https://github.com/llvm/llvm-project/commit/035eb393f7d6efad66831b42efa2ac8a070fedf3
DIFF: https://github.com/llvm/llvm-project/commit/035eb393f7d6efad66831b42efa2ac8a070fedf3.diff

LOG: Update TTI's getUserCost to return TCC_Free on freeze

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 eb35f4570347..09bd13aea26a 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -867,6 +867,9 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
     if (isa<ExtractValueInst>(U))
       return TTI::TCC_Free; // Model all ExtractValue nodes as free.
 
+    if (isa<FreezeInst>(U))
+      return TTI::TCC_Free; // Model all Freeze nodes as free.
+
     // Static alloca doesn't generate target instructions.
     if (auto *A = dyn_cast<AllocaInst>(U))
       if (A->isStaticAlloca())


        


More information about the llvm-commits mailing list