[PATCH] D21137: Instcombile min/max intrinsics calls

Karthik Bhat via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 18:37:28 PDT 2016

karthikthecool added inline comments.

Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:977-978
@@ +976,4 @@
+        IntrinsicInst *I = cast<IntrinsicInst>(Arg1);
+        if (I->hasNoNaNs())
+          return replaceInstUsesWith(*II, Arg0);
+        Instruction *Result = new FCmpInst(II, FCmpInst::FCMP_UNO, Arg0, Arg0);
majnemer wrote:
> Couldn't this case live in InstructionSimplify?
Hi David,
Thanks for the comments.
Since in simplifyMinnumMaxnum we use  
replaceInstUsesWith i thought we can reuse the same code here.. 
Also i feel handling fmin/fmax cases here in this single function would keep changes limited to one place.
But please let me knw if you feel this place is incorrect I will try to move these into instsimplify.
Thanks again for your time and review comments.


More information about the llvm-commits mailing list