[PATCH] D99926: [GVN] Introduce loop load PRE

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 10:23:44 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/GVN.cpp:1517
+  AvailableLoads[LoopBlock] = LoadPtr;
+  AvailableLoads[Preheader] = LoadPtr;
+
----------------
Where do we check that LoadPtr is loop invariant (and thus available in preheader)?


================
Comment at: llvm/test/Transforms/GVN/PRE/pre-loop-load.ll:164
 ; CHECK:       loop:
 ; CHECK-NEXT:    br i1 undef, label [[HOT_PATH:%.*]], label [[COLD_PATH:%.*]]
 ; CHECK:       hot_path:
----------------
This test looks broken. I think for it to do something useful you'll want to pass %p to may_free_memory (or another function). Otherwise the load is just undef and there is no clobber in the loop either.


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

https://reviews.llvm.org/D99926



More information about the llvm-commits mailing list