[PATCH] D45878: [DEBUG INFO] Fixing cases where debug info (-g) causes changes in the program.
Geoff Berry via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 26 07:57:37 PDT 2018
gberry added a comment.
I've been looking into this issue for AArch64 recently as well (see bug 37240 <https://bugs.llvm.org/show_bug.cgi?id=37240> for a PostRA scheduler issue I found). I'll be filing more bugs and/or posting fixes for other cases that we hit on our target with our different compiler flags in the next few days.
As far as testing, I think it would be better to have bots set up that do with/without -g compile and objdump diff. Writing lit tests that check for the specific bugs fixed is probably a good idea too, but those seem much less useful since the likelihood of the same bug turning up again is relatively low?
================
Comment at: lib/Target/SystemZ/SystemZElimCompare.cpp:192
+/// matching DBG_VALUEs.
+static void collectDebugValues(MachineInstr &MI,
+ SmallVectorImpl<MachineInstr *> &DbgValues) {
----------------
jonpa wrote:
> aprantl wrote:
> > This looks like the same function as above. Factor it out into a general utility?
> Yes, as I wrote in the description, this is my plan. Please help me with where you think that function should be placed.
Presumably in the MachineInstruction and MachineBlock classes, respectively?
================
Comment at: lib/Transforms/IPO/FunctionAttrs.cpp:1276
+ for (Instruction &I : instructions(*F)) {
+ if (isa<DbgValueInst>(I))
+ continue;
----------------
Perhaps this would be better handled by marking the debug intrinsics as 'norecurse'?
https://reviews.llvm.org/D45878
More information about the llvm-commits
mailing list