This helps to preserve NSW flags of sext(sub) expressions by trying to push the sign extension onto the operands of a sext instruction.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Sorry for the delay, this one somehow slipped through the cracks.
lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
5966 | Can you please use MatchBinaryOp here? That'll catch more cases than a literal sub instruction. |
test/Analysis/ScalarEvolution/flags-from-poison.ll | ||
---|---|---|
612 | I see the code in MatchBinaryOperator doesn't seem to check for guard edges of the ssub_with_overflow intrinsic's overflow return value like it does for sadd_with_overflow. Is there a reason why it doesn't do that, if not I'll go and add support for it. Without that modification it looks like intrinsic test case won't work. |
test/Analysis/ScalarEvolution/flags-from-poison.ll | ||
---|---|---|
612 |
I don't think there was any reason beyond that that code would not be exercised (but this patch changes that); please go ahead with the implementation. |
Can you please use MatchBinaryOp here? That'll catch more cases than a literal sub instruction.