[PATCH] D76339: [GlobalISel] Port some basic undef combines from DAGCombiner.cpp

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 17 19:28:02 PDT 2020


paquette created this revision.
paquette added reviewers: aemerson, dsanders, arsenm.
Herald added subscribers: danielkiss, volkan, hiraditya, kristof.beyls, rovka, wdng.

This ports some combines from DAGCombiner.cpp which perform some trivial transformations on instructions with undef operands.

e.g.

  (mul x, undef) -> 0
  (or x, undef) -> -1
  (xor x, undef) -> undef

and so on.

Not having these can make it extremely annoying to find out where we differ from SelectionDAG by looking at existing lit tests. Without them, we tend to produce pretty bad code generation when we run into instructions which use undef operands.

Also remove the `nonpow2_store_narrowing testcase` from arm64-fallback.ll, since we no longer fall back on the add.


https://reviews.llvm.org/D76339

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
  llvm/include/llvm/Target/GlobalISel/Combine.td
  llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
  llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-undef.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76339.250963.patch
Type: text/x-patch
Size: 10372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200318/4bc15ed5/attachment.bin>


More information about the llvm-commits mailing list