[PATCH] D11002: CodeGenPrepare: add disablebranchopts and addrsinkusinggeps as pass options

escha escha at apple.com
Tue Jul 7 11:21:17 PDT 2015



Okay, stripped out the rest of the patch so I can just get in the relevant change to branch optimizations.

As discussed on IRC, this option was added to our backend because we needed the CLI parameter (disabling branch opts) to disable all things that modify the CFG, which sounds pretty reasonable for something that disables branch opts. This is useful for writing CFG tests, e.g. for things like switch lowering, that need to ensure CGP doesn't mangle the CFG on the way there.

I'll make a separate revision for a TLI hook to disable address GEP splitting.


Repository:
  rL LLVM

http://reviews.llvm.org/D11002

Files:
  lib/CodeGen/CodeGenPrepare.cpp

Index: lib/CodeGen/CodeGenPrepare.cpp
===================================================================
--- lib/CodeGen/CodeGenPrepare.cpp
+++ lib/CodeGen/CodeGenPrepare.cpp
@@ -226,7 +237,8 @@
 
   // Eliminate blocks that contain only PHI nodes and an
   // unconditional branch.
-  EverMadeChange |= EliminateMostlyEmptyBlocks(F);
+  if (!DisableBranchOpts)
+    EverMadeChange |= EliminateMostlyEmptyBlocks(F);
 
   // llvm.dbg.value is far away from the value then iSel may not be able
   // handle it properly. iSel will drop llvm.dbg.value if it can not


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11002.29196.patch
Type: text/x-patch
Size: 563 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150707/749f53ba/attachment.bin>


More information about the llvm-commits mailing list