[llvm-dev] How do I prevent DAGCombiner from combining ZExt/SExt(load) into LoadZExt?

Zhang via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 5 19:51:28 PST 2021


In our toy ISA, we don't have a dedicated ZExtLoad instruction. However DAGCombiner tends to combine ZERO_EXTEND(LOAD) into a LoadZExt node which can't be trivially selected:


```
Combining: t5: i32 = zero_extend t4
Creating new node: t9: i32,ch = load<(dereferenceable load 1 from %ir.2), zext from i1> t0, FrameIndex:i64<0>, undef:i64

```


Reading through the implementation of ``tryToFoldExtOfLoad`` is still equally confusing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210106/fc7fcc67/attachment.html>


More information about the llvm-dev mailing list