[PATCH] D110673: [clang] Don't modify OptRemark if the argument is not relevant

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 29 14:20:44 PDT 2021


aeubanks updated this revision to Diff 376034.
aeubanks added a comment.

forcing the legacy PM plus -round-trip-args repros the issue. added a new PM equivalent RUN line (that does fail without this patch)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110673/new/

https://reviews.llvm.org/D110673

Files:
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/Frontend/optimization-remark.c


Index: clang/test/Frontend/optimization-remark.c
===================================================================
--- clang/test/Frontend/optimization-remark.c
+++ clang/test/Frontend/optimization-remark.c
@@ -16,6 +16,7 @@
 // RUN: %clang_cc1 %s -Rpass=inline -Rno-pass -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-REMARKS
 // RUN: %clang_cc1 %s -Rpass=inline -Rno-everything -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-REMARKS
 // RUN: %clang_cc1 %s -Rpass=inline -fno-experimental-new-pass-manager -Rno-everything -Reverything -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
+// RUN: %clang_cc1 %s -Rpass -Rno-pass -round-trip-args -fexperimental-new-pass-manager -mllvm -mandatory-inlining-first=false -O1 -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-REMARKS
 //
 // The inliner for the new PM does not seem to be enabled at O0, but we still
 // get the same remarks with at least O1.
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -1201,6 +1201,8 @@
         Result.Kind = CodeGenOptions::RK_Disabled;
       else if (Value == "no-everything")
         Result.Kind = CodeGenOptions::RK_DisabledEverything;
+      else
+        continue;
 
       if (Result.Kind == CodeGenOptions::RK_Disabled ||
           Result.Kind == CodeGenOptions::RK_DisabledEverything) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110673.376034.patch
Type: text/x-patch
Size: 1499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210929/e198e47a/attachment-0001.bin>


More information about the cfe-commits mailing list