[PATCH] D12703: [InstCombine] Optimize icmp slt signum(x), 1 --> icmp sle x, 0.
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 21:27:03 PDT 2015
sanjoy updated this revision to Diff 34295.
sanjoy added a comment.
I changed the patternmatch to use to use `getScalarSizeInBits`, but
that does not work with vectors as-is since
`visitICmpInstWithInstAndIntCst` only looks at `ConstantInt`s and not
`ConstantVector`s. I'm slightly hesitant to add untested code like
this, but given that this is at least partially tested (via the scalar
tests), I'm fine with checking this in if you are.
http://reviews.llvm.org/D12703
Files:
include/llvm/IR/PatternMatch.h
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/compare-signs.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12703.34295.patch
Type: text/x-patch
Size: 4273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150909/b0adc10b/attachment.bin>
More information about the llvm-commits
mailing list