[NFC][InstCombine] Negator: add a comment about negating exact arithmentic shift

This commit is contained in:
Roman Lebedev 2020-08-06 21:07:45 +03:00
parent 442cb88f53
commit 47aec80e4a
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 4 additions and 0 deletions

View File

@ -184,6 +184,10 @@ LLVM_NODISCARD Value *Negator::visitImpl(Value *V, unsigned Depth) {
}
return BO;
}
// While we could negate exact arithmetic shift:
// ashr exact %x, C --> sdiv exact i8 %x, -1<<C
// iff C != 0 and C u< bitwidth(%x), we don't want to,
// because division is *THAT* much worse than a shift.
break;
}
case Instruction::SExt: