Skip to content

FastISel: Do not check for module debug info #100353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented Jul 24, 2024

I don't see the point of this check and SelectionDAG
does not perform it. In the normal usecase, if there's
no debug info the debug intrinsics would not be there
in the first place.

Copy link
Contributor Author

arsenm commented Jul 24, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @arsenm and the rest of your teammates on Graphite Graphite

@llvmbot
Copy link
Member

llvmbot commented Jul 24, 2024

@llvm/pr-subscribers-llvm-selectiondag

@llvm/pr-subscribers-debuginfo

Author: Matt Arsenault (arsenm)

Changes

I don't see the point of this check and SelectionDAG
does not perform it. In the normal usecase, if there's
no debug info the debug intrinsics would not be there
in the first place.


Full diff: https://github.com/llvm/llvm-project/pull/100353.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/SelectionDAG/FastISel.cpp (-16)
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index ef9f783355190..e255bbaa92b16 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -1203,11 +1203,6 @@ void FastISel::handleDbgInfo(const Instruction *II) {
 
     if (DbgLabelRecord *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
       assert(DLR->getLabel() && "Missing label");
-      if (!FuncInfo.MF->getMMI().hasDebugInfo()) {
-        LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DLR << "\n");
-        continue;
-      }
-
       BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DLR->getDebugLoc(),
               TII.get(TargetOpcode::DBG_LABEL))
           .addMetadata(DLR->getLabel());
@@ -1402,12 +1397,6 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) {
   case Intrinsic::dbg_declare: {
     const DbgDeclareInst *DI = cast<DbgDeclareInst>(II);
     assert(DI->getVariable() && "Missing variable");
-    if (!FuncInfo.MF->getMMI().hasDebugInfo()) {
-      LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DI
-                        << " (!hasDebugInfo)\n");
-      return true;
-    }
-
     if (FuncInfo.PreprocessedDbgDeclares.contains(DI))
       return true;
 
@@ -1446,11 +1435,6 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) {
   case Intrinsic::dbg_label: {
     const DbgLabelInst *DI = cast<DbgLabelInst>(II);
     assert(DI->getLabel() && "Missing label");
-    if (!FuncInfo.MF->getMMI().hasDebugInfo()) {
-      LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DI << "\n");
-      return true;
-    }
-
     BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD,
             TII.get(TargetOpcode::DBG_LABEL)).addMetadata(DI->getLabel());
     return true;

Copy link
Collaborator

@pogo59 pogo59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable.

@arsenm arsenm force-pushed the users/arsenm/avoid-checking-mmi-hasdebuginfo branch from 6367409 to 47fbdca Compare July 24, 2024 15:39
@arsenm arsenm force-pushed the users/arsenm/fast-isel-no-check-hasdebuginfo-dbg-intrinsics branch from 1e3fdb2 to 4876d6d Compare July 24, 2024 15:39
@arsenm arsenm force-pushed the users/arsenm/avoid-checking-mmi-hasdebuginfo branch from 47fbdca to 0d0fe00 Compare July 24, 2024 18:30
@arsenm arsenm force-pushed the users/arsenm/fast-isel-no-check-hasdebuginfo-dbg-intrinsics branch from 4876d6d to 708970d Compare July 24, 2024 18:30
I don't see the point of this check and SelectionDAG
does not perform it. In the normal usecase, if there's
no debug info the debug intrinsics would not be there
in the first place.
@arsenm arsenm force-pushed the users/arsenm/fast-isel-no-check-hasdebuginfo-dbg-intrinsics branch from 708970d to 22af55f Compare July 26, 2024 06:00
@arsenm arsenm changed the base branch from users/arsenm/avoid-checking-mmi-hasdebuginfo to main July 26, 2024 06:00
@arsenm arsenm merged commit 63d088c into main Jul 26, 2024
9 of 12 checks passed
@arsenm arsenm deleted the users/arsenm/fast-isel-no-check-hasdebuginfo-dbg-intrinsics branch July 26, 2024 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants