mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
ConstantFold, InstSimplify: undef >>a x can be either -1 or 0, choose 0
Zero is usually a nicer constant to have than -1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223969 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -960,8 +960,9 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
|
||||
// X >>a undef -> undef
|
||||
if (isa<UndefValue>(C2))
|
||||
return C2;
|
||||
// undef >>a X -> all ones
|
||||
return Constant::getAllOnesValue(C1->getType());
|
||||
// TODO: undef >>a X -> undef if the shift is exact
|
||||
// undef >>a X -> 0
|
||||
return Constant::getNullValue(C1->getType());
|
||||
case Instruction::Shl:
|
||||
// X << undef -> undef
|
||||
if (isa<UndefValue>(C2))
|
||||
|
Reference in New Issue
Block a user