[PATCH] D28176: [GlobalISel] Add support for switch statements

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 16:12:42 PST 2017


qcolombet accepted this revision.
qcolombet added a comment.
This revision is now accepted and ready to land.

Hi Kristof,

LGTM modulo formatting and an additional test case.
No need for another round of review.

Cheers,
-Quentin



================
Comment at: lib/CodeGen/GlobalISel/IRTranslator.cpp:229
+  LLT LLTi1 = LLT(*Type::getInt1Ty(U.getContext()), *DL);
+  for(auto& CaseIt: SwInst.cases()) {
+    const unsigned CaseValueReg = getOrCreateVReg(*CaseIt.getCaseValue());
----------------
The formatting looks strange here: auto& vs. auto &.

Make sure to run clang-format.


================
Comment at: test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll:179
+default:
+  %0 = add i32 %argc, 0
+  br label %return
----------------
Please use explicit variables (i.e., no %[0-9]+ ones).
You can use `opt -instnamer` for that.


================
Comment at: test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll:191
+
+
 ; Tests for or.
----------------
Could you add a test case with more than one case in the switch?


https://reviews.llvm.org/D28176





More information about the llvm-commits mailing list