[llvm] [InstCombine] Use constant 64-bit indices for CreateExtractElement (NFC) (PR #208306)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 13:46:59 PDT 2026


================
@@ -3569,9 +3569,9 @@ Instruction *InstCombinerImpl::foldICmpBitCast(ICmpInst &Cmp) {
         // Fold the icmp based on the value of C
         // If C is M copies of an iK sized bit pattern,
         // then:
-        //   =>  %E = extractelement <N x iK> %vec, i32 Elem
+        //   =>  %E = extractelement <N x iK> %vec, i64 Elem
         //       icmp <pred> iK %SplatVal, <pattern>
-        Value *Elem = Builder.getInt32(Mask[0]);
+        Value *Elem = Builder.getInt64(Mask[0]);
         Value *Extract = Builder.CreateExtractElement(Vec, Elem);
----------------
nikic wrote:

```suggestion
        Value *Extract = Builder.CreateExtractElement(Vec, Mask[0]);
```
Could also use the overload that does the getInt64() internally?

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


More information about the llvm-commits mailing list