llvm-project/clang/test/CodeGenCUDA
Adam Nemet 049a31d53d Use FPContractModeKind universally
FPContractModeKind is the codegen option flag which is already ternary (off,
on, fast).  This makes it universally the type for the contractable info
across the front-end:

* In FPOptions (i.e. in the Sema + in the expression nodes).
* In LangOpts::DefaultFPContractMode which is the option that initializes
FPOptions in the Sema.

Another way to look at this change is that before fp-contractable on/off were
the only states handled to the front-end:
 * For "on", FMA folding was performed by  the front-end
 * For "fast", we simply forwarded the flag to TargetOptions to handle it in
 LLVM

Now off/on/fast are all exposed because for fast we will generate
fast-math-flags during CodeGen.

This is toward moving fp-contraction=fast from an LLVM TargetOption to a
FastMathFlag in order to fix PR25721.

---
This is a recommit of r299027 with an adjustment to the test
CodeGenCUDA/fp-contract.cu.  The test assumed that even
though -ffp-contract=on is passed FE-based folding of FMA won't happen.

This is obviously wrong since the user is asking for this explicitly with the
option.  CUDA is different that -ffp-contract=fast is on by default.

The test used to "work" because contract=fast and contract=on were maintained
separately and we didn't fold in the FE because contract=fast was on due to
the target-default.  This patch consolidates the contract=on/fast/off state
into a ternary state hence the change in behavior.
---

Differential Revision: https://reviews.llvm.org/D31167

llvm-svn: 299033
2017-03-29 21:54:24 +00:00
..
Inputs Avoid depending on test inputes that aren't in Inputs 2016-05-20 00:38:25 +00:00
address-spaces.cu [CUDA] Restrict init of local __shared__ variables to empty constructors only. 2016-05-09 22:09:56 +00:00
alias.cu [CUDA] Don't generate aliases for static extern "C" functions. 2016-01-25 22:36:37 +00:00
convergent.cu [CUDA] Mark device functions as nounwind. 2016-10-04 23:41:49 +00:00
cuda-builtin-vars.cu [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h. 2016-10-08 22:16:08 +00:00
device-stub.cu [CUDA] Place GPU binary into .nv_fatbin section and align it by 8. 2016-08-12 18:44:01 +00:00
device-var-init.cu [CUDA] Mark device functions as nounwind. 2016-10-04 23:41:49 +00:00
device-vtable.cu [CUDA] Make vtable construction aware of host/device side of CUDA compilation. 2015-12-17 18:12:36 +00:00
filter-decl.cu [CUDA] Emit host-side 'shadows' for device-side global variables 2016-03-02 18:28:50 +00:00
flush-denormals.cu [CUDA] Fix flush-denormals.cu test so that it checks what it intends to CHECK. 2016-05-10 00:34:50 +00:00
fp-contract.cu Use FPContractModeKind universally 2017-03-29 21:54:24 +00:00
function-overload.cu [CUDA] Disallow overloading destructors. 2016-10-03 16:48:23 +00:00
kernel-args-alignment.cu [CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment. 2016-07-27 22:36:21 +00:00
kernel-call.cu
launch-bounds.cu [CUDA] Improve target attribute checking for function templates. 2016-12-07 19:27:16 +00:00
link-device-bitcode.cu [CUDA] Add -disable-llvm-passes to CodeGenCUDA/link-device-bitcode.cu. NFC 2016-03-30 23:45:38 +00:00
llvm-used.cu
nothrow.cu [CUDA] Add missing ':' to noexcept.cu test. 2016-10-05 00:27:38 +00:00
printf-aggregate.cu [CUDA] Don't crash when trying to printf a non-scalar object. 2016-02-11 02:00:52 +00:00
printf.cu [CUDA] Generate CUDA's printf alloca in its function's entry block. 2016-01-28 23:58:28 +00:00
propagate-metadata.cu [CodeGen] [CUDA] Add the ability set default attrs on functions in linked modules. 2017-01-25 21:29:48 +00:00
ptx-kernels.cu [CUDA] Give templated device functions internal linkage, templated kernels external linkage. 2016-06-30 18:41:33 +00:00