Skip to content

Commit

Permalink
[NPM] Make AddDiscriminators pass required
Browse files Browse the repository at this point in the history
This is to make sure the pass is not skipped at O0 where optnone is
applied to functions by default.
  • Loading branch information
Yuanfang Chen committed Sep 8, 2021
1 parent 6cdca90 commit 79c00d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions llvm/include/llvm/Transforms/Utils/AddDiscriminators.h
Expand Up @@ -24,6 +24,7 @@ class Function;
class AddDiscriminatorsPass : public PassInfoMixin<AddDiscriminatorsPass> {
public:
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
static bool isRequired() { return true; }
};

} // end namespace llvm
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/AddDiscriminators/basic.ll
Expand Up @@ -36,7 +36,7 @@ if.end: ; preds = %if.then, %entry
; CHECK: ret void, !dbg ![[END:[0-9]+]]
}

attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #0 = { nounwind uwtable noinline optnone "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!7, !8}
Expand Down

0 comments on commit 79c00d3

Please sign in to comment.