[all-commits] [llvm/llvm-project] 57bf08: [PowerPC] simplify the asm of scmp builtin (#200024)

zhijian lin via All-commits all-commits at lists.llvm.org
Fri Sep 11 06:20:40 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 57bf08dc0f318ce50e6c9fdc0d7c9e770f247ee8
      https://github.com/llvm/llvm-project/commit/57bf08dc0f318ce50e6c9fdc0d7c9e770f247ee8
  Author: zhijian lin <zhijian at ca.ibm.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    M llvm/lib/Target/PowerPC/PPCISelLowering.h
    M llvm/test/CodeGen/PowerPC/scmp.ll

  Log Message:
  -----------
  [PowerPC] simplify the asm of scmp builtin (#200024)

for the IR 
```
define noundef signext range(i32 -1, 2) i32 @test_scmp(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
  %cond2 = tail call i32 @llvm.scmp.i32.i64(i64 %a, i64 %b)
  ret i32 %cond2
} 
```

when compile -mcpu=pwr8 and 64bit 
it generated as asm following orginal 

        sradi 5, 4, 63
        rldicl 6, 3, 1, 63
        subc    7, 4, 3
        adde 5, 6, 5
        cmpd    3, 4
        li 3, -1
        xori 5, 5, 1
        isellt  3, 3, 5
        extsw 3, 3
        blr

the patch will let it generate as  
```
        cmpd 7, 3, 4
        mfocrf 3, 1
        rlwinm 4, 3, 30, 31, 31
        rlwinm 3, 3, 29, 31, 31
        sub     3, 4, 3
        blr
```



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