llvm-project/llvm/test
Brian Gesiak b963c5150d [AMDGPU] Fix discarded result of addAttribute
Summary:
`llvm::AttributeList` and `llvm::AttributeSet` are immutable, and so methods
defined on these classes, such as `addAttribute`, return a new immutable
object with the attribute added. In https://reviews.llvm.org/D55217 I attempted
to annotate methods such as `addAttribute` with `LLVM_NODISCARD`, since
calling these methods has no side-effects, and so ignoring the result
that is returned is almost certainly a programmer error.

However, committing the change resulted in new warnings in the AMDGPU target.
The AMDGPU simplify libcalls pass added in https://reviews.llvm.org/D36436
attempts to add the readonly and nounwind attributes to simplified
library functions, but instead calls the `addAttribute` methods and
ignores the result.

Modify the simplify libcalls pass to actually add the nounwind and
readonly attributes. Also update the simplify libcalls test to assert
that these attributes are actually being set.

Reviewers: rampitec, vpykhtin, rnk

Reviewed By: rampitec

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 348732
2018-12-09 21:56:50 +00:00
..
Analysis [CostModel][X86] Fix overcounting arithmetic cost in illegal types in getArithmeticReductionCost/getMinMaxReductionCost 2018-12-07 18:20:56 +00:00
Assembler [IR] Don't assume all functions are 4 byte aligned 2018-12-07 08:34:59 +00:00
Bindings [DebugInfo] IR/Bitcode changes for DISubprogram flags. 2018-11-28 21:14:32 +00:00
Bitcode [ThinLTO] Allow importing of functions with var args 2018-12-01 05:11:46 +00:00
BugPoint [test] Fix BugPoint/compile-custom.ll to use detected python exec 2018-12-02 16:49:23 +00:00
CodeGen [AMDGPU] Fix discarded result of addAttribute 2018-12-09 21:56:50 +00:00
DebugInfo Support skewed stream arrays. 2018-12-06 16:55:00 +00:00
Demangle [MS Demangler] Print public:, protected:, private: if set in FunctionClass or a variable's StorageClass. 2018-11-13 20:18:26 +00:00
Examples
ExecutionEngine [ExecutionEngine][Interpreter] Fix out-of-bounds array access. 2018-11-20 01:01:26 +00:00
Feature Mark @llvm.trap cold 2018-11-14 19:53:41 +00:00
FileCheck [FileCheck] introduce CHECK-COUNT-<num> repetition directive 2018-11-13 00:46:13 +00:00
Instrumentation [asan] Split -asan-use-private-alias to -asan-use-odr-indicator 2018-12-04 23:17:41 +00:00
Integer
JitListener
LTO LTO: Don't internalize available_externally globals. 2018-12-05 00:09:36 +00:00
Linker [DebugInfo] IR/Bitcode changes for DISubprogram flags. 2018-11-28 21:14:32 +00:00
MC [NFC][AArch64] Split out backend features 2018-12-06 15:39:17 +00:00
Object AMDGPU: Enable code object v3 for AMDHSA only 2018-11-15 02:32:43 +00:00
ObjectYAML [WebAssembly] Add support for dylink section in object format 2018-11-14 18:36:24 +00:00
Other Fixing -print-module-scope for legacy SCC passes 2018-12-03 14:48:15 +00:00
SafepointIRVerifier
SymbolRewriter
TableGen [TableGen] Preserve order of output operands in DAGISelMatcherGen 2018-12-05 00:47:59 +00:00
ThinLTO/X86 ThinLTO: Do not import debug info for imported global constants 2018-12-05 21:42:17 +00:00
Transforms [MemCpyOpt] memset->memcpy forwarding with undef tail 2018-12-07 21:16:58 +00:00
Unit
Verifier [GlobalISel] Introduce G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC and G_CONCAT_VECTOR opcodes. 2018-12-05 23:53:30 +00:00
YAMLParser
tools [COFF] Map truncated .eh_frame section name 2018-12-08 18:15:41 +00:00
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in