[PATCH] Branch folding causes different code generation at "-O2 -g" and "-O2"

Chandler Carruth chandlerc at gmail.com
Wed Mar 5 16:10:31 PST 2014


  Looks good. Generally fine to commit unless you find an existing test case that this should just be added to.


================
Comment at: test/CodeGen/X86/dbg-changes-codegen-branch-folding.ll:3
@@ +2,3 @@
+; RUN: opt -strip-debug < %s | llc -march=x86-64 | FileCheck %s
+; BZ #19051. Minor code-motion difference with -g.
+; Presence of debug info shouldn't affect the codegen. Make sure that
----------------
We typically use a link rather than "BZ": http://llvm.org/PR19051

Are there really no other tests for debug info changing codegen in the x86 tree?

================
Comment at: test/CodeGen/X86/dbg-changes-codegen-branch-folding.ll:14-16
@@ +13,5 @@
+
+; The following bitcode was generated with:
+;    clang -emit-llvm -S -O2 -g
+; from this source:
+
----------------
I don't think we need a full debug-info test case here.

Just put some stub debug_value calls into the test in the appropriate places with null metadata. It should still work just as well and won't require the full Clang-generated DWARF-structured debug info metadata.


http://llvm-reviews.chandlerc.com/D2970



More information about the llvm-commits mailing list