[PATCH] D84399: [SCEVExpander] Avoid re-sing existing casts if it means updating users.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 04:22:56 PDT 2020


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

This seems good to me, but please wait for one more reviewer.



================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:59
 
   // Check to see if there is already a cast!
+  for (User *U : V->users()) {
----------------
a cast *in the basic block specified by insertion point*


================
Comment at: llvm/test/Transforms/LoopStrengthReduce/pr27056.ll:39
 ; CHECK:       for.body:
 ; CHECK-NEXT:    [[TMP5:%.*]] = inttoptr i64 [[LSR_IV]] to %struct.L*
-; CHECK-NEXT:    [[CMP:%.*]] = icmp eq %struct.L* [[UGLYGEP1]], [[TMP]]
----------------
Why were we emitting an unused instruction in the first place?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84399



More information about the llvm-commits mailing list