6 Commits

Author SHA1 Message Date
Thorsten Schütt
ba4bcce5f5
[GlobalIsel] Combine trunc of binop (#107721)
trunc (binop X, C) --> binop (trunc X, trunc C)  --> binop (trunc X, C`)

Try to narrow the width of math or bitwise logic instructions by pulling
a truncate ahead of binary operators.

Vx and Nx cores consider 32-bit and 64-bit basic arithmetic equal in
costs.
2024-09-11 15:04:55 +02:00
Thorsten Schütt
0b0ccd56c9
[GlobalIsel] Push cast through build vector (#104634)
Credits: https://github.com/llvm/llvm-project/pull/100563
2024-08-21 10:10:36 +02:00
Thorsten Schütt
710a552ded
[GlobalIsel] Revisit ext of ext. (#102769)
Credits:
https://reviews.llvm.org/D86516

combine-ext.mir

Notable semantic changes:
InstCombine does not mix zero and sign extend,
  see CastInst::isEliminableCastPair.
New version has legality checks.
Folds sext/zext of anyext -> sext/zext
Support for nneg

Future work:
nneg zext of sext -> sext
sext of nneg zext -> sext
2024-08-16 15:38:56 +02:00
Thorsten Schütt
db8c84fc7a
[GlobalIsel] Push cast through select. (#100539) 2024-07-25 19:21:28 +02:00
Thorsten Schütt
bfcfb0fd2d
[GlobalIsel] Modernize truncate of ext. (#100338)
Credits:
https://github.com/llvm/llvm-project/pull/90964
https://reviews.llvm.org/D87050

combine-trunc.mir

Functional changes intended.
2024-07-24 22:13:52 +02:00
Thorsten Schütt
2ca300f914
[GlobalIsel][NFC] Move cast code (#100196)
Preparation for more cast combines
2024-07-24 06:33:11 +02:00