[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2021-01-08 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment.

In D86841#2484705 , @atmnpatel wrote:

> I'm happy to add a patch amending this, the reason it wasn't done that way 
> was because at the time and even now, out of icc/clang/msvc/gcc, gcc seems to 
> be the only one that happily removed such loops in C++ 
> (https://godbolt.org/z/W9vj99), and I didn't have a particularly strong 
> opinion on which way we should lean at the time.

I think ideally we would make this decision on what the standard allows. AFAICT 
the C++ spec for iteration statements (http://eel.is/c++draft/stmt.iter) does 
not have the same escape hatch as C. So IMO the current behavior is surprising 
and potentially leads to confusion for users (e.g. wondering why are some loops 
removed, but others not, even if the C++ spec allows for both to be removed).

There may be practical reasons for opting to be more conservative (e.g. if it 
would break a large number of user codes), but so far there seems to be no such 
indication in the discussion. It would probably be good to also implement 
`-ffinite-loops` as suggested by @xbolva00 so users can better control this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2021-01-07 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel added a comment.

I'm happy to add a patch amending this, the reason it wasn't done that way was 
because at the time and even now, out of icc/clang/msvc/gcc, gcc seems to be 
the only one that happily removed such loops in C++ 
(https://godbolt.org/z/W9vj99), and I didn't have a particularly strong opinion 
on which way we should lean at the time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2021-01-07 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added subscribers: xbolva00, fhahn.
fhahn added inline comments.



Comment at: clang/lib/CodeGen/CGStmt.cpp:799
   EmitBoolCondBranch = false;
+  FnIsMustProgress = false;
+}

Shouldn't this only apply for C? http://eel.is/c++draft/intro.progress#1 does 
not seem to have this escape hatch?

See the example by @xbolva00 for which we fail to eliminate the loops from a 
C++ source https://godbolt.org/z/jW7son


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-11-04 Thread Atmn Patel via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGac73b73c1652: [clang] Add mustprogress and 
llvm.loop.mustprogress attribute deduction (authored by atmnpatel).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/attr-likelihood-iteration-stmt.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-11-03 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 302606.
atmnpatel added a comment.

Hopefully the unrelated hwasan test failure is now fixed on master, trying 
again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/attr-likelihood-iteration-stmt.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-11-02 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 302461.
atmnpatel added a comment.

try 2.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/attr-likelihood-iteration-stmt.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-11-02 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 302459.
atmnpatel added a comment.

ignore, testing pre-build bots again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-11-02 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 302458.
atmnpatel added a comment.

Rebase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/attr-likelihood-iteration-stmt.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-11-02 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

LGTM, some nits




Comment at: clang/lib/CodeGen/CGStmt.cpp:801
+  } else if (LanguageRequiresProgress())
+LoopMustProgress = true;
+

Nit: Add braces here.



Comment at: clang/lib/CodeGen/CGStmt.cpp:894
+  } else if (LanguageRequiresProgress())
+LoopMustProgress = true;
+

Same as above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-11-02 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 302407.
atmnpatel added a comment.

- Added triple to fix mangling errors in test
- Modified (unrelated) recently added test to have the mustprogress attribute


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/attr-likelihood-iteration-stmt.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-10-21 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel added a comment.

ping. @jyknight @aaron.ballman @rjmccall any more thoughts?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-10-21 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 299823.
atmnpatel added a comment.

rebase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-10-08 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 297070.
atmnpatel added a comment.

Fixes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-10-07 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 296752.
atmnpatel added a comment.

Bump for bot.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-10-07 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 296747.
atmnpatel added a comment.

Fixes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-10-05 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a subscriber: jyknight.
jdoerfert added a comment.

One minor nit from me.

@jyknight @aaron.ballman @rjmccall any more thoughts?




Comment at: clang/lib/CodeGen/CGStmt.cpp:801
+ getLangOpts().CPlusPlus11 || getLangOpts().CPlusPlus14 ||
+ getLangOpts().CPlusPlus17 || getLangOpts().C2x) {
+LoopMustProgress = true;

atmnpatel wrote:
> aqjune wrote:
> > A silly question: does old C/C++ not guarantee that loops should make 
> > forward progress?
> Nope, it was introduced explicitly simultaneously in C11 (6.8.5p6) and C++11 
> has it implicitly through [intro.progress].
Move this condition into a helper function somewhere with documentation. If we 
use another (similar) condition the same. This has to be updated over time and 
that way makes it much easier (also to read).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-30 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel added inline comments.



Comment at: clang/lib/CodeGen/CGStmt.cpp:801
+ getLangOpts().CPlusPlus11 || getLangOpts().CPlusPlus14 ||
+ getLangOpts().CPlusPlus17 || getLangOpts().C2x) {
+LoopMustProgress = true;

aqjune wrote:
> A silly question: does old C/C++ not guarantee that loops should make forward 
> progress?
Nope, it was introduced explicitly simultaneously in C11 (6.8.5p6) and C++11 
has it implicitly through [intro.progress].


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-30 Thread Juneyoung Lee via Phabricator via cfe-commits
aqjune added inline comments.



Comment at: clang/lib/CodeGen/CGStmt.cpp:801
+ getLangOpts().CPlusPlus11 || getLangOpts().CPlusPlus14 ||
+ getLangOpts().CPlusPlus17 || getLangOpts().C2x) {
+LoopMustProgress = true;

A silly question: does old C/C++ not guarantee that loops should make forward 
progress?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-29 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 295149.
atmnpatel added a comment.

Fixing buildkite build.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-29 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel marked 3 inline comments as done.
atmnpatel added inline comments.



Comment at: clang/lib/CodeGen/CGStmt.cpp:801
+ getLangOpts().CPlusPlus11 || getLangOpts().CPlusPlus14 ||
+ getLangOpts().CPlusPlus17 || getLangOpts().C2x) {
+MustProgress = true;

jdoerfert wrote:
> Also in C? And C2x in the end is probably CPLusPlus2x?
> Also in C?
Not quite sure what you mean here.

But LangOptions.def seems to say that C2x is the upcoming C standard, not any 
upcoming C++ standard.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-29 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 295119.
atmnpatel added a comment.

NFC fixes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-29 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments.



Comment at: clang/lib/CodeGen/CGStmt.cpp:801
+ getLangOpts().CPlusPlus11 || getLangOpts().CPlusPlus14 ||
+ getLangOpts().CPlusPlus17 || getLangOpts().C2x) {
+MustProgress = true;

Also in C? And C2x in the end is probably CPLusPlus2x?



Comment at: clang/lib/CodeGen/CGStmt.cpp:894
+else if (C->isOne())
+  IsMustProgress = false;
+  } else if (getLangOpts().C11 || getLangOpts().C17 || getLangOpts().C2x ||

Maybe call this FnIsMustProgress or the other one LoopMustProgress.



Comment at: clang/lib/CodeGen/CGStmt.cpp:898
+ getLangOpts().CPlusPlus17 || getLangOpts().C2x)
+MustProgress = true;
+

