[PATCH] Transform C - zext(bool) -> bool ? C - 1 : C

David Majnemer david.majnemer at gmail.com
Fri Jul 12 16:03:15 PDT 2013


The attached patch essentially reverts r159230.

The reasons why are because:
1. It creates an asymmetry in the IR by hurting our ability to canonicalize
things like C - zext(X) and C + zext(!X) into the same thing.
2. Adding it back does not break any tests and without it we still generate
the inferior code mentioned in the commit log.

It seems like we should keep the canonicalization and fix (the apparently
still broken problem) in the lowering stage.
The commit mentioned that some targets don't have a sext i1. This shouldn't
be a concern at the IR level, should it?

-- 
David Majnemer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130712/3f676ece/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subzext.diff
Type: application/octet-stream
Size: 1259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130712/3f676ece/attachment.obj>


More information about the llvm-commits mailing list