[PATCH] D34726: AMDGPU/SI: Don not insert an instruction into worklist twice in movetovalu

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 17:12:12 PDT 2017


arsenm added a comment.

Why is it possible for an instruction here to end up in the worklist multiple times? I'm surprised we haven't hit this before and I'm not sure exactly when this happens. Can you reduce the test any further? I would expect only 2-3 actual instructions in it.



================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:3860
+      // Do not add to worklist twice!
+      if(Worklist.end() == llvm::find(Worklist, &MI))
+        Worklist.push_back(&UseMI);
----------------
Missing space


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:3947
+      // Do not add to worklist twice!
+      if(Worklist.end() == llvm::find(Worklist, &MI))
+        Worklist.push_back(&MI);
----------------
Missing space


================
Comment at: lib/Target/AMDGPU/SIInstrInfo.cpp:3947
+      // Do not add to worklist twice!
+      if(Worklist.end() == llvm::find(Worklist, &MI))
+        Worklist.push_back(&MI);
----------------
arsenm wrote:
> Missing space
I think the worklist can be pretty big. A brute force search through is probably bad.


https://reviews.llvm.org/D34726





More information about the llvm-commits mailing list