same as above



Comment at: clang/lib/CodeGen/CGStmt.cpp:946
+   getLangOpts().CPlusPlus17 || getLangOpts().C2x) &&
+  (!S.getCond() || !S.getCond()->EvaluateAsInt(Result, getContext(
+MustProgress = true;

same as above.

Don't we have to update IsMustProgress here too?




Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:1165
+IsMustProgress = true;
+  }
+

no braces. why the mustprogress check?



Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:1172
+
+  if (IsMustProgress)
+CurFn->addFnAttr(llvm::Attribute::MustProgress);

Say that we do this late because we need to see the body.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-28 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 294864.
atmnpatel added a comment.

more fixes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGen/pragma-do-while.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/debug-info-line-if.cpp
  clang/test/CodeGenCXX/debug-info-loops.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/pragma-followup_inner.cpp
  clang/test/CodeGenCXX/pragma-followup_outer.cpp
  clang/test/CodeGenCXX/pragma-loop-distribute.cpp
  clang/test/CodeGenCXX/pragma-loop-pr27643.cpp
  clang/test/CodeGenCXX/pragma-loop-predicate.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-imperfectly_nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-nested.cpp
  clang/test/CodeGenCXX/pragma-loop-safety-outer.cpp
  clang/test/CodeGenCXX/pragma-loop-safety.cpp
  clang/test/CodeGenCXX/pragma-loop.cpp
  clang/test/CodeGenCXX/pragma-pipeline.cpp
  clang/test/CodeGenCXX/pragma-unroll-and-jam.cpp
  clang/test/CodeGenCXX/pragma-unroll.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-28 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added inline comments.



Comment at: clang/test/CodeGen/attr-mustprogress-1.cpp:24
+  }
+}
+

