From df3478e480b3b2e9fe125697b7931dc48b09e450 Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 18 Oct 2023 16:32:06 +0100 Subject: [LLVM] Add new attribute `optdebug` to optimize for debugging (#66632) This patch adds a new fn attribute, `optdebug`, that specifies that optimizations should make decisions that prioritize debug info quality, potentially at the cost of runtime performance. This patch does not add any functional changes triggered by this attribute, only the attribute itself. A subsequent patch will use this flag to disable the post-RA scheduler. --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index e991d05..c427459 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -747,6 +747,8 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) { return bitc::ATTR_KIND_NO_SANITIZE_COVERAGE; case Attribute::NullPointerIsValid: return bitc::ATTR_KIND_NULL_POINTER_IS_VALID; + case Attribute::OptimizeForDebugging: + return bitc::ATTR_KIND_OPTIMIZE_FOR_DEBUGGING; case Attribute::OptForFuzzing: return bitc::ATTR_KIND_OPT_FOR_FUZZING; case Attribute::OptimizeForSize: -- cgit v1.1