[PATCH] D57401: [DAGCombiner] fold add/sub with bool operand based on target's boolean contents

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 30 11:16:21 PST 2019


efriedma added inline comments.


================
Comment at: test/CodeGen/PowerPC/select_const.ll:268-269
 }
 
+; FIXME: This could be addi 3, 3, 42
+
----------------
spatel wrote:
> efriedma wrote:
> > This looks like a missing target-independent pattern; we're ending up with something like "42 - (cond & 1)" instead of "42 + cond".
> Yes, we're missing a generic combine here, but I thought we had the 1 you mentioned. Ie, if I saw it correctly while glancing at it the first time, this requires an AssertSext to uncover. 
> 
> I'll have a closer look to avoid this, but I figured the other diffs were more realistic, so we might want to commit this patch first if it looks reasonable.
If the issue is actually just a missing combine for "X - (Y & 1)", where Y is a 0/-1 value, I'm fine with temporarily regressing it.  But please confirm the DAG actually looks like that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57401/new/

https://reviews.llvm.org/D57401





More information about the llvm-commits mailing list