From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 8855538582B5 for ; Thu, 22 Sep 2022 18:49:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8855538582B5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663872570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oxnG3uxBUhD3nYz882imwpk+KZljq+G3Fg+FntZRgY4=; b=R9i5ErXaXZ4J5pSYXdq6hweOwWyYZzlUWcejxcBbw1KbeC0JJTdx57M8S9GBh3CyMQVOxx VkHJS4IEIsHoAdL4CE3bwge9QAdu12AWDbJ+6pbGy10zOzJhDVFzLH5As+ahkHJZLnRLoA 5GHCkDQY2hJVJ8AlKiU9f2NJjCIJoI0= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-360-EJoAt32YNtmG-593-15qMQ-1; Thu, 22 Sep 2022 14:49:28 -0400 X-MC-Unique: EJoAt32YNtmG-593-15qMQ-1 Received: by mail-il1-f197.google.com with SMTP id w10-20020a056e021a6a00b002f5f24e56aeso6175471ilv.19 for ; Thu, 22 Sep 2022 11:49:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=oxnG3uxBUhD3nYz882imwpk+KZljq+G3Fg+FntZRgY4=; b=1+XvK8RGNeqQavx9yWxC9rjQy80qJWw5aojXct2lPS8CJCDEkbMfzH7mYECDk26xff 8xcqzQH4szZMnfETJvcHD0q4FwBKAliYhZORoP7mqK/N0517aI/wEY9r9usrDavSWu7L BFNpR9rgvf5T21NP8FQS7/gUhGAC2lRbhX6Ei+nAmbzESuLcpE8+je4ysHPLUWgjFWZ8 2SbLrKy5udRR3VnbWC1+Q2tD2iyZDSPbLH81KbD+cIpGfzk7a2d4NkpV7ZJHHzfENzgt A1NNyYJUc4q3TdRGCHHqNWDI/Qvy8ii+zxTNs3Q8iHvoRPOKhDh2Nketz7WY1FITYUk2 n9Qw== X-Gm-Message-State: ACrzQf3k5edsibdRtOHH1k4CzMCv6WveQLE6IOjE3kOBSblCT2a4bdq/ gaVyswO6Z4IMhO3q1PwFTf53aFv5XPyl4J2P0KLYSIUuxfEavu8h3W8hBhGGEUwb0BZr1DJoXjE etXz/1uuaOq+sAYtggjV26eYliDPlOsrjna1YlzksZg1jt0uZnxzFUF8+kkOiBsomynkd8g== X-Received: by 2002:a05:6602:27c3:b0:68b:b670:2bbb with SMTP id l3-20020a05660227c300b0068bb6702bbbmr2193250ios.201.1663872567632; Thu, 22 Sep 2022 11:49:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yR2ubkJc8Ie1WjH1HEReb6ex1hHjESGtkWxmCbr+b5Aw+M8UvDuht3JbSwZGCniqihGn+0g== X-Received: by 2002:a05:6602:27c3:b0:68b:b670:2bbb with SMTP id l3-20020a05660227c300b0068bb6702bbbmr2193244ios.201.1663872567386; Thu, 22 Sep 2022 11:49:27 -0700 (PDT) Received: from ?IPV6:2607:fea8:a263:f600::3dbe? ([2607:fea8:a263:f600::3dbe]) by smtp.gmail.com with ESMTPSA id e15-20020a026d4f000000b003435c50f000sm2550862jaf.14.2022.09.22.11.49.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Sep 2022 11:49:26 -0700 (PDT) Message-ID: <571782f9-72e6-5c30-da55-b8d62d3a153e@redhat.com> Date: Thu, 22 Sep 2022 14:49:25 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 To: gcc-patches From: Andrew MacLeod Subject: [PATCH 00/17] Move builtin functions to range-ops. Cc: "hernandez, aldy" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Builtin functions have been handled until now as special cases in gimple-range-fold.cc. This set of patches makes the changes required to create a range_operator for those functions.  This allows them to behave like a normal unary/binary operation through out the ranger ecosystem.  In particular, it will enable us to make GORI aware of them as we can now provide op1_range and op2_range routines, as well as registering an relations as needed.  None of these enhanced functions are provided yet, this is strictly a conversion.  This enables us to do this for any operation with 1 or 2 operands. There are 17 patches, some are bug fixes, some are infrastructure, a couple are just missing functionality, but most are them are conversions of the builtins.  I did each builtin as a separate patch so if a regression triggers, we can pinpoint it faster. Of note: Patch 2 : Modifies the range_op_handler class to store an integer handler and a float handler rather than the old tree-code and type.  By looking up the handler immediately and storing the pointer, this opens up the possibility of processing handlers which are not in a tree-code table. Patch 3 : Range-ops is suppose to be IL independent, designed to work in RTL land as well.  A little bit of gimple had crept in, and I needed a layer that is gimple aware.  This patch introduces a gimple_range_op_handler which inherits from range_op_handler, and acts as the connector between the gimple IL and range-ops. Some of that code was in range-ops, and a lot more was located in the GORI file.  All those bits and pieces have been moved into the new class. Patch 7 : This patch adjusts gimple_range_op_handler constructor to also check if a builtin function call might have a range_operator object available, and if so, return that.  This initial conversion also adds CFN_BUILT_IN_CONSTANT_P as the first builtin, removing it from the big switch in gimple-range-fold.cc. Patch 8-16 :  Moves SIGNBIT, TOUPPER/LOWER, POPCOUNT, CLZ, CTZ, CLRSB, UBSAN*, STRLEN, and GOACC to range-ops. patch 17: Finally, moves CFA_BUILT_IN_PARITY to range-ops, and removes the builtin-function code checks from range_of_call in gimple_range-fold.cc These patches all bootstrap on x86_64-pc-linux-gnu with no regressions.   Performance wise, it all ends up as approximately a wash. (VRP a hair slower, threading a hair faster) Pushed. Andrew