[PATCH] D25333: [LV] Avoid rounding errors for predicated instruction costs

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 07:54:10 PDT 2016


mssimpso added inline comments.


================
Comment at: test/Transforms/LoopVectorize/AArch64/predication_costs.ll:5
+target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-linux-gnu"
+
----------------
gilr wrote:
> I'm a bit uncomfortable with this test being under a target-specific sub-directory as it checks a target-independent fix to the cost-model. OTOH I don't know if there's a better way to write a test for the cost-model.
> 
> It seems the common solution in LV's tests is to duplicate: gather-cost.ll is duplicated into both AArch64 and X86, specifying the datalayout in the file and the target in the RUN command-line argument. The interleaved_cost.ll test seems to copy the ARM test into the larger AArch64 test.
> Is there a way to use multiple prefixes in the test to check multiple platforms, e.g.:
> ; REQUIRES-TARGET: <TARGET>
> ; RUN-TARGET: -loop-vectorize -mtriple=<TARGET's tiple> -mcpu=<TARGET's cpu> ...
> ; CHECK-TARGET: Found an estimated cost of <TARGET's cost> ...
> and if so, is it in the spirit of [[ http://llvm.org/docs/TestingGuide.html#platform-specific-tests | the testing guide ]]?
> 
> This is more of a general question. It shouldn't delay this commit if there's no clear answer. I'm fine with duplicating the test (with a comment in each variant referencing the others). I'm also fine with just adding a "not AArch64-specific" comment in the test.
In this case, we could actually probably use the -force-target-instruction-cost flag and then move this up to the target-independent directory. The actual costs don't really matter here, just the way we do the division. I'll give that a shot. Thanks!


https://reviews.llvm.org/D25333





More information about the llvm-commits mailing list