[PATCH] D18863: Propagate Undef in llvm.cos Intrinsic

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 09:32:31 PDT 2016


sanjoy requested changes to this revision.
sanjoy added a subscriber: majnemer.
sanjoy added a comment.
This revision now requires changes to proceed.

@majnemer - what do you think of this?


================
Comment at: lib/Analysis/ConstantFolding.cpp:1446
@@ -1445,1 +1445,3 @@
   if (Operands.size() == 1) {
+    if (UndefValue *Op = dyn_cast<UndefValue>(Operands[0])) {
+      // cosine(arg) is between -1 and 1. cosine(invalid arg) is NaN
----------------
Since you're not using `Op`, using `isa` instead of `dyn_cast` is better.


http://reviews.llvm.org/D18863





More information about the llvm-commits mailing list