mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Fix bug where ReduceLoadWidth was creating illegal ZEXTLOAD instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e85dcb54d1
commit
4e3740ee6d
@ -4244,8 +4244,6 @@ SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) {
|
|||||||
if (Opc == ISD::SIGN_EXTEND_INREG) {
|
if (Opc == ISD::SIGN_EXTEND_INREG) {
|
||||||
ExtType = ISD::SEXTLOAD;
|
ExtType = ISD::SEXTLOAD;
|
||||||
ExtVT = cast<VTSDNode>(N->getOperand(1))->getVT();
|
ExtVT = cast<VTSDNode>(N->getOperand(1))->getVT();
|
||||||
if (LegalOperations && !TLI.isLoadExtLegal(ISD::SEXTLOAD, ExtVT))
|
|
||||||
return SDValue();
|
|
||||||
} else if (Opc == ISD::SRL) {
|
} else if (Opc == ISD::SRL) {
|
||||||
// Another special-case: SRL is basically zero-extending a narrower value.
|
// Another special-case: SRL is basically zero-extending a narrower value.
|
||||||
ExtType = ISD::ZEXTLOAD;
|
ExtType = ISD::ZEXTLOAD;
|
||||||
@ -4255,6 +4253,8 @@ SDValue DAGCombiner::ReduceLoadWidth(SDNode *N) {
|
|||||||
ExtVT = EVT::getIntegerVT(*DAG.getContext(),
|
ExtVT = EVT::getIntegerVT(*DAG.getContext(),
|
||||||
VT.getSizeInBits() - N01->getZExtValue());
|
VT.getSizeInBits() - N01->getZExtValue());
|
||||||
}
|
}
|
||||||
|
if (LegalOperations && !TLI.isLoadExtLegal(ExtType, ExtVT))
|
||||||
|
return SDValue();
|
||||||
|
|
||||||
unsigned EVTBits = ExtVT.getSizeInBits();
|
unsigned EVTBits = ExtVT.getSizeInBits();
|
||||||
|
|
||||||
|
10
test/CodeGen/XCore/2011-01-31-DAGCombineBug.ll
Normal file
10
test/CodeGen/XCore/2011-01-31-DAGCombineBug.ll
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
; RUN: llc < %s -march=xcore
|
||||||
|
%struct.st = type <{ i8, i32, i8, i32, i8, i32 }>
|
||||||
|
|
||||||
|
@x = external global %struct.st, align 4
|
||||||
|
|
||||||
|
define i32 @test_entry() nounwind {
|
||||||
|
entry:
|
||||||
|
%0 = load i32* getelementptr inbounds (%struct.st* @x, i32 0, i32 3), align 2
|
||||||
|
ret i32 %0
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user