[compiler-rt] [llvm] [WebAssembly] Explicitly set `getCmpLibcallReturnType` to i32 (PR #192425)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 08:58:59 PDT 2026


================
@@ -29,6 +29,11 @@ class WebAssemblyTargetLowering final : public TargetLowering {
   MVT getPointerTy(const DataLayout &DL, uint32_t AS = 0) const override;
   MVT getPointerMemTy(const DataLayout &DL, uint32_t AS = 0) const override;
 
+  MVT::SimpleValueType getCmpLibcallReturnType() const override {
+    // i32 may be more efficient than the default word size for wasm64 targets
+    return MVT::i32;
----------------
sbc100 wrote:

But doesn't the base class already default to returning `i32`?   i.e. this override isn't doing anything is it?

See: 
https://github.com/llvm/llvm-project/blob/547197d200cbaf7b24b9f14c756310e3b60c8850/llvm/lib/CodeGen/TargetLoweringBase.cpp#L1962-L1964


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


More information about the llvm-commits mailing list