[llvm] [ValueTracking] Support non-constant idx for `computeKnownFPClass` of `insertelement` (PR #87708)

via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 6 12:59:55 PDT 2024


================
@@ -5355,14 +5355,17 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
     const Value *Vec = Op->getOperand(0);
     const Value *Elt = Op->getOperand(1);
     auto *CIdx = dyn_cast<ConstantInt>(Op->getOperand(2));
-    // Early out if the index is non-constant or out-of-range.
     unsigned NumElts = DemandedElts.getBitWidth();
-    if (!CIdx || CIdx->getValue().uge(NumElts))
-      return;
+    APInt DemandedVecElts = DemandedElts;
+    bool NeedsElt = true;
+    // If we know the index we are inserting too, clear it from Vec check.
----------------
goldsteinn wrote:

Will update before pushing.

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


More information about the llvm-commits mailing list