mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Implement instcombine/cast.ll:test16:
Canonicalize cast X to bool into a setne instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13736 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2e13cea896
commit
a710ddc9c4
@ -1996,6 +1996,11 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) {
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a cast to bool, turn it into the appropriate setne instruction.
|
||||
if (CI.getType() == Type::BoolTy)
|
||||
return BinaryOperator::create(Instruction::SetNE, CI.getOperand(0),
|
||||
Constant::getNullValue(CI.getOperand(0)->getType()));
|
||||
|
||||
// If casting the result of a getelementptr instruction with no offset, turn
|
||||
// this into a cast of the original pointer!
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user