<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jun 20, 2020 at 3:29 PM Eric Christopher via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Eric Christopher<br>
Date: 2020-06-20T00:06:39-07:00<br>
New Revision: cf23852587144e3014e72bb5b6993ae21f6a09be<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/cf23852587144e3014e72bb5b6993ae21f6a09be" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/cf23852587144e3014e72bb5b6993ae21f6a09be</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/cf23852587144e3014e72bb5b6993ae21f6a09be.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/cf23852587144e3014e72bb5b6993ae21f6a09be.diff</a><br>
<br>
LOG: [Target] As part of using inclusive language within the llvm project,<br>
migrate away from the use of blacklist and whitelist.<br>
<br>
This change affects an internal llvm command line option.<br>
<br>
Added: <br>
    llvm/test/CodeGen/WebAssembly/lower-em-exceptions-allowed.ll<br>
<br>
Modified: <br>
    llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp<br>
    llvm/lib/Target/AArch64/AArch64InstrInfo.cpp<br>
    llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp<br>
    llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp<br>
    llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp<br>
    llvm/lib/Target/ARM/ARMTargetTransformInfo.h<br>
    llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp<br>
    llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp<br>
    llvm/lib/Target/X86/X86ISelLowering.cpp<br>
<br>
Removed: <br>
    llvm/test/CodeGen/WebAssembly/lower-em-exceptions-whitelist.ll<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp<br>
