1. Nov 04, 2020
    • Valentin Clement's avatar
      [openmp][openacc][NFC] Simplify access and validation of DirectiveBase information · 6c337945
      Valentin Clement authored
      This patch adds some helper in the DirectiveLanguage wrapper to initialize it from
      the RecordKeeper and validate the records. This simplify arguments in lots of function
      since only the DirectiveLanguge is passed.
      
      Reviewed By: kiranchandramohan
      
      Differential Revision: https://reviews.llvm.org/D90358
      6c337945
    • Sanjay Patel's avatar
      [CostModel] fix cost calc bug for sadd/ssub with overflow · 3c050a59
      Sanjay Patel authored
      As noted in D90554, there's an opcode typo in using an easily
      misused cost model API: getCmpSelInstrCost(). Beyond that, the
      assumed sequence of ops is questionable, but that would be
      another patch.
      
      My guess is that the x86 test diffs show that we are probably
      wrong both before and after this change, so there will be no
      practical difference.
      As an example, I tried this test which shows a cost of '7'
      either way:
      
        define <4 x i32> @sadd(<4 x i32> %va, <4 x i32> %vb) {
          %V4I32  = call {<4 x i32>, <4 x i1>}  @llvm.sadd.with.overflow.v4i32(<4 x i32> %va, <4 x i32> %vb)
          %ov = extractvalue {<4 x i32>, <4 x i1>} %V4I32, 1
          %r = extractvalue {<4 x i32>, <4 x i1>} %V4I32, 0
          %z = select <4 x i1> %ov, <4 x i32> <i32 42, i32 42, i32 42, i32 42>, <4 x i32> %r
          ret <4 x i32> %z
        }
      
        $ llc -o - sadd.ll -mattr=avx
              vpaddd  %xmm1, %xmm0, %xmm2
              vpcmpgtd        %xmm2, %xmm0, %xmm0
              vpxor   %xmm0, %xmm1, %xmm0
              vblendvps       %xmm0, LCPI0_0(%rip), %xmm2, %xmm0a
      
      Differential Revision: https://reviews.llvm.org/D90681
      3c050a59
  2. Nov 03, 2020