summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorDavid Greene <dag@cray.com>2019-10-28 13:21:29 -0500
committerDavid Greene <dag@cray.com>2019-12-16 10:32:35 -0600
commit055aeb5275153ee61ccd59cab2987fdcaca73756 (patch)
tree70ecdefcab61d079711e52ab77cafbd259604d71 /llvm/tools
parent69fcc6ecc15bd01b2ade9efc49315b2097f0da40 (diff)
downloadbcm5719-llvm-055aeb5275153ee61ccd59cab2987fdcaca73756.tar.gz
bcm5719-llvm-055aeb5275153ee61ccd59cab2987fdcaca73756.zip
[Bugpoint] Do not create illegal function attribute combos
If a function requires optnone to trigger a crash, it must also have noline, otherwise it will fail a verifier check. Differential revision: https://reviews.llvm.org/D69522
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/CrashDebugger.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index 167b6a2ffc0..aa88a06a6df 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -364,6 +364,11 @@ bool ReduceCrashingFunctionAttributes::TestFuncAttrs(
// Set this new list of attributes on the function.
F->setAttributes(NewAttrs);
+ // If the attribute list includes "optnone" we need to make sure it also
+ // includes "noinline" otherwise we will get a verifier failure.
+ if (F->hasFnAttribute(Attribute::OptimizeNone))
+ F->addFnAttr(Attribute::NoInline);
+
// Try running on the hacked up program...
if (TestFn(BD, M.get())) {
BD.setNewProgram(std::move(M)); // It crashed, keep the trimmed version...
OpenPOWER on IntegriCloud