[PATCH] D70372: [InstCombine] Disable insertRangeTest() optimization for BPF target

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 05:29:59 PST 2019


spatel requested changes to this revision.
spatel added a comment.
This revision now requires changes to proceed.

I can't tell exactly what the motivation is from the description, but there are 2 major problems with this patch:

1. Disabling a transform does not solve the problem completely. If the source was written in the form that you do not want, you would want the reverse transform to produce the desired IR/asm.
2. By design, instcombine is a target-independent canonicalization pass. Adding the use of TTI defeats that goal.

There are (at least) 2 possible alternatives if you are determined to change this in the compiler rather than change the source code:

1. Reverse the existing transform for all targets (this will be very difficult to justify if the transform that you are hoping to disable results in fewer IR instructions).
2. Reverse the existing transform for BPF in a later pass (most likely candidates are DAGCombiner or CodeGenPrepare).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70372





More information about the llvm-commits mailing list