[llvm] [WebAssembly,llvm] Add llvm.wasm.ref.test.func intrinsic, option 2 (PR #147486)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 06:11:15 PDT 2025


================
@@ -402,7 +402,12 @@ void InstrEmitter::AddOperand(MachineInstrBuilder &MIB, SDValue Op,
     AddRegisterOperand(MIB, Op, IIOpNum, II, VRBaseMap,
                        IsDebug, IsClone, IsCloned);
   } else if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
-    MIB.addImm(C->getSExtValue());
+    if (C->getAPIntValue().getBitWidth() <= 64) {
----------------
RKSimon wrote:

It allows you to match large bitwidth APInt that can still be represented by a int64_t - I've found it useful to get rid of large APInt values whenever I can, but I wasn't sure whether you should in this context - no problem if you don't want to do it.

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


More information about the llvm-commits mailing list