[PATCH] D34923: [X86] Add comment string for broadcast loads from the constant pool.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 1 07:03:50 PDT 2017


spatel added inline comments.


================
Comment at: lib/Target/X86/X86MCInstLower.cpp:1863-1867
+      switch (MI->getOpcode()) {
+      default: llvm_unreachable("Invalid opcode");
+      case X86::VBROADCASTSSrm:    NumElts = 4;  break;
+      case X86::VBROADCASTSSYrm:   NumElts = 8;  break;
+      case X86::VBROADCASTSSZ128m: NumElts = 4;  break;
----------------
Could set NumElts above and then fall-through to avoid the switch-within-a-switch? Same for NumLanes below here.


================
Comment at: lib/Target/X86/X86MCInstLower.cpp:1905-1909
+        } else if (auto *CI = dyn_cast<ConstantInt>(C)) {
+          if (CI->getBitWidth() <= 64) {
+            CS << CI->getZExtValue();
+          } else {
+            // print multi-word constant as (w0,w1)
----------------
Make a helper function, so we're not duplicating so much code?


================
Comment at: test/CodeGen/X86/broadcast-elm-cross-splat-vec.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; NOTE: Assertions have been autogenerated utils/update_llc_test_checks.py
 ; RUN: llc < %s -mtriple=i686-unknown -mattr=+avx | FileCheck %s --check-prefix=AVX
----------------
Extra/stale comment line.


https://reviews.llvm.org/D34923





More information about the llvm-commits mailing list