[all-commits] [llvm/llvm-project] 5e587b: [RISCV] Lower (setugt X, 2047) as (setne (srl X, 1...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Aug 26 23:06:03 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5e587b1b15feccf70a950d17ad37e3c361a9f198
      https://github.com/llvm/llvm-project/commit/5e587b1b15feccf70a950d17ad37e3c361a9f198
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2025-08-26 (Tue, 26 Aug 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/i32-icmp.ll
    M llvm/test/CodeGen/RISCV/i64-icmp.ll

  Log Message:
  -----------
  [RISCV] Lower (setugt X, 2047) as (setne (srl X, 11), 0) (#155541)

This matches 4095 and other pow2-1 constants larger simm12. We normally
do this through a DAGCombine controlled by isLegalICmpImmediate. 2047 is
considered a legal immediate because we have a setult instruction. In
this case we have setugt which isn't natively supported.

I added tests for 4095 for comparison.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list