[PATCH] D154819: [LoongArch] Implement isZextFree

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 19:26:14 PDT 2023


SixWeining added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:3256
+  // Zexts are free if they can be combined with a load.
+  // Don't advertise i32->i64 zextload as being free for LA64. It interacts
+  // poorly with type legalization of compares preferring sext.
----------------
I'm not sure why we cannot do this. But seems that RISCV is the same.


================
Comment at: llvm/test/CodeGen/LoongArch/zext-with-load-is-free.ll:10
 
 define dso_local i32 @test_zext_i8() nounwind {
 ; LA32-LABEL: test_zext_i8:
----------------
Do you mind switching to a simpler program:
```
define zeroext i8 @test_zext_i8(ptr %p) nounwind {
  %a = load i8, ptr %p, align 1
  br label %exit
exit:
  ret i8 %a
}
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154819/new/

https://reviews.llvm.org/D154819



More information about the llvm-commits mailing list