[llvm] [X86, SimplifyCFG] Support hoisting load/store with conditional faulting (Part I) (PR #96878)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 09:35:56 PDT 2024


================
@@ -0,0 +1,86 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=x86_64 -mattr=+cf | FileCheck %s
+
+;; Test masked.load/store.v1* is generated in simplifycfg and not falls back to branch+load/store in following passes.
+define void @basic(i1 %cond, ptr %b, ptr %p, ptr %q) {
+; CHECK-LABEL: basic:
+; CHECK:       # %bb.0: # %entry
+; CHECK-NEXT:    andb $1, %dil
+; CHECK-NEXT:    negb %dil
+; CHECK-NEXT:    cfcmovnew (%rdx), %ax
+; CHECK-NEXT:    cfcmovnel (%rcx), %edi
+; CHECK-NEXT:    cfcmovneq (%rsi), %r8
+; CHECK-NEXT:    cfcmovnew %ax, (%rsi)
+; CHECK-NEXT:    cfcmovnel %edi, (%rdx)
+; CHECK-NEXT:    cfcmovneq %r8, (%rcx)
+; CHECK-NEXT:    retq
+entry:
+  br i1 %cond, label %if.true, label %if.false
+
+if.false:
+  br label %if.end
+
+if.true:
+  %0 = load i16, ptr %p, align 2
----------------
antoniofrighetto wrote:

Please give meaningful names to values.

https://github.com/llvm/llvm-project/pull/96878


More information about the llvm-commits mailing list