[PATCH] D104932: [instcombine] Fold overflow check using overflow intrinsic to comparison

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 30 08:06:50 PDT 2021


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3119
       // TODO: Handle vector splats.
       switch (WO->getIntrinsicID()) {
       default:
----------------
Why are we leaving this code in? Is there some pattern that would escape the new proposed block, but still be caught by this?


================
Comment at: llvm/test/Transforms/InstCombine/ssubo.ll:59
 
 define i1 @test_constant4(i8 %a) {
 ; CHECK-LABEL: @test_constant4(
----------------
I focused in on this example, and we are missing a fold:
https://alive2.llvm.org/ce/z/EfBUXP

Does that hold for all of the overflow ops? Could we produce the optimal icmp directly (no add with constant necessary)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104932



More information about the llvm-commits mailing list