[PATCH] D58877: [InstCombine] fold add(add(A, ~B), 1) -> sub(A, B)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 3 06:01:20 PST 2019


spatel added inline comments.


================
Comment at: test/Transforms/InstCombine/add.ll:954
-; CHECK-NEXT:    [[C:%.*]] = xor i32 [[B:%.*]], -1
-; CHECK-NEXT:    [[D:%.*]] = add i32 [[C]], [[A:%.*]]
-; CHECK-NEXT:    [[E:%.*]] = add i32 [[D]], 1
----------------
This is not testing what you expected. The operands are getting commuted independently of this patch, so it's effectively the same test as the next one. Grep for "thwart" in the instcombine regression test dir to see some options to work around that.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58877





More information about the llvm-commits mailing list