index 5b1ebde8b77c..d5b016728c71 100644<br>
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp<br>
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp<br>
@@ -1336,9 +1336,7 @@ unsigned DWARFVerifier::verifyNameIndexCompleteness(<br>
   // "The name index must contain an entry for each debugging information entry<br>
   // that defines a named subprogram, label, variable, type, or namespace,<br>
   // subject to ..."<br>
-  // Instead whitelisting all TAGs representing a "type" or a "subprogram", to<br>
-  // make sure we catch any missing items, we instead blacklist all TAGs that we<br>
-  // know shouldn't be indexed.<br>
+  // Explicitly exclude all TAGs that we know shouldn't be indexed.<br>
   switch (Die.getTag()) {<br>
   // Compile units and modules have names but shouldn't be indexed.<br>
   case DW_TAG_compile_unit:<br>
<br>
diff  --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp<br>
index f9c6a6c51335..5139ae5ccaf1 100644<br>
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp<br>
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp<br>
@@ -6408,7 +6408,7 @@ AArch64InstrInfo::getOutliningType(MachineBasicBlock::iterator &MIT,<br>
<br>
     // If we don't know anything about the callee, assume it depends on the<br>
     // stack layout of the caller. In that case, it's only legal to outline<br>
-    // as a tail-call.  Whitelist the call instructions we know about so we<br>
+    // as a tail-call. Explicitly list the call instructions we know about so we<br>
     // don't get unexpected results with call pseudo-instructions.<br>
     auto UnknownCallOutlineType = outliner::InstrType::Illegal;<br>
     if (MI.getOpcode() == AArch64::BLR ||<br>
<br>
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp<br>
index 0e6a444b2751..68d0012e3314 100644<br>
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp<br>
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp<br>
@@ -933,7 +933,7 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,<br>
     const bool IsStore = Op == G_STORE;<br>
<br>
     auto &Actions = getActionDefinitionsBuilder(Op);<br>
-    // Whitelist some common cases.<br>
+    // Explicitly list some common cases.<br>
     // TODO: Does this help compile time at all?<br>
     Actions.legalForTypesWithMemDesc({{S32, GlobalPtr, 32, GlobalAlign32},<br>
                                       {V2S32, GlobalPtr, 64, GlobalAlign32},<br>
<br>
diff  --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp<br>
index 66334d1b22ce..504d0cc4c08a 100644<br>
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp<br>
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp<br>
@@ -5912,8 +5912,8 @@ ARMBaseInstrInfo::getOutliningType(MachineBasicBlock::iterator &MIT,<br>
   if (MI.isCall()) {<br>
     // If we don't know anything about the callee, assume it depends on the<br>
     // stack layout of the caller. In that case, it's only legal to outline<br>
-    // as a tail-call.  Whitelist the call instructions we know about so we<br>
-    // don't get unexpected results with call pseudo-instructions.<br>
+    // as a tail-call. Explicitly list the call instructions we know about so<br>
+    // we don't get unexpected results with call pseudo-instructions.<br>
     auto UnknownCallOutlineType = outliner::InstrType::Illegal;<br>
     if (Opc == ARM::BL || Opc == ARM::tBL || Opc == ARM::BLX ||<br>
         Opc == ARM::tBLXr || Opc == ARM::tBLXi)<br>
<br>
diff  --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp<br>
index 82849dc67f43..680f239c752c 100644<br>
--- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp<br>
+++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp<br>
@@ -57,13 +57,13 @@ bool ARMTTIImpl::areInlineCompatible(const Function *Caller,<br>
   const FeatureBitset &CalleeBits =<br>
       TM.getSubtargetImpl(*Callee)->getFeatureBits();<br>
<br>
-  // To inline a callee, all features not in the whitelist must match exactly.<br>
-  bool MatchExact = (CallerBits & ~InlineFeatureWhitelist) ==<br>
-                    (CalleeBits & ~InlineFeatureWhitelist);<br>
-  // For features in the whitelist, the callee's features must be a subset of<br>
+  // To inline a callee, all features not in the allowed list must match exactly.<br>
+  bool MatchExact = (CallerBits & ~InlineFeaturesAllowed) ==<br>
+                    (CalleeBits & ~InlineFeaturesAllowed);<br>
+  // For features in the allowed list, the callee's features must be a subset of<br>
   // the callers'.<br>
-  bool MatchSubset = ((CallerBits & CalleeBits) & InlineFeatureWhitelist) ==<br>
-                     (CalleeBits & InlineFeatureWhitelist);<br>
+  bool MatchSubset = ((CallerBits & CalleeBits) & InlineFeaturesAllowed) ==<br>
+                     (CalleeBits & InlineFeaturesAllowed);<br>
   return MatchExact && MatchSubset;<br>
 }<br>
<br>
<br>
diff  --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h<br>
index d319aa88c714..7a2db740f185 100644<br>
--- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h<br>
+++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h<br>
@@ -47,13 +47,13 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {<br>
   const ARMSubtarget *ST;<br>
   const ARMTargetLowering *TLI;<br>
<br>
-  // Currently the following features are excluded from InlineFeatureWhitelist.<br>
+  // Currently the following features are excluded from InlineFeaturesAllowed.<br>
   // ModeThumb, FeatureNoARM, ModeSoftFloat, FeatureFP64, FeatureD32<br>
   // Depending on whether they are set or unset, <br>
diff erent<br>
   // instructions/registers are available. For example, inlining a callee with<br>
   // -thumb-mode in a caller with +thumb-mode, may cause the assembler to<br>
   // fail if the callee uses ARM only instructions, e.g. in inline asm.<br>
-  const FeatureBitset InlineFeatureWhitelist = {<br>
+  const FeatureBitset InlineFeaturesAllowed = {<br>
       ARM::FeatureVFP2, ARM::FeatureVFP3, ARM::FeatureNEON, ARM::FeatureThumb2,<br>
       ARM::FeatureFP16, ARM::FeatureVFP4, ARM::FeatureFPARMv8,<br>
       ARM::FeatureFullFP16, ARM::FeatureFP16FML, ARM::FeatureHWDivThumb,<br>
<br>
diff  --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp<br>
index 4eaa8102101d..a4ff01015312 100644<br>
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp<br>
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp<br>
@@ -54,7 +54,7 @@ ARMELFObjectWriter::ARMELFObjectWriter(uint8_t OSABI)<br>
 bool ARMELFObjectWriter::needsRelocateWithSymbol(const MCSymbol &Sym,<br>
                                                  unsigned Type) const {<br>
   // FIXME: This is extremely conservative. This really needs to use a<br></blockquote><div>s/a/an/;<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-  // whitelist with a clear explanation for why each realocation needs to<br>
+  // explicit list with a clear explanation for why each realocation needs to<br>
   // point to the symbol, not to the section.<br>
   switch (Type) {<br>
   default:<br>
<br>
diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp<br>
index 96a3e9a9d2fe..5fce4a600510 100644<br>
--- a/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp<br>
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp<br>
@@ -221,10 +221,10 @@ using namespace llvm;<br>
 #define DEBUG_TYPE "wasm-lower-em-ehsjlj"<br>
<br>
 static cl::list<std::string><br>
-    EHWhitelist("emscripten-cxx-exceptions-whitelist",<br>
+    EHAllowlist("emscripten-cxx-exceptions-allowed",<br>
                 cl::desc("The list of function names in which Emscripten-style "<br>
                          "exception handling is enabled (see emscripten "<br>
-                         "EMSCRIPTEN_CATCHING_WHITELIST options)"),<br>
+                         "EMSCRIPTEN_CATCHING_ALLOWED options)"),<br>
                 cl::CommaSeparated);<br>
<br>
 namespace {<br>
@@ -248,8 +248,8 @@ class WebAssemblyLowerEmscriptenEHSjLj final : public ModulePass {<br>
   DenseMap<int, Function *> FindMatchingCatches;<br>
   // Map of <function signature string, invoke_ wrappers><br>
   StringMap<Function *> InvokeWrappers;<br>
-  // Set of whitelisted function names for exception handling<br>
-  std::set<std::string> EHWhitelistSet;<br>
+  // Set of allowed function names for exception handling<br>
+  std::set<std::string> EHAllowlistSet;<br>
<br>
   StringRef getPassName() const override {<br>
     return "WebAssembly Lower Emscripten Exceptions";<br>
@@ -265,7 +265,7 @@ class WebAssemblyLowerEmscriptenEHSjLj final : public ModulePass {<br>
                       Value *&LongjmpResult, BasicBlock *&EndBB);<br>
   Function *getInvokeWrapper(CallBase *CI);<br>
<br>
-  bool areAllExceptionsAllowed() const { return EHWhitelistSet.empty(); }<br>
+  bool areAllExceptionsAllowed() const { return EHAllowlistSet.empty(); }<br>
   bool canLongjmp(Module &M, const Value *Callee) const;<br>
   bool isEmAsmCall(Module &M, const Value *Callee) const;<br>
<br>
@@ -276,7 +276,7 @@ class WebAssemblyLowerEmscriptenEHSjLj final : public ModulePass {<br>
<br>
   WebAssemblyLowerEmscriptenEHSjLj(bool EnableEH = true, bool EnableSjLj = true)<br>
       : ModulePass(ID), EnableEH(EnableEH), EnableSjLj(EnableSjLj) {<br>
-    EHWhitelistSet.insert(EHWhitelist.begin(), EHWhitelist.end());<br>
+    EHAllowlistSet.insert(EHAllowlist.begin(), EHAllowlist.end());<br>
   }<br>
   bool runOnModule(Module &M) override;<br>
<br>
@@ -746,7 +746,7 @@ bool WebAssemblyLowerEmscriptenEHSjLj::runEHOnFunction(Function &F) {<br>
   SmallVector<Instruction *, 64> ToErase;<br>
   SmallPtrSet<LandingPadInst *, 32> LandingPads;<br>
   bool AllowExceptions = areAllExceptionsAllowed() ||<br>
-                         EHWhitelistSet.count(std::string(F.getName()));<br>
+                         EHAllowlistSet.count(std::string(F.getName()));<br>
<br>
   for (BasicBlock &BB : F) {<br>
     auto *II = dyn_cast<InvokeInst>(BB.getTerminator());<br>
<br>
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp<br>
index e2a9231065e0..c5debd6ef7a8 100644<br>
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp<br>
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp<br>
@@ -23087,7 +23087,7 @@ SDValue X86TargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {<br>
       Op1.getOpcode() == ISD::TRUNCATE && Op2.getOpcode() == ISD::TRUNCATE) {<br>
     SDValue T1 = Op1.getOperand(0), T2 = Op2.getOperand(0);<br>
     if (T1.getValueType() == T2.getValueType() &&<br>
-        // Blacklist CopyFromReg to avoid partial register stalls.<br>
+        // Exclude CopyFromReg to avoid partial register stalls.<br>
         T1.getOpcode() != ISD::CopyFromReg && T2.getOpcode()!=ISD::CopyFromReg){<br>
       SDValue Cmov = DAG.getNode(X86ISD::CMOV, DL, T1.getValueType(), T2, T1,<br>
                                  CC, Cond);<br>
<br>
diff  --git a/llvm/test/CodeGen/WebAssembly/lower-em-exceptions-whitelist.ll b/llvm/test/CodeGen/WebAssembly/lower-em-exceptions-allowed.ll<br>
similarity index 98%<br>
rename from llvm/test/CodeGen/WebAssembly/lower-em-exceptions-whitelist.ll<br>
rename to llvm/test/CodeGen/WebAssembly/lower-em-exceptions-allowed.ll<br>
index ce33a9f4b455..de6d2205e31c 100644<br>
--- a/llvm/test/CodeGen/WebAssembly/lower-em-exceptions-whitelist.ll<br>
+++ b/llvm/test/CodeGen/WebAssembly/lower-em-exceptions-allowed.ll<br>
@@ -1,4 +1,4 @@<br>
-; RUN: opt < %s -wasm-lower-em-ehsjlj -emscripten-cxx-exceptions-whitelist=do_catch -S | FileCheck %s<br>
+; RUN: opt < %s -wasm-lower-em-ehsjlj -emscripten-cxx-exceptions-allowed=do_catch -S | FileCheck %s<br>
<br>
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"<br>
 target triple = "wasm32-unknown-unknown"<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>