diff options
| author | David Greene <dag@cray.com> | 2019-10-28 13:21:29 -0500 |
|---|---|---|
| committer | David Greene <dag@cray.com> | 2019-12-16 10:32:35 -0600 |
| commit | 055aeb5275153ee61ccd59cab2987fdcaca73756 (patch) | |
| tree | 70ecdefcab61d079711e52ab77cafbd259604d71 /llvm/tools | |
| parent | 69fcc6ecc15bd01b2ade9efc49315b2097f0da40 (diff) | |
| download | bcm5719-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.cpp | 5 |
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... |

