summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-07-03 07:58:59 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-07-03 07:58:59 +0000
commita587ffe12de37b6552025053af0378e3b3e6d0a1 (patch)
tree878f50122a42a02e64a4cc07230302ba6d208469 /llvm/lib/Target/PIC16/PIC16ISelLowering.cpp
parent9db3e70056bb3d87a91f6b97ab99920c539986a8 (diff)
downloadbcm5719-llvm-a587ffe12de37b6552025053af0378e3b3e6d0a1.tar.gz
bcm5719-llvm-a587ffe12de37b6552025053af0378e3b3e6d0a1.zip
For extended loads of type i1 to i8, we will need to at least one byte from memory.
The change in the .td file is to mark the side effects of mov insn. llvm-svn: 74768
Diffstat (limited to 'llvm/lib/Target/PIC16/PIC16ISelLowering.cpp')
-rw-r--r--llvm/lib/Target/PIC16/PIC16ISelLowering.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp b/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp
index 3bb0164949a..0d24f61c49a 100644
--- a/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp
+++ b/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp
@@ -841,12 +841,16 @@ SDValue PIC16TargetLowering::ExpandLoad(SDNode *N, SelectionDAG &DAG) {
// i.e. without any extension
MVT MemVT = LD->getMemoryVT();
unsigned MemBytes = MemVT.getSizeInBits() / 8;
+ // if MVT::i1 is extended to MVT::i8 then MemBytes will be zero
+ // So set it to one
+ if (MemBytes == 0) MemBytes = 1;
+
unsigned ExtdBytes = VT.getSizeInBits() / 8;
Offset = DAG.getConstant(LoadOffset, MVT::i8);
Tys = DAG.getVTList(MVT::i8, MVT::Other);
// For MemBytes generate PIC16Load with proper offset
- for (iter=0; iter<MemBytes; ++iter) {
+ for (iter=0; iter < MemBytes; ++iter) {
// Add the pointer offset if any
Offset = DAG.getConstant(iter + LoadOffset, MVT::i8);
Load = DAG.getNode(PIC16ISD::PIC16Load, dl, Tys, Chain, PtrLo, PtrHi,
OpenPOWER on IntegriCloud