[PATCH] D135700: [DAGCombine] Simplify (truncate (build_pair x, y)) -> (truncate x) or x

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 00:31:05 PDT 2022


pengfei added inline comments.


================
Comment at: llvm/test/CodeGen/X86/test-shrink.ll:870
 ; CHECK-X86:       # %bb.0:
-; CHECK-X86-NEXT:    testw $-32768, {{[0-9]+}}(%esp) # imm = 0x8000
 ; CHECK-X86-NEXT:    js .LBB19_2
----------------
pengfei wrote:
> craig.topper wrote:
> > The IR here isn't canonical according to InstCombine so it's hard to say if this is a real regression or not.
> I see the tests are introduced for shrinking code fold:
> https://github.com/llvm/llvm-project/commit/42cd8cd8626a7f5eb14b0b43b866dd90bd33277b
> Does the code not work for i16 anymore, or we can use another test case?
It reduces one uop for non-minsize case, but increases 2 bytes for minsize case, which supposes to be degradation? https://godbolt.org/z/4v8z1sh1x


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135700



More information about the llvm-commits mailing list