[llvm] [WebAssembly][FastISel] Emit signed loads for sext of i8/i16/i32 (PR #182333)

via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 21 01:03:53 PST 2026


================
@@ -1281,23 +1281,54 @@ bool WebAssemblyFastISel::selectLoad(const Instruction *I) {
     return false;
 
   // TODO: Fold a following sign-/zero-extend into the load instruction.
+  // Fold sext(load)
+  const Value *Ext = nullptr;
+  MVT::SimpleValueType ExtVT = MVT::Other;
+  bool FoldExt = false;
+  if (Subtarget->hasSignExt() && Load->hasOneUse()) {
----------------
ParkHanbum wrote:

yes it was my miss. fixed it

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


More information about the llvm-commits mailing list