Skip to content

Commit 79c00d3

Browse files
author
Yuanfang Chen
committed
[NPM] Make AddDiscriminators pass required
This is to make sure the pass is not skipped at O0 where optnone is applied to functions by default.
1 parent 6cdca90 commit 79c00d3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

llvm/include/llvm/Transforms/Utils/AddDiscriminators.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Function;
2424
class AddDiscriminatorsPass : public PassInfoMixin<AddDiscriminatorsPass> {
2525
public:
2626
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
27+
static bool isRequired() { return true; }
2728
};
2829

2930
} // end namespace llvm

llvm/test/Transforms/AddDiscriminators/basic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if.end: ; preds = %if.then, %entry
3636
; CHECK: ret void, !dbg ![[END:[0-9]+]]
3737
}
3838

39-
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" }
39+
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" }
4040

4141
!llvm.dbg.cu = !{!0}
4242
!llvm.module.flags = !{!7, !8}

0 commit comments

Comments
 (0)