Now here, and below with `while(1)` I would *not* expect `mustprogress`.



Comment at: clang/test/CodeGen/attr-mustprogress-1.cpp:185
+  do {
+  } while (a == b);
+}

Here I would not expect the function attr but the metadata on the second loop. 
I guess we might want to add the metadata always for loops w/o a constant 
condition especially because the order of the two loops might be swapped 
(please add a test).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-28 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 294794.
atmnpatel added a comment.

attempt 3


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
@@ -44,7 +44,7 @@
 // CHECK-NEXT:[[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
 // CHECK-NEXT:store %class.Foo* [[THIS:%.*]], %class.Foo** [[THIS_ADDR]], align 8
 // CHECK-NEXT:[[THIS1:%.*]] = load %class.Foo*, %class.Foo** [[THIS_ADDR]], align 8
-// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR2:#.*]]
+// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR3:#.*]]
 // CHECK-NEXT:ret void
 //
 Foo::~Foo() {}
@@ -70,7 +70,7 @@
 // CHECK-NEXT:call void @_ZN3FooC1Ei(%class.Foo* [[F]], 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-28 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 294773.
atmnpatel added a comment.

rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
  
clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.no-generated.expected
@@ -41,7 +41,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -86,7 +86,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/generated-funcs.c.generated.expected
@@ -197,7 +197,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP2:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:call void @foo()
 // NOOMP-NEXT:ret i32 0
@@ -223,7 +223,7 @@
 // NOOMP-NEXT:[[TMP2:%.*]] = load i32, i32* [[I]], align 4
 // NOOMP-NEXT:[[INC:%.*]] = add nsw i32 [[TMP2]], 1
 // NOOMP-NEXT:store i32 [[INC]], i32* [[I]], align 4
-// NOOMP-NEXT:br label [[FOR_COND]]
+// NOOMP-NEXT:br label [[FOR_COND]], [[LOOP4:!llvm.loop !.*]]
 // NOOMP:   for.end:
 // NOOMP-NEXT:ret void
 //
Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
@@ -44,7 +44,7 @@
 // CHECK-NEXT:[[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
 // CHECK-NEXT:store %class.Foo* [[THIS:%.*]], %class.Foo** [[THIS_ADDR]], align 8
 // CHECK-NEXT:[[THIS1:%.*]] = load %class.Foo*, %class.Foo** [[THIS_ADDR]], align 8
-// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR2:#.*]]
+// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR3:#.*]]
 // CHECK-NEXT:ret void
 //
 Foo::~Foo() {}
@@ -70,7 +70,7 @@
 // CHECK-NEXT:call void @_ZN3FooC1Ei(%class.Foo* [[F]], 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-27 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 294575.
atmnpatel added a comment.

rebase to hopefully fix buildbot


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
@@ -44,7 +44,7 @@
 // CHECK-NEXT:[[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
 // CHECK-NEXT:store %class.Foo* [[THIS:%.*]], %class.Foo** [[THIS_ADDR]], align 8
 // CHECK-NEXT:[[THIS1:%.*]] = load %class.Foo*, %class.Foo** [[THIS_ADDR]], align 8
-// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR2:#.*]]
+// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR3:#.*]]
 // CHECK-NEXT:ret void
 //
 Foo::~Foo() {}
@@ -70,7 +70,7 @@
 // CHECK-NEXT:call void @_ZN3FooC1Ei(%class.Foo* [[F]], i32 1)
 // CHECK-NEXT:[[CALL:%.*]] = call i32 @_ZNK3Foo23function_defined_inlineEi(%class.Foo* [[F]], i32 2)
 // CHECK-NEXT:[[CALL1:%.*]] = call i32 @_ZNK3Foo28function_defined_out_of_lineEi(%class.Foo* [[F]], i32 3)
-// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR2]]
+// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR3]]
 // CHECK-NEXT:ret i32 0
 //
 int main() {
Index: clang/test/Profile/c-unprofiled-blocks.c
===
--- clang/test/Profile/c-unprofiled-blocks.c
+++ clang/test/Profile/c-unprofiled-blocks.c
@@ -16,7 +16,7 @@
   // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
   while (--i) {}
 
-  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP1:!.*]]
   do {} while (i++ < 75);
 
   // PGOUSE: switch {{.*}} [
@@ -46,7 +46,7 @@
 // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
 while (--i) {}
 
-// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP2:!.*]]
 do {} while (i++ < 75);
 
 // PGOUSE: switch {{.*}} [
Index: clang/test/OpenMP/simd_metadata.c
===
--- clang/test/OpenMP/simd_metadata.c
+++ clang/test/OpenMP/simd_metadata.c
@@ -110,7 +110,8 @@
 }
 // CHECK: store float {{.+}}, float* {{.+}}, align {{.+}}, !llvm.access.group ![[ACCESS_GROUP_13:[0-9]+]]
   }
-// CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER_INNER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
 }
 
 // Metadata for h1:
Index: clang/test/CodeGenCXX/thunks.cpp
===
--- clang/test/CodeGenCXX/thunks.cpp
+++ clang/test/CodeGenCXX/thunks.cpp
@@ -529,7 +529,7 @@
 // CHECK-NONOPT-LABEL: define linkonce_odr void @_ZThn8_N6Test101C3fooEv
 
 // Checking with opt
-// CHECK-OPT-LABEL: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(%"struct.Test4B::(anonymous namespace)::C"* %this) unnamed_addr #0 align 2
+// CHECK-OPT-LABEL: define 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-27 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 294570.
atmnpatel added a comment.

All language standards (minus gnu extensions) are now tested.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
@@ -44,7 +44,7 @@
 // CHECK-NEXT:[[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
 // CHECK-NEXT:store %class.Foo* [[THIS:%.*]], %class.Foo** [[THIS_ADDR]], align 8
 // CHECK-NEXT:[[THIS1:%.*]] = load %class.Foo*, %class.Foo** [[THIS_ADDR]], align 8
-// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR2:#.*]]
+// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR3:#.*]]
 // CHECK-NEXT:ret void
 //
 Foo::~Foo() {}
@@ -70,7 +70,7 @@
 // CHECK-NEXT:call void @_ZN3FooC1Ei(%class.Foo* [[F]], i32 1)
 // CHECK-NEXT:[[CALL:%.*]] = call i32 @_ZNK3Foo23function_defined_inlineEi(%class.Foo* [[F]], i32 2)
 // CHECK-NEXT:[[CALL1:%.*]] = call i32 @_ZNK3Foo28function_defined_out_of_lineEi(%class.Foo* [[F]], i32 3)
-// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR2]]
+// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR3]]
 // CHECK-NEXT:ret i32 0
 //
 int main() {
Index: clang/test/Profile/c-unprofiled-blocks.c
===
--- clang/test/Profile/c-unprofiled-blocks.c
+++ clang/test/Profile/c-unprofiled-blocks.c
@@ -16,7 +16,7 @@
   // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
   while (--i) {}
 
-  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP1:!.*]]
   do {} while (i++ < 75);
 
   // PGOUSE: switch {{.*}} [
@@ -46,7 +46,7 @@
 // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
 while (--i) {}
 
-// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP2:!.*]]
 do {} while (i++ < 75);
 
 // PGOUSE: switch {{.*}} [
Index: clang/test/OpenMP/simd_metadata.c
===
--- clang/test/OpenMP/simd_metadata.c
+++ clang/test/OpenMP/simd_metadata.c
@@ -110,7 +110,8 @@
 }
 // CHECK: store float {{.+}}, float* {{.+}}, align {{.+}}, !llvm.access.group ![[ACCESS_GROUP_13:[0-9]+]]
   }
-// CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER_INNER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
 }
 
 // Metadata for h1:
Index: clang/test/CodeGenCXX/thunks.cpp
===
--- clang/test/CodeGenCXX/thunks.cpp
+++ clang/test/CodeGenCXX/thunks.cpp
@@ -529,7 +529,7 @@
 // CHECK-NONOPT-LABEL: define linkonce_odr void @_ZThn8_N6Test101C3fooEv
 
 // Checking with opt
-// CHECK-OPT-LABEL: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(%"struct.Test4B::(anonymous namespace)::C"* %this) unnamed_addr #0 align 2

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-27 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel added inline comments.



Comment at: clang/test/CodeGen/attr-mustprogress-0.cpp:2
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 
UTC_ARGS: --check-attributes
+// RUN: %clang_cc1 -S -emit-llvm %s -o - | FileCheck %s
+

changing this asap.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-27 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 294569.
atmnpatel added a comment.

Split them into pre and post forward progress requirement tests, now the 
difference is much easier to catch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress-0.c
  clang/test/CodeGen/attr-mustprogress-0.cpp
  clang/test/CodeGen/attr-mustprogress-1.c
  clang/test/CodeGen/attr-mustprogress-1.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
@@ -44,7 +44,7 @@
 // CHECK-NEXT:[[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
 // CHECK-NEXT:store %class.Foo* [[THIS:%.*]], %class.Foo** [[THIS_ADDR]], align 8
 // CHECK-NEXT:[[THIS1:%.*]] = load %class.Foo*, %class.Foo** [[THIS_ADDR]], align 8
-// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR2:#.*]]
+// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR3:#.*]]
 // CHECK-NEXT:ret void
 //
 Foo::~Foo() {}
@@ -70,7 +70,7 @@
 // CHECK-NEXT:call void @_ZN3FooC1Ei(%class.Foo* [[F]], i32 1)
 // CHECK-NEXT:[[CALL:%.*]] = call i32 @_ZNK3Foo23function_defined_inlineEi(%class.Foo* [[F]], i32 2)
 // CHECK-NEXT:[[CALL1:%.*]] = call i32 @_ZNK3Foo28function_defined_out_of_lineEi(%class.Foo* [[F]], i32 3)
-// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR2]]
+// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR3]]
 // CHECK-NEXT:ret i32 0
 //
 int main() {
Index: clang/test/Profile/c-unprofiled-blocks.c
===
--- clang/test/Profile/c-unprofiled-blocks.c
+++ clang/test/Profile/c-unprofiled-blocks.c
@@ -16,7 +16,7 @@
   // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
   while (--i) {}
 
-  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP1:!.*]]
   do {} while (i++ < 75);
 
   // PGOUSE: switch {{.*}} [
@@ -46,7 +46,7 @@
 // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
 while (--i) {}
 
-// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP2:!.*]]
 do {} while (i++ < 75);
 
 // PGOUSE: switch {{.*}} [
Index: clang/test/OpenMP/simd_metadata.c
===
--- clang/test/OpenMP/simd_metadata.c
+++ clang/test/OpenMP/simd_metadata.c
@@ -137,7 +137,8 @@
 }
 // CHECK: store float {{.+}}, float* {{.+}}, align {{.+}}, !llvm.access.group ![[ACCESS_GROUP_13:[0-9]+]]
   }
-// CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER_INNER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
 }
 
 // Metadata for h1:
Index: clang/test/CodeGenCXX/thunks.cpp
===
--- clang/test/CodeGenCXX/thunks.cpp
+++ clang/test/CodeGenCXX/thunks.cpp
@@ -529,7 +529,7 @@
 // CHECK-NONOPT-LABEL: define linkonce_odr void @_ZThn8_N6Test101C3fooEv
 
 // Checking with opt
-// CHECK-OPT-LABEL: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(%"struct.Test4B::(anonymous 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-27 Thread Johannes Doerfert via Phabricator via cfe-commits
jdoerfert added a comment.

In what situation do we generate `mustprogress` function attributes now? I was 
expecting them in `clang/test/CodeGen/attr-mustprogress.cpp` but did not see 
any.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-14 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 291581.
atmnpatel added a comment.

