mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Fix Transforms/InstCombine/2006-02-07-SextZextCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26040 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
78ee0added
commit
d89d888cc5
@ -563,10 +563,12 @@ bool InstCombiner::SimplifyDemandedBits(Value *V, uint64_t Mask,
|
||||
// extend instead of a sign extend.
|
||||
if ((Mask & ((1ULL << SrcBits)-1)) == 0) {
|
||||
// Convert to unsigned first.
|
||||
Value *NewVal;
|
||||
Instruction *NewVal;
|
||||
NewVal = new CastInst(I->getOperand(0), SrcTy->getUnsignedVersion(),
|
||||
I->getOperand(0)->getName(), I);
|
||||
NewVal = new CastInst(I->getOperand(0), I->getType(), I->getName());
|
||||
I->getOperand(0)->getName());
|
||||
InsertNewInstBefore(NewVal, *I);
|
||||
NewVal = new CastInst(NewVal, I->getType(), I->getName());
|
||||
InsertNewInstBefore(NewVal, *I);
|
||||
return UpdateValueUsesWith(I, NewVal);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user