[PATCH] D54170: [InstCombine][SelectionDAG][AArch64] fold gep into select to enable speculation of load

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 12:12:44 PST 2018


efriedma added a comment.

This looks like a bunch of separate changes which should be split into multiple patches.  Especially the changes to DAGCombine and InstCombiner::visitZExt .



================
Comment at: test/Transforms/InstCombine/gep-select.ll:29
+  %sel = select i1 %cmp, i32* %gep1, i32* %gep2
+  %ld = load i32, i32* %sel, align 4
+  ret i32 %ld
----------------
I'm pretty sure this isn't safe, in general.  The "inbounds" marker only guarantees that the arithmetic is in bounds; it doesn't make any guarantees about the type of the pointer.


https://reviews.llvm.org/D54170





More information about the llvm-commits mailing list