[PATCH] D140884: llvm-reduce: Simplify attribute reduction implementation

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 15:58:20 PST 2023


nickdesaulniers accepted this revision.
nickdesaulniers added inline comments.
This revision is now accepted and ready to land.
Herald added a subscriber: StephenFan.


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp:52
 public:
-  DenseMap<GlobalVariable *, AttrPtrVecTy> GlobalVariablesToRefine;
-  DenseMap<Function *, AttrPtrVecVecTy> FunctionsToRefine;
-  DenseMap<CallBase *, AttrPtrVecVecTy> CallsToRefine;
-
-  explicit AttributeRemapper(Oracle &O) : O(O) {}
+  explicit AttributeRemapper(Oracle &O, LLVMContext &C) : O(O), Context(C) {}
 
----------------
isn't explicit only necessary when the constructor has a single argument?


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp:84
+    if (AttributesToPreserve.attrs().empty())
+      return AttributeSet();
+    return AttributeSet::get(Context, AttributesToPreserve);
----------------
I think `return {};` works?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140884/new/

https://reviews.llvm.org/D140884



More information about the llvm-commits mailing list