mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
R600/SI: Custom lower i1 stores
These are sometimes created by the shrink to boolean optimization in the globalopt pass. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203280 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -98,6 +98,7 @@ SITargetLowering::SITargetLowering(TargetMachine &TM) :
|
||||
setOperationAction(ISD::LOAD, MVT::v4i32, Custom);
|
||||
setOperationAction(ISD::LOAD, MVT::v8i32, Custom);
|
||||
|
||||
setOperationAction(ISD::STORE, MVT::i1, Custom);
|
||||
setOperationAction(ISD::STORE, MVT::i32, Custom);
|
||||
setOperationAction(ISD::STORE, MVT::i64, Custom);
|
||||
setOperationAction(ISD::STORE, MVT::i128, Custom);
|
||||
@@ -844,6 +845,11 @@ SDValue SITargetLowering::LowerSTORE(SDValue Op, SelectionDAG &DAG) const {
|
||||
if (VT.isVector() && VT.getVectorNumElements() >= 8)
|
||||
return SplitVectorStore(Op, DAG);
|
||||
|
||||
if (VT == MVT::i1)
|
||||
return DAG.getTruncStore(Store->getChain(), DL,
|
||||
DAG.getSExtOrTrunc(Store->getValue(), DL, MVT::i32),
|
||||
Store->getBasePtr(), MVT::i1, Store->getMemOperand());
|
||||
|
||||
if (Store->getAddressSpace() != AMDGPUAS::PRIVATE_ADDRESS)
|
||||
return SDValue();
|
||||
|
||||
|
Reference in New Issue
Block a user