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

Trevor Gross via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 09:10:40 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;
----------------
tgross35 wrote:

Currently yes but that's something that should change. This is just making the wasm choice explicit before that happens since (afaik) wasm64 is the only one to hit the case where i32 and a word have an incompatible ABI, aside from those with overrides in GCC.

I'm planning to follow up with https://github.com/llvm/llvm-project/pull/192441

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


More information about the llvm-commits mailing list