[clang] b76eb1d - [clang][CodeGen] Remove SimplifyCFGPass preceding RemoveTrapsPass (#84852)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 4 17:47:19 PDT 2024


Author: Vitaly Buka
Date: 2024-04-04T17:47:16-07:00
New Revision: b76eb1ddfbacda273b8e6a9940f1da6812fdc2e0

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

LOG: [clang][CodeGen] Remove SimplifyCFGPass preceding RemoveTrapsPass (#84852)

There is no performance difference after switching to
`llvm.experimental.hot`.

Added: 
    

Modified: 
    clang/lib/CodeGen/BackendUtil.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index e25a17658a3487..ee4bd80e1a7640 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -84,7 +84,6 @@
 #include "llvm/Transforms/Scalar/EarlyCSE.h"
 #include "llvm/Transforms/Scalar/GVN.h"
 #include "llvm/Transforms/Scalar/JumpThreading.h"
-#include "llvm/Transforms/Scalar/SimplifyCFG.h"
 #include "llvm/Transforms/Utils/Debugify.h"
 #include "llvm/Transforms/Utils/EntryExitInstrumenter.h"
 #include "llvm/Transforms/Utils/ModuleUtils.h"
@@ -753,11 +752,6 @@ static void addSanitizers(const Triple &TargetTriple,
     // from `buildInlinerPipeline`, which called after profile matching.
     PB.registerScalarOptimizerLateEPCallback(
         [](FunctionPassManager &FPM, OptimizationLevel Level) {
-          // RemoveTrapsPass expects trap blocks preceded by conditional
-          // branches, which usually is not the case without SimplifyCFG.
-          // TODO: Remove `SimplifyCFGPass` after switching to dedicated
-          // intrinsic.
-          FPM.addPass(SimplifyCFGPass());
           FPM.addPass(RemoveTrapsPass());
         });
   }


        


More information about the cfe-commits mailing list