Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: src/IceInst.cpp

Issue 1215443002: Fixes bug on conditional branch where the targets are the same. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===// 1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements the Inst class, primarily the various 10 // This file implements the Inst class, primarily the various
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 InstAssign::InstAssign(Cfg *Func, Variable *Dest, Operand *Source) 264 InstAssign::InstAssign(Cfg *Func, Variable *Dest, Operand *Source)
265 : InstHighLevel(Func, Inst::Assign, 1, Dest) { 265 : InstHighLevel(Func, Inst::Assign, 1, Dest) {
266 addSource(Source); 266 addSource(Source);
267 } 267 }
268 268
269 // If TargetTrue==TargetFalse, we turn it into an unconditional 269 // If TargetTrue==TargetFalse, we turn it into an unconditional
270 // branch. This ensures that, along with the 'switch' instruction 270 // branch. This ensures that, along with the 'switch' instruction
271 // semantics, there is at most one edge from one node to another. 271 // semantics, there is at most one edge from one node to another.
272 InstBr::InstBr(Cfg *Func, Operand *Source, CfgNode *TargetTrue, 272 InstBr::InstBr(Cfg *Func, Operand *Source, CfgNode *TargetTrue_,
273 CfgNode *TargetFalse) 273 CfgNode *TargetFalse_)
274 : InstHighLevel(Func, Inst::Br, 1, nullptr), TargetFalse(TargetFalse), 274 : InstHighLevel(Func, Inst::Br, 1, nullptr), TargetFalse(TargetFalse_),
275 TargetTrue(TargetTrue) { 275 TargetTrue(TargetTrue_) {
John 2015/06/25 21:15:35 the trailing _ is a great way to differentiate mem
Jim Stichnoth 2015/06/25 21:26:29 I'm very sad that clang didn't give any warnings a
Karl 2015/06/25 22:33:42 Leaving as is, assuming that Jim will follow throu
276 if (TargetTrue == TargetFalse) { 276 if (TargetTrue == TargetFalse) {
277 TargetTrue = nullptr; // turn into unconditional version 277 TargetTrue = nullptr; // turn into unconditional version
278 } else { 278 } else {
279 addSource(Source); 279 addSource(Source);
280 } 280 }
281 } 281 }
282 282
283 InstBr::InstBr(Cfg *Func, CfgNode *Target) 283 InstBr::InstBr(Cfg *Func, CfgNode *Target)
284 : InstHighLevel(Func, Inst::Br, 0, nullptr), TargetFalse(Target), 284 : InstHighLevel(Func, Inst::Br, 0, nullptr), TargetFalse(Target),
285 TargetTrue(nullptr) {} 285 TargetTrue(nullptr) {}
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 // preserve these. 933 // preserve these.
934 return true; 934 return true;
935 } 935 }
936 if (!Dest->hasReg() && !SrcVar->hasReg() && 936 if (!Dest->hasReg() && !SrcVar->hasReg() &&
937 Dest->getStackOffset() == SrcVar->getStackOffset()) 937 Dest->getStackOffset() == SrcVar->getStackOffset())
938 return true; 938 return true;
939 return false; 939 return false;
940 } 940 }
941 941
942 } // end of namespace Ice 942 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/cond-br-same-target.ll » ('j') | tests_lit/llvm2ice_tests/cond-br-same-target.ll » ('J')

Powered by Google App Engine
This is Rietveld 408576698