[llvm] [TargetLowering] Deduplicate choosing InlineAsm constraint between ISels (PR #67057)

Nick Desaulniers via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 08:37:49 PDT 2023


================
@@ -207,7 +142,16 @@ static void computeConstraintToUse(const TargetLowering *TLI,
     OpInfo.ConstraintCode = OpInfo.Codes[0];
     OpInfo.ConstraintType = TLI->getConstraintType(OpInfo.ConstraintCode);
   } else {
-    chooseConstraint(OpInfo, TLI);
+    TargetLowering::ConstraintGroup G = TLI->getConstraintPreferences(OpInfo);
+    if (G.empty())
+      return;
+    // FIXME: prefer immediate constraints if the target allows it
+    unsigned BestIdx = 0;
+    while (G[BestIdx].second == TargetLowering::C_Other ||
+           G[BestIdx].second == TargetLowering::C_Immediate)
----------------
nickdesaulniers wrote:

https://github.com/llvm/llvm-project/pull/67057/commits/a0cb4cb60f3ee83876929a152ed0a11abe34fe6c

https://github.com/llvm/llvm-project/pull/67057


More information about the llvm-commits mailing list