[PATCH] D95286: [LSR] Drop potentially invalid nowrap flags when switching to post-inc IV (PR46943)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 24 13:07:51 PST 2021


nikic added inline comments.


================
Comment at: test/Transforms/LoopStrengthReduce/X86/pr46943.ll:48
 ; CHECK-NEXT:    call void @use(i8 [[IV]])
-; CHECK-NEXT:    [[IV_NEXT]] = add nsw i8 [[IV]], -1
+; CHECK-NEXT:    [[IV_NEXT]] = add i8 [[IV]], -1
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i8 [[IV_NEXT]], 127
----------------
fhahn wrote:
> Is this transform actually still helpful, if we have to drop flags to do it?
As LSR runs in the backend, and the backend makes rather little use of nowrap flags, I would assume so. When we did the same change in LFTR (which runs in the middle of the pipeline where nowrap flags are more important), I don't think any performance regressions were reported.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95286



More information about the llvm-commits mailing list