[PATCH] D27618: Failure to vectorize __builtin_sqrt/__builtin_sqrtf

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 10 02:28:36 PST 2016


RKSimon added a subscriber: llvm-commits.
RKSimon added a comment.

In https://reviews.llvm.org/D27618#618796, @fhahn wrote:

> It would be great the have a ll IR test case. You can use the `-S -emit-llvm` options to generate llvm IR for the test case.


In fact we should only have ll tests - depending on clang in the llvm project is a big no-no. Move the .c test over to clang/test/Codegen, checking the generated IR in that file; then have an equivalent test in llvm that tests the codegen for exactly that IR. You can add the clang test without review.



================
Comment at: lib/Analysis/ValueTracking.cpp:2526
   case LibFunc::sqrtl:
-    if (ICS->hasNoNaNs())
-      return Intrinsic::sqrt;
-    return Intrinsic::not_intrinsic;
+    return Intrinsic::sqrt;
   }
----------------
Do we know the history behind why sqrt was protected by this?


================
Comment at: test/CodeGen/X86/lit.local.cfg:7
 # cleanly.
-config.suffixes = ['.ll', '.mir', '.test', '.txt']
+config.suffixes = ['.ll', '.c', '.mir', '.test', '.txt']
 
----------------
c/cpp test files aren't permitted in the llvm project


https://reviews.llvm.org/D27618





More information about the llvm-commits mailing list