[PATCH] D37017: [DAGCombiner] fold assertzexts separated by trunc
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 1 11:36:03 PDT 2017
spatel added a comment.
In https://reviews.llvm.org/D37017#849272, @aivchenk wrote:
> - Should we implement the same idea for AssertSext?
Yes, we should. But after discovering that this code almost already exists in the Mips backend, I'd like to make that a small follow-up just to reduce the patch size and risk.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7925
+ EVT BigAZVT = cast<VTSDNode>(BigAZ.getOperand(1))->getVT();
+ if (AssertVT.getSizeInBits() < BigAZVT.getSizeInBits()) {
+ SDLoc DL(N);
----------------
aaboud wrote:
> What about the other case:
> assert (trunc (assert X, i1) to iN), i8 --> trunc (assert X, i1) to iN
>
> Do not we want to cover this as well?
> Or we are sure that such case will never occur?
I haven't seen that occur yet, but since it's easy to handle, I'll make the fold more general.
https://reviews.llvm.org/D37017
More information about the llvm-commits
mailing list