[PATCH] Select Elimination in InstCombine

hfinkel at anl.gov hfinkel at anl.gov
Tue Sep 30 16:46:36 PDT 2014


================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:2452
@@ +2451,3 @@
+    auto *Usr = cast<Instruction>(U);
+    if (Usr != UI && !DT->dominates(DB, Usr->getParent()))
+      return false;
----------------
Gerolf wrote:
> Gerolf wrote:
> > hfinkel wrote:
> > > If you mean for this to rule-out any other uses in the same block as the definition (I don't see anything else that might enforce that there is only one use in the parent block), should this be a call to properlyDominates?
> > Very much agree. Done.
> Ups, I have to take it back. DB can be a successor block of the DI parent and it may contain a use. So dominates() must be used. 
Alright, please make sure the function description comment is accurate and that this is noted.

http://reviews.llvm.org/D5258






More information about the llvm-commits mailing list