diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-29 11:40:47 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-29 11:40:47 -0800 |
commit | 1b7c5897ec33d2439408a2f813b2f8e166cc6bcc (patch) | |
tree | bec0e1656dab81c2eadcfc382fdd84421da2789e /lib/Transforms | |
parent | bc9762214128743353e01a4115f9824a9a70ecc5 (diff) |
fix store on >64 bits
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/NaCl/ExpandI64.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/NaCl/ExpandI64.cpp b/lib/Transforms/NaCl/ExpandI64.cpp index 22cd917f30..749557ec24 100644 --- a/lib/Transforms/NaCl/ExpandI64.cpp +++ b/lib/Transforms/NaCl/ExpandI64.cpp @@ -748,10 +748,12 @@ void ExpandI64::finalizeInst(Instruction *I) { } case Instruction::Store: case Instruction::Ret: { - // generic fix of an instruction with one 64-bit input, and consisting of two legal instructions, for low and high + // generic fix of an instruction with one illegal input in operand 0, and consisting of legal instructions ChunksVec Chunks = getChunks(I->getOperand(0)); - Split.ToFix[0]->setOperand(0, Chunks[0]); - Split.ToFix[1]->setOperand(0, Chunks[1]); + int Num = getNumChunks(I->getOperand(0)->getType()); + for (int i = 0; i < Num; i++) { + Split.ToFix[i]->setOperand(0, Chunks[i]); + } break; } case Instruction::BitCast: { |