[PATCH] D123942: llvm-reduce: Don't delete triple/datalayout

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 18 07:18:25 PDT 2022


arsenm created this revision.
arsenm added reviewers: aeubanks, swamulism, lebedev.ri.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D123942

Files:
  llvm/test/tools/llvm-reduce/remove-module-data.ll
  llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp


Index: llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp
===================================================================
--- llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp
+++ llvm/tools/llvm-reduce/deltas/ReduceModuleData.cpp
@@ -19,10 +19,6 @@
     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("");
Index: llvm/test/tools/llvm-reduce/remove-module-data.ll
===================================================================
--- llvm/test/tools/llvm-reduce/remove-module-data.ll
+++ 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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123942.423389.patch
Type: text/x-patch
Size: 1232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220418/3a74ac36/attachment.bin>


More information about the llvm-commits mailing list