Tests renamed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-mustprogress.c
  clang/test/CodeGen/attr-mustprogress.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
@@ -44,7 +44,7 @@
 // CHECK-NEXT:[[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
 // CHECK-NEXT:store %class.Foo* [[THIS:%.*]], %class.Foo** [[THIS_ADDR]], align 8
 // CHECK-NEXT:[[THIS1:%.*]] = load %class.Foo*, %class.Foo** [[THIS_ADDR]], align 8
-// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR2:#.*]]
+// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR3:#.*]]
 // CHECK-NEXT:ret void
 //
 Foo::~Foo() {}
@@ -70,7 +70,7 @@
 // CHECK-NEXT:call void @_ZN3FooC1Ei(%class.Foo* [[F]], i32 1)
 // CHECK-NEXT:[[CALL:%.*]] = call i32 @_ZNK3Foo23function_defined_inlineEi(%class.Foo* [[F]], i32 2)
 // CHECK-NEXT:[[CALL1:%.*]] = call i32 @_ZNK3Foo28function_defined_out_of_lineEi(%class.Foo* [[F]], i32 3)
-// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR2]]
+// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR3]]
 // CHECK-NEXT:ret i32 0
 //
 int main() {
Index: clang/test/Profile/c-unprofiled-blocks.c
===
--- clang/test/Profile/c-unprofiled-blocks.c
+++ clang/test/Profile/c-unprofiled-blocks.c
@@ -16,7 +16,7 @@
   // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
   while (--i) {}
 
-  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP1:!.*]]
   do {} while (i++ < 75);
 
   // PGOUSE: switch {{.*}} [
@@ -46,7 +46,7 @@
 // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
 while (--i) {}
 
-// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP2:!.*]]
 do {} while (i++ < 75);
 
 // PGOUSE: switch {{.*}} [
Index: clang/test/OpenMP/simd_metadata.c
===
--- clang/test/OpenMP/simd_metadata.c
+++ clang/test/OpenMP/simd_metadata.c
@@ -137,7 +137,8 @@
 }
 // CHECK: store float {{.+}}, float* {{.+}}, align {{.+}}, !llvm.access.group ![[ACCESS_GROUP_13:[0-9]+]]
   }
-// CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER_INNER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
 }
 
 // Metadata for h1:
Index: clang/test/CodeGenCXX/thunks.cpp
===
--- clang/test/CodeGenCXX/thunks.cpp
+++ clang/test/CodeGenCXX/thunks.cpp
@@ -529,7 +529,7 @@
 // CHECK-NONOPT-LABEL: define linkonce_odr void @_ZThn8_N6Test101C3fooEv
 
 // Checking with opt
-// CHECK-OPT-LABEL: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(%"struct.Test4B::(anonymous namespace)::C"* %this) unnamed_addr #0 align 2
+// CHECK-OPT-LABEL: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(%"struct.Test4B::(anonymous namespace)::C"* %this) 

[PATCH] D86841: [clang] Add mustprogress and llvm.loop.mustprogress attribute deduction

2020-09-14 Thread Atmn Patel via Phabricator via cfe-commits
atmnpatel updated this revision to Diff 291567.
atmnpatel added a comment.

Fixed failing test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86841

Files:
  clang/lib/CodeGen/CGLoopInfo.cpp
  clang/lib/CodeGen/CGLoopInfo.h
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/address-safety-attr-flavors.cpp
  clang/test/CodeGen/address-safety-attr.cpp
  clang/test/CodeGen/attr-noprogress.c
  clang/test/CodeGen/attr-noprogress.cpp
  clang/test/CodeGen/memtag-attr.cpp
  clang/test/CodeGen/no-builtin.cpp
  clang/test/CodeGenCXX/cxx11-trivial-initializer-struct.cpp
  clang/test/CodeGenCXX/fno-unroll-loops-metadata.cpp
  clang/test/CodeGenCXX/thunks-ehspec.cpp
  clang/test/CodeGenCXX/thunks.cpp
  clang/test/OpenMP/simd_metadata.c
  clang/test/Profile/c-unprofiled-blocks.c
  clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
  
clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected

Index: clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/check-attributes.cpp.funcattrs.expected
@@ -11,7 +11,7 @@
   struct RT Z;
 };
 
-// CHECK: Function Attrs: noinline nounwind optnone
+// CHECK: Function Attrs: noinline nounwind optnone mustprogress
 // CHECK-LABEL: @_Z3fooP2ST(
 // CHECK-NEXT:  entry:
 // CHECK-NEXT:[[S_ADDR:%.*]] = alloca %struct.ST*, align 8
Index: clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
===
--- clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
+++ clang/test/utils/update_cc_test_checks/Inputs/basic-cplusplus.cpp.expected
@@ -44,7 +44,7 @@
 // CHECK-NEXT:[[THIS_ADDR:%.*]] = alloca %class.Foo*, align 8
 // CHECK-NEXT:store %class.Foo* [[THIS:%.*]], %class.Foo** [[THIS_ADDR]], align 8
 // CHECK-NEXT:[[THIS1:%.*]] = load %class.Foo*, %class.Foo** [[THIS_ADDR]], align 8
-// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR2:#.*]]
+// CHECK-NEXT:call void @_ZN3FooD2Ev(%class.Foo* [[THIS1]]) [[ATTR3:#.*]]
 // CHECK-NEXT:ret void
 //
 Foo::~Foo() {}
@@ -70,7 +70,7 @@
 // CHECK-NEXT:call void @_ZN3FooC1Ei(%class.Foo* [[F]], i32 1)
 // CHECK-NEXT:[[CALL:%.*]] = call i32 @_ZNK3Foo23function_defined_inlineEi(%class.Foo* [[F]], i32 2)
 // CHECK-NEXT:[[CALL1:%.*]] = call i32 @_ZNK3Foo28function_defined_out_of_lineEi(%class.Foo* [[F]], i32 3)
-// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR2]]
+// CHECK-NEXT:call void @_ZN3FooD1Ev(%class.Foo* [[F]]) [[ATTR3]]
 // CHECK-NEXT:ret i32 0
 //
 int main() {
Index: clang/test/Profile/c-unprofiled-blocks.c
===
--- clang/test/Profile/c-unprofiled-blocks.c
+++ clang/test/Profile/c-unprofiled-blocks.c
@@ -16,7 +16,7 @@
   // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
   while (--i) {}
 
-  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+  // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP1:!.*]]
   do {} while (i++ < 75);
 
   // PGOUSE: switch {{.*}} [
@@ -46,7 +46,7 @@
 // PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
 while (--i) {}
 
-// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}{{$}}
+// PGOUSE: br i1 %{{[^,]*}}, label %{{[^,]*}}, label %{{[^,]*}}, !llvm.loop [[LOOP2:!.*]]
 do {} while (i++ < 75);
 
 // PGOUSE: switch {{.*}} [
Index: clang/test/OpenMP/simd_metadata.c
===
--- clang/test/OpenMP/simd_metadata.c
+++ clang/test/OpenMP/simd_metadata.c
@@ -137,7 +137,8 @@
 }
 // CHECK: store float {{.+}}, float* {{.+}}, align {{.+}}, !llvm.access.group ![[ACCESS_GROUP_13:[0-9]+]]
   }
-// CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER_INNER:![0-9]+]]
+  // CHECK: br label %{{.+}}, !llvm.loop [[LOOP_H3_HEADER:![0-9]+]]
 }
 
 // Metadata for h1:
Index: clang/test/CodeGenCXX/thunks.cpp
===
--- clang/test/CodeGenCXX/thunks.cpp
+++ clang/test/CodeGenCXX/thunks.cpp
@@ -529,7 +529,7 @@
 // CHECK-NONOPT-LABEL: define linkonce_odr void @_ZThn8_N6Test101C3fooEv
 
 // Checking with opt
-// CHECK-OPT-LABEL: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(%"struct.Test4B::(anonymous namespace)::C"* %this) unnamed_addr #0 align 2
+// CHECK-OPT-LABEL: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(%"struct.Test4B::(anonymous namespace)::C"* %this)