summaryrefslogtreecommitdiff
path: root/llvm/lib/IRReader
diff options
context:
space:
mode:
authorMatthias Braun <matthiasb@fb.com>2021-09-27 17:57:22 -0700
committerMatthias Braun <matze@braunis.de>2022-01-11 09:07:29 -0800
commitad25f8a556d239d8b7d17383cf1a0771359521fd (patch)
tree93eb034f7cbf67f9f4a294b10f8955c077c2eff7 /llvm/lib/IRReader
parentbe1cc64cc13cb24bcd9ed097925a140d74beaa45 (diff)
downloadllvm-optimize_compinstr_fix.tar.gz
X86InstrInfo: Support immediates that are +1/-1 different in optimizeCompareInstroptimize_compinstr_fix
This is a re-commit of e2c7ee0743592e39274e28dbe0d0c213ba342317 which was reverted in a2a58d91e82db38fbdf88cc317dcb3753d79d492 and ea81cea8163a1a0e54df42103ee1c657bbf03791. This includes a fix to consistently check for EFLAGS being live-out. See phabricator review. Original Summary: This extends `optimizeCompareInstr` to re-use previous comparison results if the previous comparison was with an immediate that was 1 bigger or smaller. Example: CMP x, 13 ... CMP x, 12 ; can be removed if we change the SETg SETg ... ; x > 12 changed to `SETge` (x >= 13) removing CMP Motivation: This often happens because SelectionDAG canonicalization tends to add/subtract 1 often when optimizing for fallthrough blocks. Example for `x > C` the fallthrough optimization switches true/false blocks with `!(x > C)` --> `x <= C` and canonicalization turns this into `x < C + 1`. Differential Revision: https://reviews.llvm.org/D110867
Diffstat (limited to 'llvm/lib/IRReader')
0 files changed, 0 insertions, 0 deletions