[PATCH] D46135: [Driver, CodeGen] add options to enable/disable an FP cast optimization

Sanjay Patel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 26 11:12:28 PDT 2018


spatel added inline comments.


================
Comment at: test/CodeGen/no-junk-ftrunc.c:1
+// RUN: %clang_cc1 -S -ffp-cast-overflow-workaround %s -emit-llvm -o - | FileCheck %s
+
----------------
lebedev.ri wrote:
> For a good measure, i'd add one more `RUN` line to test that it is currently the default.
> (Yes, i noticed that it is already tested in `test/Driver/fast-math.c`)
The driver alone is handling the default setting, so it passes this flag to the front-end only when we're going to disable the transform. Ie, the driver eats "-fno-fp-cast-overflow-workaround" and sends nothing in that case to the front-end. 

So there's not currently any case where the function attribute will be "fp-cast-overflow-workaround=false", but I left that as a possibility in case we decide to lift the limit at a finer granularity (scalar vs. vector etc).

I may be misunderstanding the question/suggestion - do we want the front-end to independently have a default setting?


https://reviews.llvm.org/D46135





More information about the cfe-commits mailing list