[PATCH] D99943: [llvm-reduce] Skip dso_local reduction step that results in invalid IR
Alexander Richardson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 6 04:05:14 PDT 2021
arichardson created this revision.
arichardson added reviewers: swamulism, aeubanks, lebedev.ri, arsenm, fhahn.
arichardson requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Trying to call setDSOLocal(false) on a GlobalValue that is implicitly
dso_local results in the following module verifier error:
- WARNING | reduction resulted in invalid module, skipping GlobalValue with local linkage or non-default visibility must be dso_local!
Since this will never result in a valid test case reduction, skip it to avoid
unncessary work and lots of WARNING messages.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D99943
Files:
llvm/tools/llvm-reduce/deltas/ReduceGlobalValues.cpp
Index: llvm/tools/llvm-reduce/deltas/ReduceGlobalValues.cpp
===================================================================
--- llvm/tools/llvm-reduce/deltas/ReduceGlobalValues.cpp
+++ llvm/tools/llvm-reduce/deltas/ReduceGlobalValues.cpp
@@ -24,7 +24,7 @@
// remove dso_local from global values
for (auto &GV : Program->global_values())
- if (GV.isDSOLocal() && !O.shouldKeep()) {
+ if (GV.isDSOLocal() && !GV.isImplicitDSOLocal() && !O.shouldKeep()) {
GV.setDSOLocal(false);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99943.335468.patch
Type: text/x-patch
Size: 511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210406/a30b495e/attachment.bin>
More information about the llvm-commits
mailing list