[PATCH] D24924: [PPC] Better codegen for AND, ANY_EXT, SRL sequence

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 10:41:41 PDT 2016


hfinkel added a comment.

Alternatively, we might teach the BitPermutationSelector to look through extends, which would be more general. Had you looked at that?


================
Comment at: lib/Target/PowerPC/PPCISelDAGToDAG.cpp:2647
@@ +2646,3 @@
+
+        Val = SDValue(CurDAG->getMachineNode(PPC::INSERT_SUBREG, dl, ResultType,
+                      IDVal, Op0.getOperand(0), getI32Imm(1, dl)), 0);
----------------
We shouldn't speculatively create new nodes if we can avoid it.

================
Comment at: test/CodeGen/PowerPC/anyext_srl.ll:1
@@ +1,2 @@
+; RUN: llc -verify-machineinstrs -mcpu=pwr8 < %s | FileCheck %s
+
----------------
You need an architecture or a triple here too.

================
Comment at: test/CodeGen/PowerPC/anyext_srl.ll:24
@@ +23,3 @@
+
+!0 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 7981b20f318488a10e7c0c8e0f0ca502e02e74cd) (http://llvm.org/git/llvm.git 3b621275428532a32a2806585282fa025af2d241)"}
+!1 = !{!2, !2, i64 0}
----------------
amehsan wrote:
> I should probably remove this line :)
Yes, although if you keep the cpu attribute here, you don't need it on the command line.


https://reviews.llvm.org/D24924





More information about the llvm-commits mailing list