[llvm] 49aeeaf - llvm-reduce: Don't delete triple/datalayout
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 24 08:14:04 PDT 2022
Author: Matt Arsenault
Date: 2022-04-24T11:01:31-04:00
New Revision: 49aeeafda3b5a5f82020ab8ab8b4e951c552868d
URL: https://github.com/llvm/llvm-project/commit/49aeeafda3b5a5f82020ab8ab8b4e951c552868d
DIFF: https://github.com/llvm/llvm-project/commit/49aeeafda3b5a5f82020ab8ab8b4e951c552868d.diff
LOG: llvm-reduce: Don't delete triple/datalayout
Removing these is extremely unhelpful and just adds extra hassle. This
is really finding out whether your test script uses -mtriple or
not. You can't meaningfully delete these fields, and the resulting
module defaults to the host.
Added:
Modified:
llvm/test/tools/llvm-reduce/remove-module-data.ll
llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp
Removed:
################################################################################
diff --git a/llvm/test/tools/llvm-reduce/remove-module-data.ll b/llvm/test/tools/llvm-reduce/remove-module-data.ll
index b4b0fec8bee35..aeb1312f6f84b 100644
--- a/llvm/test/tools/llvm-reduce/remove-module-data.ll
+++ b/llvm/test/tools/llvm-reduce/remove-module-data.ll
@@ -15,8 +15,8 @@
; CHECK-FINAL-NOT: ModuleID
; CHECK-FINAL-NOT: source_filename
-; CHECK-FINAL-NOT: datalayout
-; CHECK-FINAL-NOT: triple
+; CHECK-FINAL: datalayout
+; CHECK-FINAL: triple
; CHECK-FINAL-NOT: module asm
; CHECK-FINAL: declare void @g
diff --git a/llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp b/llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp
index 7a59950ca907c..cbde789fa1da6 100644
--- a/llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp
+++ b/llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp
@@ -19,10 +19,6 @@ static void clearModuleData(Oracle &O, Module &Program) {
Program.setModuleIdentifier("");
if (!Program.getSourceFileName().empty() && !O.shouldKeep())
Program.setSourceFileName("");
- if (!Program.getDataLayoutStr().empty() && !O.shouldKeep())
- Program.setDataLayout("");
- if (!Program.getTargetTriple().empty() && !O.shouldKeep())
- Program.setTargetTriple("");
// TODO: clear line by line rather than all at once
if (!Program.getModuleInlineAsm().empty() && !O.shouldKeep())
Program.setModuleInlineAsm("");
More information about the llvm-commits
mailing list