[PATCH] D49467: Fix inconsistency with/without debug information (-g)

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 02:58:59 PDT 2018


jeroen.dobbelaere created this revision.
jeroen.dobbelaere added reviewers: hfinkel, probinson.
Herald added subscribers: llvm-commits, JDevlieghere, hiraditya, aprantl.

This fixes an inconsistency in code generation when compiling with or without debug information (-g).
When debug information is available in an empty block, the original test would fail, resulting in possibly different code.


Repository:
  rL LLVM

https://reviews.llvm.org/D49467

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp


Index: llvm/lib/CodeGen/CodeGenPrepare.cpp
===================================================================
--- llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -606,7 +606,7 @@
         isa<IndirectBrInst>(Pred->getTerminator())))
     return true;

-  if (BB->getTerminator() != BB->getFirstNonPHI())
+  if (BB->getTerminator() != BB->getFirstNonPHIOrDbg())
     return true;

   // We use a simple cost heuristic which determine skipping merging is


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49467.156032.patch
Type: text/x-patch
Size: 485 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180718/e7dddf33/attachment.bin>


More information about the llvm-commits mailing list