[llvm] ff0122d - [PS5] Emit ud2 for ubsan trap

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 11:20:18 PDT 2022


Author: Paul Robinson
Date: 2022-06-16T11:20:10-07:00
New Revision: ff0122dccea88844bcdb669a4249923c7019046c

URL: https://github.com/llvm/llvm-project/commit/ff0122dccea88844bcdb669a4249923c7019046c
DIFF: https://github.com/llvm/llvm-project/commit/ff0122dccea88844bcdb669a4249923c7019046c.diff

LOG: [PS5] Emit ud2 for ubsan trap

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp
    llvm/test/CodeGen/X86/ubsantrap.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 5233d4bb874b..406f3f78a9ce 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -532,7 +532,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
 
   setOperationAction(ISD::TRAP, MVT::Other, Legal);
   setOperationAction(ISD::DEBUGTRAP, MVT::Other, Legal);
-  if (Subtarget.getTargetTriple().isPS4())
+  if (Subtarget.isTargetPS())
     setOperationAction(ISD::UBSANTRAP, MVT::Other, Expand);
   else
     setOperationAction(ISD::UBSANTRAP, MVT::Other, Legal);

diff  --git a/llvm/test/CodeGen/X86/ubsantrap.ll b/llvm/test/CodeGen/X86/ubsantrap.ll
index 5d53a5d5fc14..dbef12cba881 100644
--- a/llvm/test/CodeGen/X86/ubsantrap.ll
+++ b/llvm/test/CodeGen/X86/ubsantrap.ll
@@ -1,5 +1,6 @@
 ; RUN: llc -mtriple=x86_64-linux-gnu %s -o - | FileCheck %s
 ; RUN: llc -mtriple=x86_64-scei-ps4 %s -o - | FileCheck --check-prefix=PS4 %s
+; RUN: llc -mtriple=x86_64-sie-ps5  %s -o - | FileCheck --check-prefix=PS4 %s
 
 define void @test_ubsantrap() {
 ; CHECK-LABEL: test_ubsantrap


        


More information about the llvm-commits mailing list