================
@@ -64,6 +95,31 @@ void error() {
     accumulator++;
   }
 
+  struct {
+    int FieldFromVar;
+    int FieldFromField;
+  } InferredField;
+  InferredField.FieldFromVar = ThreadID * 2;
+  while (j < InferredField.FieldFromVar) {
+    // CHECK-NOTES: :[[@LINE-1]]:10: warning: backward branch (while loop) is 
ID-dependent due to member reference to 'FieldFromVar' and may cause 
performance degradation [altera-id-dependent-backward-branch]
+    // CHECK-NOTES: :[[@LINE-6]]:5: note: inferred assignment of ID-dependent 
member from ID-dependent variable ThreadID
+    accumulator++;
+  }
+
+  InferredField.FieldFromField = Example.IDDepField;
+  while (j < InferredField.FieldFromField) {
+    // CHECK-NOTES: :[[@LINE-1]]:10: warning: backward branch (while loop) is 
ID-dependent due to member reference to 'FieldFromField' and may cause 
performance degradation [altera-id-dependent-backward-branch]
+    // CHECK-NOTES: :[[@LINE-12]]:5: note: inferred assignment of ID-dependent 
member from ID-dependent member IDDepField
----------------
unterumarmung wrote:

I guess you're right. But the issue is preexisting. Do you think we should fix 
it here or on the separate PR? Both are fine by me. The latter one can be a 
good candidate for a "good first issue"

https://github.com/llvm/llvm-project/pull/200660
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to